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

Show post description as summary in homepage #54

Open
alastor2831 opened this issue Feb 13, 2019 · 3 comments
Open

Show post description as summary in homepage #54

alastor2831 opened this issue Feb 13, 2019 · 3 comments

Comments

@alastor2831
Copy link

By default the theme takes the first paragraph or so of a post and uses it as the summary with the {{ .Summary }} variable, which is printed in the homepage
image

I would like to write my own summary instead. So far I tried setting both a description field and a summary field in the YAML but nothing really changed.

---
description : "some text"
summary : "some other text"
---

Any idea?

@appernetic
Copy link
Collaborator

Have you tried with a large first letter? Another solution is to add a description parameter. You can do that by overriding templates in your root layouts folder, which is the best practice for customization.

@alastor2831
Copy link
Author

Not sure what you mean by "large first letter", but I found a working solution on Yihui's blog.

All I did was pasting the code he posted over the {{ .Summary }} line in /layouts/partials/portfolio.html . This way if you have a field description in the YAML it will be displayed in the homepage under the title.

@appernetic
Copy link
Collaborator

Ok, great that you found a solution!

Can you post the code here?

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