diff --git a/content/community/write-a-blog-post/contents.lr b/content/community/write-a-blog-post/contents.lr index d5827c94f..c8fc3c595 100644 --- a/content/community/write-a-blog-post/contents.lr +++ b/content/community/write-a-blog-post/contents.lr @@ -54,6 +54,9 @@ Once you have written your post, you can either send it to us (Markdown is easie --- pub_date: Replace this text with the publication date in YYYY-MM-DD format. --- + excerpt: Replace this text with a brief summary of your post to capture readers' interest. + If you do not add an excerpt, the first 100 words of your content will be used automatically. + --- body: Replace this text with your post's content (minus the title). This field accepts Markdown for formatting. If you're including images, you can use the Markdown image syntax i.e. ![image-title](image-file-name.jpg). diff --git a/models/blog-post.ini b/models/blog-post.ini index a5e8cefb4..735e12fcb 100644 --- a/models/blog-post.ini +++ b/models/blog-post.ini @@ -29,3 +29,7 @@ type = strings [fields.body] label = Body type = markdown + +[fields.excerpt] +label = Excerpt +type = markdown \ No newline at end of file diff --git a/themes/vocabulary_theme/templates/macros/posts.html b/themes/vocabulary_theme/templates/macros/posts.html index c898e7864..53f6381d3 100644 --- a/themes/vocabulary_theme/templates/macros/posts.html +++ b/themes/vocabulary_theme/templates/macros/posts.html @@ -9,7 +9,11 @@

{{ post.title }}

{{ render_authors_byline(post) }}
+ {% if post.excerpt %} + {{ post.excerpt }} + {% else %} {{ post.body | excerpt | string | striptags() | truncate(100) }} + {% endif %}