Home Comments Thread
New Thread

8 Comments

giscus-bot giscus-bot 2022-12-17 03:51:53
Guest *Katie Larson* @ 2018-06-14 01:02:44 originally posted:

This was driving me crazy. Thank you!

giscus-bot giscus-bot 2022-12-17 03:51:54
Guest *Stuart Hertzog* @ 2018-06-17 18:53:40 originally posted:

When I add the code to _default/list.html for hyde-hyde template as described, and add "description" to the YAML meta for the post, then rebuild the site, the "posts" listing page shows a blank screen. Is there any other template file to which I have to add this code?

giscus-bot giscus-bot 2022-12-17 03:51:55
访客 *林志扬* @ 2018-07-20 13:22:35 写道:

I suggest using (.|n)*? instead of .*? when searching for paragraph contents, since a single line break won't start a new paragraph.

giscus-bot giscus-bot 2022-12-17 03:51:56
Guest *Luka* @ 2018-08-12 21:51:24 originally posted:

How do you not get advertising from Disqus? When I try configuring it on my blog, I got other blogs' advertising...

giscus-bot giscus-bot 2022-12-17 03:51:57
Guest *Zhen Li* @ 2018-12-07 07:55:05 originally posted:

This is amazing! Thank you so much!

giscus-bot giscus-bot 2022-12-17 03:51:58
Guest *dan* @ 2019-07-26 06:23:35 originally posted:

Great post, thank you! This helped get me started, but I didn't like that it truncated all content not wrapped in paragraph tags (e.g. lists, images, codeblocks, etc.) to [...]. Not a very helpful summary. I updated the RegEx to allow any tag type and it's working much better now:
https://gist.github.com/dbechrd/8fda19b671d793a498ff9d5245e5d090

giscus-bot giscus-bot 2022-12-17 03:51:58
Guest *Trang* @ 2020-01-03 23:26:32 originally posted:

Yihui, thank you so much for the clear explanation! This helped me publish my very first post!

However, I'm trying to modify the metadata in my head.html file, here's one line for example:
<meta name="description" content="{{ if .Description }}{{ .Description }}{{ else }}{{ .Summary | plainify }}{{ end }}
"/>

Because everything after content= is in double quote, do you have any recommendation on how to replace this .Summary?

Thank you so much!

Trang

haggishunk haggishunk 2023-10-12 05:03:48

Thank you for teaching me to fish. This was a very helpful and illuminating article that had me learn a bit more about the hugo ecosystem.

I found the theme I was using called out to a {{ partial "post-summary.html" . }} so I created a copy of the original ./layouts/partials/post-summary.html from the theme into my hugo site base dir. I tried to avoid replicating the html and templating from the theme in this override customization file and just using scratch set to change the .Summary variable, but in the end I had to remove the existing {{ .Summary | safeHTML }} and swap in the code snippet in your article.

My site looks better already.

yihui yihui 2023-10-12 13:07:50

Good to know the post helped you a bit!

Sign in to join the discussion

Sign in with GitHub