Implement draft system
This commit is contained in:
1 parent
42cee91016
commit
6f5394010b
4 files changed
+21
-2
No files matched your search
@@ -100,6 +100,14 @@ export default async function (eleventyConfig) {
|
||||
return arr.slice(1, arr.length);
|
||||
});
|
||||
|
||||
// Preprocessors
|
||||
// Exclude drafts from full build
|
||||
eleventyConfig.addPreprocessor("drafts", "*", (data, content) => {
|
||||
if (data.draft && process.env.ELEVENTY_RUN_MODE === "build") {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Transforms
|
||||
eleventyConfig.addTransform("prettier", function (content, outputPath) {
|
||||
if (outputPath && outputPath.endsWith(".html")) {
|
||||
|
||||
Reference in new issue
Block a user