From 019abbb29f1ae74f94882dff472285f4828ec0c2 Mon Sep 17 00:00:00 2001 From: Starfall Date: Wed, 17 May 2023 20:49:33 -0500 Subject: feature: blog post summaries --- eleventy.config.js | 3 ++- src/blog.njk | 3 +++ src/blog/foobar.md | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index 2d222ae..05a4db3 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -23,7 +23,8 @@ module.exports = function(eleventyConfig) { engines: { toml: toml.parse.bind(toml) }, - language: 'toml' + language: 'toml', + excerpt: true }) return { diff --git a/src/blog.njk b/src/blog.njk index dd04288..a8ec510 100644 --- a/src/blog.njk +++ b/src/blog.njk @@ -10,5 +10,8 @@ reverse = true

{{ post.data.title }}

+ {%- if post.data.page.excerpt -%} +

{{ post.data.page.excerpt | safe }} + {%- endif -%}

{% endfor %} diff --git a/src/blog/foobar.md b/src/blog/foobar.md index 9c3c805..499414e 100644 --- a/src/blog/foobar.md +++ b/src/blog/foobar.md @@ -4,3 +4,5 @@ tags = [ "post" ] title = "Second post" --- Second post, hooray! +--- +This one has an excerpt so there's extra stuff under the cut! -- cgit