Template
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8201b368ed | ||
|
|
03e85bcb35 |
No files matched your search
@@ -1,3 +1,2 @@
|
||||
_live
|
||||
_site
|
||||
node_modules
|
||||
@@ -69,6 +69,17 @@ export default async function (eleventyConfig) {
|
||||
/* All filters from _config/filters.js */
|
||||
eleventyConfig.addPlugin(pluginFilters);
|
||||
|
||||
/* 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();
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "rm -rf _site && npx @11ty/eleventy --quiet",
|
||||
"dev": "rm -rf _live && npx @11ty/eleventy --serve --quiet --output _live"
|
||||
"dev": "rm -rf _site && npx @11ty/eleventy --serve --quiet --output _site"
|
||||
},
|
||||
"author": "Lee Cattarin",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
||||
Reference in new issue
Block a user