A bit of code cleanup

This commit is contained in:
Zach Leatherman
2023-01-24 08:08:52 -06:00
parent 185b2888ed
commit 3d57dc956f
4 changed files with 94 additions and 82 deletions

View File

@ -1,31 +0,0 @@
module.exports = {
// Draft posts:
eleventyComputed: {
permalink: data => {
if(data.draft) {
// BUILD_DRAFTS is set in eleventy.config.js
if(process.env.BUILD_DRAFTS) {
return data.permalink;
}
// Always skip during non-watch/serve builds
return false;
}
return data.permalink;
},
eleventyExcludeFromCollections: data => {
if(data.draft) {
// BUILD_DRAFTS is set in eleventy.config.js
if(process.env.BUILD_DRAFTS) {
return data.eleventyExcludeFromCollections;
}
// Always exclude from non-watch/serve builds
return true;
}
return data.eleventyExcludeFromCollections;
}
},
};