mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
re-add support for 'unpublished: true'
This commit is contained in:
@@ -160,6 +160,15 @@ export default async function (eleventyConfig) {
|
||||
// Use our own markdown instance
|
||||
eleventyConfig.setLibrary('md', markdown);
|
||||
|
||||
// for files with `unpublished: true`, it will make sure they do not make it into the final build at all, but will be usable in development.
|
||||
eleventyConfig.addPreprocessor('unpublished', '*', (data, content) => {
|
||||
if (data.unpublished && process.env.ELEVENTY_RUN_MODE === 'build') {
|
||||
return false
|
||||
}
|
||||
|
||||
return content
|
||||
})
|
||||
|
||||
// Add anchors to headings
|
||||
eleventyConfig.addTransform('doc-transforms', function (content) {
|
||||
let doc = HTMLParse(content, { blockTextElements: { code: true } });
|
||||
|
||||
Reference in New Issue
Block a user