My Theme Tweaks

My journey with the Academic Theme included a few tweaks.

  • adding a subtitle to the home page

Subtitle on Home Page

Possibly, because I could not think of a better page title than “my home on the web!”, I had the urge to add a subtitle. Amazingly, the Academic theme does not support this per se.

I failed to find something useful on google and in particular for the Academic theme, but I had fading memories about reading about self-defined parameters elsewhere. In the end, I started scanning over some of the hugo documentation, i.e. Site Variables and Params. The section .Site.Params elaborates on how to define and insert a description parameter. The example shows also how to include this in the meta data tag using a {{if .IsHome}} call.

Accordingly, I did the following

  1. hugo and the Academic theme works with certain lookup concept. I therefore created a layout/partials subfolder in my site root.
  2. to tweak the navbar, I copied the navbar.html from theme/hugo-academics/layouts/partials to the aforementioned layouts/partials folder
  3. defined a parameter in config.toml by adding the following code to the end of the config.toml:

    # sefl-defined parameters
    [params]
      subtitle = "I do not know where the journey will end, but I know where to start ..."
  4. in the copied navbar.html, I inserted the following line of code:

    <br> {{if .IsHome}}{{ $.Site.Params.subtitle }}{{end}} 

Conclusions

When starting this post, I did one tweak by inserting a subtitle in the navbar.html moved to the specific lookup folder. I scanned over a serious of webpages and blogposts or stackoverflow questions without claiming that I understand fully what I have done. A key point I need to tackle - if I really want to understand this - is to read up more on hugo.

Avatar
Rainer Koelle
Head Operational ANS Performance

I am a pilot, air traffic controller, and engineer, and work for EUROCONTROL, Performance Review Unit. My research interests revolve around operational air navigation and/or air transportation system performance applying a mix of data science and system analytics. In a side role I am also interested in time-critical decision making applied in aviation security and critical infrastructure protection.

Related

Next
Previous