From 0d696e507cfc3febd4356decac49ab76f779b68e Mon Sep 17 00:00:00 2001 From: Claudia Reynders <> Date: Mon, 25 Apr 2022 21:37:05 +0200 Subject: [PATCH] Added new article layout template that will be rendered inside a page template. Added an alias for the new article layout to Eleventy config --- .eleventy.js | 2 ++ src/_includes/layouts/article.njk | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/_includes/layouts/article.njk diff --git a/.eleventy.js b/.eleventy.js index 1b37f88..207f858 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -6,6 +6,8 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPlugin(eleventyNavigationPlugin) eleventyConfig.addLayoutAlias('page', 'layouts/page') + eleventyConfig.addLayoutAlias('article', 'layouts/article') + eleventyConfig.addFilter('readableDate', dateObj => { return DateTime.fromJSDate(dateObj, { zone: "Europe/Paris", diff --git a/src/_includes/layouts/article.njk b/src/_includes/layouts/article.njk new file mode 100644 index 0000000..fc2e125 --- /dev/null +++ b/src/_includes/layouts/article.njk @@ -0,0 +1,11 @@ +--- +layout: page +--- + +
+

{{ title }}

+ + Published: + + {{ content | safe }} +
\ No newline at end of file