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

Curious to know how to control the part of each blog that will display in the homepage of posts #612

Open
Huilin-Li opened this issue Apr 17, 2024 · 2 comments

Comments

@Huilin-Li
Copy link

For example, in this place (highlight in red rectangle), I only want to show the first paragraph of each blog.
image

@alex-shpak
Copy link
Owner

alex-shpak commented Apr 25, 2024

hello! There is no configuration for this text (it uses summary provided by Hugo). But you can adjust template if you want in
/layouts/posts/list.html

https://github.com/alex-shpak/hugo-book/blob/master/layouts/posts/list.html#L9

@Huilin-Li
Copy link
Author

hello! There is no configuration for this text (it uses summary provided by Hugo). But you can adjust template if you want in /layouts/posts/list.html

https://github.com/alex-shpak/hugo-book/blob/master/layouts/posts/list.html#L9

@alex-shpak Hi, Alex, thanks for your reply. Since I don't have too much knowledge about html language, may I ask what key words I need to google about modifying your layout repository? For example, you point out the line-9 in layouts/posts/list.html, and I checked it is {{- .Summary -}}. So, I go to google html .Summary. However, google gives me all things about how to use <summary></summary> in <details></details> as a markdown.

I think there must be a knowledge gap, so I don't understand the code in layouts folder. Would you mind sharing some information or experience about learning and practicing these things? Thanks in advance!

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