Template
draft handling
This commit is contained in:
@@ -69,6 +69,17 @@ export default async function (eleventyConfig) {
|
|||||||
/* All filters from _config/filters.js */
|
/* All filters from _config/filters.js */
|
||||||
eleventyConfig.addPlugin(pluginFilters);
|
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 */
|
/* Shortcodes */
|
||||||
eleventyConfig.addShortcode("currentBuildDate", () => {
|
eleventyConfig.addShortcode("currentBuildDate", () => {
|
||||||
return new Date().toISOString();
|
return new Date().toISOString();
|
||||||
|
|||||||
Reference in New Issue
Block a user