-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump the metalsmith group with 2 updates #2966
Changes from all commits
0753639
bd536f6
a62e70f
11f4bad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,14 @@ const { readFileSync } = require('fs') | |
const { dirname, join, resolve } = require('path') | ||
|
||
// Third party metalsmith plugins and utilities | ||
const inplace = require('@metalsmith/in-place') // render templating syntax in source files | ||
const inPlace = require('@metalsmith/in-place') // render templating syntax in source files | ||
const layouts = require('@metalsmith/layouts') // apply layouts to source files | ||
const markdown = require('@metalsmith/markdown') // render markdown in source files | ||
const permalinks = require('@metalsmith/permalinks') // apply a permalink pattern to files | ||
const postcss = require('@metalsmith/postcss') | ||
const sass = require('@metalsmith/sass') // convert Sass files to CSS using Dart Sass | ||
const { glob } = require('glob') // Match files using glob patterns | ||
const Metalsmith = require('metalsmith') // static site generator | ||
const canonical = require('metalsmith-canonical') // add a canonical url property to pages | ||
const renamer = require('metalsmith-renamer') // rename files | ||
const slugger = require('slugger') // generate slugs from titles | ||
|
||
// Helpers and config | ||
|
@@ -102,16 +100,6 @@ module.exports = metalsmith | |
env: (value) => metalsmith.env(value) | ||
}) | ||
|
||
// rename .md files to .md.njk, so they're passed through the Nunjucks parser | ||
.use(renamer({ | ||
markdown: { | ||
pattern: '**/*.md', | ||
rename: (name) => { | ||
return `${name}.njk` | ||
} | ||
} | ||
})) | ||
|
||
// extract page headings | ||
.use(extractPageHeadings()) | ||
|
||
|
@@ -203,19 +191,23 @@ module.exports = metalsmith | |
.use(titleChecker()) | ||
|
||
// render templating syntax in source files | ||
.use(inplace({ | ||
pattern: '**/*.njk', | ||
.use(inPlace({ | ||
pattern: '**/*.{md,njk}', | ||
transform: 'jstransformer-nunjucks', | ||
engineOptions: nunjucksOptions | ||
})) | ||
|
||
// render markdown in source files | ||
.use(markdown({ | ||
.use(inPlace({ | ||
transform: 'jstransformer-marked', | ||
engineOptions: { | ||
breaks: true, // Enable line breaks | ||
mangle: false, // Don't mangle emails | ||
smartypants: true, // use "smart" typographic punctuation | ||
highlight: highlighter, | ||
renderer: new DesignSystemRenderer() // Markdown renderer | ||
|
||
// Custom markdown renderer | ||
renderer: new DesignSystemRenderer() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our custom renderer uses a separate Though I guess There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @domoscargin Good point. Shall I drop that last commit, one for another day? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nah, keep it - it's the same issue but we drop a dependency, so an improvement in that sense! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brill, will do For reference, the dependencies are still the same (which helps) Before├─┬ @metalsmith/[email protected]
│ └── [email protected]
└── [email protected] After├─┬ [email protected]
│ └── [email protected]
└── [email protected] |
||
} | ||
})) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉