Skip to content

Commit

Permalink
Make section heading IDs less random
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Aug 4, 2017
1 parent d97b926 commit b26ec62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion docs/section.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set id = (title + '-') | lower | replace(' ', '-') | addRandom(1000, 9999) | urlencode %}
{% set id = (title + '-31415927') | lower | replace(' ', '-') | urlencode %}

<article class="sg-article">
{% if title %}
Expand Down
14 changes: 0 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,6 @@ const htmlRenderComponents = (outputPath, env) => {
nunjucksEnv.addGlobal('sgNav', 'docs/nav.njk')
nunjucksEnv.addGlobal('sgFooter', 'docs/footer.njk')

nunjucksEnv.addFilter('addRandom', (str, min, max) => {
min = Math.ceil(min)
max = Math.floor(max)

return str + (Math.floor(Math.random() * (max - min)) + min)
})

nunjucksEnv.render('src/layouts/components.njk', (error, result) => {
if (error) {
nunjucksError(error)
Expand All @@ -435,13 +428,6 @@ const htmlRenderPrototypes = (outputPath, env) => {
})
nunjucksEnv.addGlobal('sgNav', 'docs/nav.njk')

nunjucksEnv.addFilter('addRandom', (str, min, max) => {
min = Math.ceil(min)
max = Math.floor(max)

return str + (Math.floor(Math.random() * (max - min)) + min)
})

nunjucksEnv.render(`src/prototypes/${fileName}.njk`, (error, result) => {
if (error) {
nunjucksError(error)
Expand Down

0 comments on commit b26ec62

Please sign in to comment.