Minor Theme Tweaks

hugo

Customising the theme

I'm using the Jeffprod theme which meets my needs almost out of the box with a tag cloud, recent posts and an archive widget. This last one was not obvious to get working but I worked out eventually that I needed to add archives: 2021 to the frontmatter. I adapted the previous script used to add the date to the frontmatter to only add the year.

 sed -i ':a;N;$!ba;s/---/archive: '$year'\n---/2' $filename

The easiest change was to locate the default header image in static/img/bg-blog.jpg and replace the file with one of my own. Another option would have been to change the link in layouts/partials/header.html.

Then I added a link to the menu bar also in layouts/partials/header.html which creates a direct link to a gallery of my favourite photos.

 <a class="navbar-item" href="{{ .Site.baseURL }}/page/gallery/">Gallery</a>

I also wanted this page to be full width which required me to add some more frontmatter

 type: wide
 layout: wide

and then to add a wide layout template which is a copy of the single page template with the widgets removed.

└── wide
    └── wide.html

Open item is to be able to use tags with a space in them, they appear in the tag cloud with a hyphen but the linked page is empty, somehow the conversion of the space to a hyphen happens before the linked page is created and then it finds no pages with the hyphenated tag.

Previous Post Next Post