Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description of the post doesn't appear in the main page #72

Open
aswiniab opened this issue Aug 29, 2020 · 1 comment
Open

Description of the post doesn't appear in the main page #72

aswiniab opened this issue Aug 29, 2020 · 1 comment

Comments

@aswiniab
Copy link

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.

Markdown file of the post:
description

Web-page showing the beginning of the main content instead of description:
main page

@kimcodekill
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants