imfing / hextra

🔯 Modern, batteries-included Hugo theme for creating beautiful doc, blog and static websites
https://imfing.github.io/hextra/
MIT License
465 stars 126 forks source link

Show "summary" and "last modified" under the title at the top of the page #382

Open trwnh opened 2 months ago

trwnh commented 2 months ago

Feature Description

Show "summary" and "last modified" under the title at the top of the page

Problem/Solution

Right now this information is not shown

mafendi commented 2 months ago

You can add summary or subtitle to the frontmatter and add similar code to the single layout:

        <div class="content mt--12">
          <div class="text-xl mb-6 text-justify">{{ .Params.subtitle }}</div>
          <img src="{{ .Params.featuredImage | absURL }}" alt="{{ .Title }}" title="{{ .Title }}" width="100%" loading="lazy">

Here is what it looks like.

mafendi commented 2 months ago

For the last updated section, you just need move this

{{ partial "components/last-updated.html" . }}

to the top of your page + change CSS according to your design.