hugo-prose icon indicating copy to clipboard operation
hugo-prose copied to clipboard

[QUESTION] Adding "description" to list.html

Open lucharo opened this issue 10 months ago • 3 comments

Hey @yihui, first of all, thanks so much for this theme, I am having a lot of fun and learning a lot making it my own

I am trying to add a description of sorts under "Posts" (as an example): image

I see that the Posts or Work pages (from the example page) get rendered from the list.html template but I have not been able to figure out how parameters like .IsHome or .Title get passed down to the renderer. In essence, I would like to have a Posts page and a Work page with a short paragraph within them. When I create an _index.md in the posts/ folder for example a "card" gets created instead of the plain HTML default output. See below:

default page: image

When I add _index.md:

image

I'd like to keep the look of the default Posts page

lucharo avatar Apr 05 '24 18:04 lucharo

When I create an _index.md in the posts/ folder for example a "card" gets created instead of the plain HTML default output.

The content of _index.md is rendered here:

https://github.com/yihui/hugo-prose/blob/63481f54dd3c4195816fad48438c0f33f7f29169/layouts/_default/list.html#L9-L13

You can use any HTML tags and style them with CSS as you wish.

yihui avatar Apr 06 '24 04:04 yihui

Thanks for pointing me to those lines, so if I change the article-list CSS I should be able to change the default behaviour of creating a card?

lucharo avatar Apr 06 '24 16:04 lucharo

If I understand correctly, you want the style of the description to be different with cards. Then what you can do is use a different class name for the description and define the CSS for that class as necessary.

yihui avatar Apr 06 '24 23:04 yihui

Ok understood! Thanks :) I'll keep digging

lucharo avatar Apr 16 '24 16:04 lucharo