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

Best way to show posts in excerpt view on index.html (Home) #296

Open
appledispatch opened this issue Feb 13, 2022 · 0 comments
Open

Best way to show posts in excerpt view on index.html (Home) #296

appledispatch opened this issue Feb 13, 2022 · 0 comments

Comments

@appledispatch
Copy link

appledispatch commented Feb 13, 2022

The default Lanyon settings shows the full view for posts on the index.html page. I'm attempting to edit the index.html file to show the excerpt for posts, so that only the title, date and first paragraph of each post are displayed.

What do I need to add or modify in index.html to make this work?

I hope someone can help me with this issue. Thanks!

Update: After working on this some more, I found a helpful discussion on Stack Overflow

The solution that yielded the best result was replacing {{ post.content }} in index.html with
{{ post.content | markdownify | strip_html | truncatewords: 50 }}

Using {{ post.excerpt }} did not lead to the correct formatting of each post on the Home page.

Maybe the discussion link and my experimentation will help others using this theme.

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

1 participant