Description of the post doesn't appear in the main page
aswiniab opened this issue · comments
This is a great theme. I have used it for my blog. Thank you.
In the main page of the web-page, inside the box for a post, I wish to have a brief description of the post to appear along with the title of the post. Presently, the main content is getting displayed, instead of the description that is given in the markdown file of the post.
Please let me know if this can be resolved.
Web-page showing the beginning of the main content instead of description:
I have a fix for you, if it's still relevant.
index.html handles what is shown, in this case "post.content", on line 12.
changing this to "post.description" shows the description for each post."strip_html" removes tags, which your descriptions shouldnt have so its not necessary. "truncatewords: 15" adds the "..." after 15 words but may be removable if you keep your descriptions short.
tl;dr:
change line 12 in index.html from
<p>{{ post.content | strip_html | truncatewords: 15 }}</p>
to
<p>{{ post.description | truncatewords: 15 }}</p>
or optionally (if you keep your descriptions less than 15 words or find descriptions longer than 15 words being truncated annoying)
<p>{{ post.description }}</p>