I’m continuing to try and grok Hugo, and have two questions I’m hoping to get some help with:
Is there a way to set up post types such that different styling can be applied in paginated list or category page views? For example, having a different separator graphic or background colour for a specified post element.
For my long-form posts, how do I code in a description or summary that I can not only apply an alternate style to, but would also allow me to only show that — instead of the entire post — along with the title in the archive or paginated list views?
I have a quick answer for #2. You can put this tag after the intro:
<!--more-->
Then it will be used as the summary. You can mess around with a custom template if the default is not displaying the summary on the list page. Mine has this for layouts/_default/list.html.
Hi Ben, thanks very much for your help, I’ve added your code into my layouts/partials/li.html file but can’t seem to get only the summary to display. I’m trying to create summaries with a shortcode as follows:
When I use the shortcode the text includes truncated content, but when I manually insert the <!—more—> tag myself it works and displays only the post summary. Any idea what I’m doing wrong?
Just another word for understanding something. I believe there’s also a UNIX and Linux command line tool called the same, though I can’t say what it’s for as I’ve never used it.
Just searching for a solution and maybe someone can help. I did use the <!--more--> tag in the past but could be possible that it stopped working lately?
I use it always on my long-form posts but lately M.B. does not respect the more/summary. It always displays the full post on the Index page. @manton was there a chance that breaks the summary handling in that way?