Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/community/write-a-blog-post/contents.lr
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 4 additions & 0 deletions models/blog-post.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ type = strings
[fields.body]
label = Body
type = markdown

[fields.excerpt]
label = Excerpt
type = markdown
4 changes: 4 additions & 0 deletions themes/vocabulary_theme/templates/macros/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
<h4 class="b-header"><a class="blog-title" href="{{ post|url }}">{{ post.title }}</a></h4>
{{ render_authors_byline(post) }}
<div class="excerpt">
{% if post.excerpt %}
{{ post.excerpt }}
{% else %}
{{ post.body | excerpt | string | striptags() | truncate(100) }}
{% endif %}
</div>
</div>
</article>
Expand Down
Loading