Skip to content

Commit

Permalink
adding just the styling for header update
Browse files Browse the repository at this point in the history
  • Loading branch information
gracepark committed Jun 4, 2021
1 parent 3157980 commit 05fb4cb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/get-mini-toc-items.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const cheerio = require('cheerio')
const { range } = require('lodash')

module.exports = function getMiniTocItems (html, maxHeadingLevel = 3, headingScope = '') {
module.exports = function getMiniTocItems (html, maxHeadingLevel = 2, headingScope = '') {
const $ = cheerio.load(html, { xmlMode: true })

// eg `h2, h3` or `h2, h3, h4` depending on maxHeadingLevel
Expand Down
2 changes: 0 additions & 2 deletions middleware/render-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ module.exports = async function renderPage (req, res, next) {
)
)
}

if (req.method === 'HEAD') {
return res.status(200).end()
}
Expand Down Expand Up @@ -141,7 +140,6 @@ module.exports = async function renderPage (req, res, next) {

// collect URLs for variants of this page in all languages
context.page.languageVariants = Page.getLanguageVariants(req.path)

// Stop processing if the connection was already dropped
if (isConnectionDropped(req, res)) return

Expand Down
2 changes: 1 addition & 1 deletion script/content-migrations/update-headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const re = /^#.*\n/gm

async function updateMdHeaders (dir) {
walk(dir, { includeBasePath: true, directories: false })
.filter(file => !file.endsWith('README.md'))
.filter(file => !file.endsWith('README.md') && !file.includes('content/rest/reference'))
.forEach(file => {
fs.readFile(file, 'utf8', (err, data) => {
if (err) return console.error(err)
Expand Down
27 changes: 20 additions & 7 deletions stylesheets/headings.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
h1,
h2,
h3,
h4 {
h3 {
a {
color: var(--color-auto-gray-9);
}
}

// all h3 headers that are links should be blue-500
h3 a {
// all h2 headers that are links should be blue-500
h2 a {
color: var(--color-auto-blue-5);
}

// ... except those on each product's toc
.product-landing h3 a {
.product-landing h2 a {
color: var(--color-auto-gray-9);
}

Expand All @@ -22,12 +21,26 @@ h3 a {
h2,
h3,
h4,
h5,
h6 {
h5 {
font-family: $font-mktg;
font-weight: $font-weight-semibold;
padding-top: $spacer-3;
}
h2 {
font-size: 1.25em;
border-bottom: none;
}
h3 {
font-size: 1em;
}

h4 {
font-size: 0.875em;
}

h5 {
font-size: 0.85em;
}
}

// needs specificity to override
Expand Down

0 comments on commit 05fb4cb

Please sign in to comment.