build prev and add draft handling
This commit is contained in:
1 parent
422a0e45e8
commit
f89f135f9b
280 files changed
+3612
-3571
No files matched your search
@@ -116,6 +116,17 @@ export default async function(eleventyConfig) {
|
||||
/* Syntax highlighting */
|
||||
eleventyConfig.addPlugin(syntaxHighlight);
|
||||
|
||||
/* Draft handling */
|
||||
eleventyConfig.addPreprocessor("drafts", "*", (data, content) => {
|
||||
if (data.draft) {
|
||||
data.title = `${data.title} (draft)`;
|
||||
}
|
||||
|
||||
if(data.draft && process.env.ELEVENTY_RUN_MODE === "build") {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
/* Shortcodes */
|
||||
eleventyConfig.addShortcode("currentBuildDate", () => {
|
||||
return (new Date()).toISOString();
|
||||
|
||||
Reference in new issue
Block a user