Added new article layout template that will be rendered inside a page template.

Added an alias for the new article layout to Eleventy config
This commit is contained in:
Claudia Reynders 2022-04-25 21:37:05 +02:00
parent 54ff1740bc
commit 0d696e507c
2 changed files with 13 additions and 0 deletions

View File

@ -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",

View File

@ -0,0 +1,11 @@
---
layout: page
---
<article>
<h1>{{ title }}</h1>
<small>
Published: <time>{{ date | readableDate }}</time>
</small>
{{ content | safe }}
</article>