diff options
author | Starfall <us@starfall.systems> | 2023-05-17 20:49:33 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-05-24 12:51:16 -0500 |
commit | 019abbb29f1ae74f94882dff472285f4828ec0c2 (patch) | |
tree | a5015b242363446033241f6f01b3552a0147e4ae | |
parent | ab48bfa194a3d24679062217dbe55e7eead51bee (diff) |
feature: blog post summaries
-rw-r--r-- | eleventy.config.js | 3 | ||||
-rw-r--r-- | src/blog.njk | 3 | ||||
-rw-r--r-- | src/blog/foobar.md | 2 |
3 files changed, 7 insertions, 1 deletions
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 <article> <h2><a href="{{ post.url | url }}">{{ post.data.title }}</a></h2> <time datetime="{{ post.date | rfc3339_datetime }}">{{ post.date | local_date }}</time> + {%- if post.data.page.excerpt -%} + <p>{{ post.data.page.excerpt | safe }} + {%- endif -%} </article> {% 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! |