Skip to content

Commit

Permalink
Don't emit drafts in production
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges committed Jun 14, 2024
1 parent 3260895 commit 5764da5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/articles/articles.11tydata.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ let data = {
/* copy across our own attributes */
titleLang: data => data.titleLang,
draft: data => data.draft,
}
}
permalink: data => {
if (IS_PRODUCTION && data.draft === true) {
return false;
} else {
return undefined;
}
},
},
},
}

//if (IS_PRODUCTION) {
Expand Down
11 changes: 10 additions & 1 deletion src/games/games.11tydata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ const { IS_PRODUCTION } = require("../../helpers");

let data = {
"layout": "article",
"tags": "game"
"tags": "game",
eleventyComputed: {
permalink: data => {
if (IS_PRODUCTION && data.draft === true) {
return false;
} else {
return undefined;
}
},
},
};

//if (IS_PRODUCTION) {
Expand Down

0 comments on commit 5764da5

Please sign in to comment.