Skip to content

About

A libre hugo personal webpage theme without reliance on third parties and no tracking.

Resources

Stars

61 stars

Watchers

3 watching

Forks

Repository files navigation

Notrack

Notrack is an original, minimal theme with a focus on self-sufficiency and decentralization. By default, Notrack does not rely on any third parties to serve your website.

Notrack also tries to be accessible. Each part of a page is marked up with the HTML element that says what it is, so that screen readers can describe the page and everything can be used with the keyboard. If something doesn't work for you, please open an issue.

The README is long. You can use the automatic table of contents in GitHub to navigate (upper right corner of rendered README).

Dependencies

You need Hugo 0.158.0 or newer. Any edition works, so the standard one is enough. You can check which version you have with:

$ hugo version
hugo v0.169.0 linux/amd64 BuildDate=unknown

Demonstration web page

The theme has a demonstration web page that looks like this:

Screenshot of the theme

There is a working demonstration page here: https://gevhaz.github.io

You can also run the demonstration web page on a local server. This is how you do it:

$ git clone https://github.com/gevhaz/hugo-theme-notrack notrack
$ cd notrack/exampleSite/
$ hugo server -D --themesDir ../..

You can then see the example website in your browser and interact with it. Hugo will print instructions for what address to use. Usually it is http://localhost:1313/.

How to write a website from scratch with Notrack

There are two ways to get started with this theme – the bottom-up approach and the top-down approach. The top-down approach is to just clone the example site and modify it until it looks how you want. The bottom-up approach is to start from scratch with hugo new site and gradually add the components you need. This section explains how to do that.

The basic structure

Notrack is built with a few types of pages in mind. The home page is mandatory, but the blog, "About me"-page, gallery and resume are all optional.

This section deals with creating a minimal version of each type of page the theme supports. In the next section we will deal with adding custom content to the pages using shortcodes (but you can of course use the default Hugo shortcodes in any page as well).

How to create a home page

First, create a new Hugo project in a directory of your choice:

$ hugo new site <my-webpage>
$ cd <my-webpage>
$ git init
$ git submodule add https://github.com/gevhaz/hugo-theme-notrack.git themes/notrack

Note

I use angle brackets ('<' and '>') to indicate a placeholder. You should replace it with your own value.

Your project should already have a file called hugo.toml. Open it and make sure it looks something like this:

baseURL = '<URL where you plan to publicize your web page>'
defaultContentLanguage = '<language the website uses, e.g. en>'
locale = '<locale of the language the website uses, e.g. en-US>'
title = '<My New Hugo Site>'
theme = 'notrack'

[params]
# optional, defaults to the author's name:
siteHeading = '<the text that goes at the top of your webpage>'
# optional, an image in your static/ folder, shown before the heading:
logo = '<path to an image, e.g. img/logo.png>'
# optional, set to true to show the logo without the heading:
logoOnly = false

# keep this after the other keys under [params]:
[params.author]
name = '<Your name>'
# optional, shown in RSS feeds:
email = '<Your email address>'

Now you are ready to add the first content to the web page. Create the home page, which is the first page users see:

$ hugo new _index.md

This could contain a short introduction of what is on the website or of yourself. Here is an example:

+++
date = '2024-11-10T16:46:03+02:00'
title = ''
+++

Welcome to my web page!

Now you have a working website. You can run it locally with:

$ hugo server

or deploy it somewhere according to the instructions from Hugo: https://gohugo.io/hosting-and-deployment/

You can further extend the home page:

  • Add an image (for example like in the demonstration web page)
  • Add a footer (that will be shown on all pages)
  • Split it into parts, each written in a file of its own

How to split the home page into parts

If your home page has several parts with their own headings, for example "About me" and "What I work on", you can write each part in a file of its own instead of putting everything in content/_index.md. Each file is then shorter to edit, and you can change the order of the parts without moving text around.

Create a folder called homepage in your content folder, with a file called index.md and one file for each part:

content/
├── _index.md
└── homepage/
    ├── index.md
    ├── about.md
    └── work.md

index.md tells Hugo that the folder isn't a page of its own, only content for other pages to use (Hugo calls this a headless bundle). It needs nothing but this:

+++
headless = true
+++

Each of the other files is one part. Its title becomes the heading of the part, and its weight decides the order of the parts, lowest first:

+++
title = 'About me'
weight = 1
+++

A few words about me.

The parts are only used if content/_index.md has no text below its front matter. If you write text there, the home page shows that text instead. The latest blog posts are shown below the parts as usual.

To show an image in a part, put the image in the static folder and add it with the image shortcode, as on any other page.

How to create a blog

TL;DR: You add blog posts the default way, but don't forget to add the blog section to the navigation bar so that people can find it.

First, create the mandatory _index.md page for the blog:

$ hugo new blog/_index.md

And give it the following content:

+++
title = '<no need to change>'
date = '<no need to change>'

[menu.main]
identifier = 'blog'
name = 'Blog'
weight = 5
+++

Any text you write below the front matter, e.g. a few words on what you write about, is shown above the list of posts. The same goes for the _index.md of the archive and of the tags and categories pages.

Under [params] in your hugo.toml, add:

mainSections = ['blog']

Note

The section names are based on folder names, so if you call the folder something other than 'blog', make sure that that is reflected.

Add a blog post:

$ hugo new blog/post-1.md

And put any content you want in it. Don't forget to set draft to false.

After adding or changing these three files, you will see a summary of the blog post on the home page, and a link to the blog in the menu.

You can now continue blogging by just adding new posts with hugo new blog/<post name>.md

For the blog, you may also be interested in:

How to add an About Me page

There is nothing special about the About Me page, but the theme supplies a couple of shortcodes that can be useful if you want to display social links like in the demonstration site:

Example of social link shortcodes

To prepare for using one of the shortcodes, configure your social media user names like this in the site configuration:

[params.social]
github = '<your github username>'
email = '<email address>'

For all available social icons, see the data/notrack/social.yaml file. Only add rss to [params.social] if your site generates feeds, which Hugo does unless you set disableKinds = ['RSS']. To change the icon of a site or add a site that's missing, see How to change or add social sites.

For sites where you choose the server, i.e. Mastodon, Pixelfed, PeerTube, Lemmy, Gitea and Forgejo, give your full handle, including the server:

[params.social]
mastodon = '@<user name>@mastodon.social'

For other software in the fediverse that has profiles at /@<user name>, such as Misskey or GoToSocial, use fediverse.

Then, create a new page, for example like this:

$ hugo new contact.md

Make sure you add it to the navigation bar, for example like this:

[menu.main]
name = 'About me'
weight = 90

Finally, use either the social or contact-box shortcodes in that page. The former produces the element at the bottom of the above image, and the latter produces the element on the right.

How to create a Gallery Page

A gallery page is just a normal page. Create a page:

$ hugo new gallery.md

Then use the gallery shortcodes on it.

How to create a resume

A resume page is just a normal page. Create a page:

$ hugo new resume.md

Then use the resume shortcodes on it.

How to create tags and categories pages

If you have a blog, Hugo generates tags and categories pages for you automatically. They are available at <your-website.com>/tags and <your-website.com>/categories respectively. Don't forget to actually tag and categorize your posts for them to show up there.

Notrack puts buttons at the top of your blog with links to the tags and categories (and an archive page if you have one). If you don't want these, disable it in your site configuration:

[params]
showTaxonomyLinks = false

The buttons show the titles of the tags and categories pages. To change them, e.g. to translate them, set title in the front matter of tags/_index.md and categories/_index.md.

You might instead want to have a drop-down menu that links to tags and categories, like this:

screenshot of drop-down menu

To add a tags page and a menu entry for it simply create a new tags section and add its index page as a sub-menu to the blog. You create the section like this:

$ hugo new tags/_index.md

The only needed content is a menu definition in the front matter, like this:

[menu.main]
parent = 'blog'
name = 'Tags'

Important

Take care that the parent value is the identifier of the blog menu that you have set in the blogs index page.

The procedure is exactly the same for categories.

How to create an archive page

You can add an Archive page that lists all blog posts by year:

$ hugo new archive/_index.md

It just needs to have a front matter specifying that it should have the archives layout:

title = 'Archive'
layout = 'archives'

You will automatically get a button at the top of the blog page linking to the archive unless you disable it. You might otherwise want to add the page to the Blog drop-down menu:

layout = 'archives'
[menu.main]
parent = 'blog'
name = 'Archive'

Important

Make sure the value of parent is the identifier you used for your blog menu entry or it won't show up in the drop-down.

Shortcodes from Notrack

Notrack supplies a few custom shortcodes. In this section I present the list of all the shortcodes in a table, and show how to use the non-trivial ones.

Shortcodes provided by Notrack

Category Shortcode Description
Contact info contact-box Displays contact info set in params.social
social Displays contact info set in params.social
Photo Gallery gallery-category Container for gallery-photo shortcodes
gallery-modal HTML to allow for full page view of gallery photos
gallery-photo Include a photo in a gallery
gallery-script Script to allow for full page view of gallery photos
General image More advanced version of figure
video Similar to an ordinary <video> HTML tag but with a CSS class to make it look good in posts
rawhtml For including raw HTML without the global unsafe option for Goldmark
Resume container Container for resume shortcodes
resume-entry One entry in a resume (e.g. a university degree)
resume-section One section in resume (e.g. "Education")
resume-category Creates a heading within a section of the resume

The raw HTML shortcode

rawhtml can be used like this:

{{< rawhtml >}}<p>A paragraph</p>{{< /rawhtml >}}

This allows you to use HTML to create elements that you can't create with just markdown without allowing unsafe HTML in the site configuration file. I'm not a security expert, and there might be a good reason why unsafe HTML is disabled by default. If you think this shortcode shouldn't be part of the theme, feel free to open an issue and say why.

The video shortcode

The video shortcode basically just creates a HTML <video> tag with a class that I've added some styling for. Use it like this:

{{< video src="your_video.mp4" type="video/mp4" preload="auto" >}}

Put your video next to the page, in a page bundle, or in the static folder. For a video in a subdirectory of static, such as video, add the subdirectory to src, e.g. src="video/your_video.mp4".

The image shortcode

The image shortcode is for adding images, but provides a few more options than Hugo's default figure shortcode. The following extra options are provided:

Parameter name Allowed Values
float right/left
frame true/false/leave out
wide true/false
width e.g. 10em, 50%, 70px
height e.g. 10em, 50%, 70px

You can also use these options of the figure shortcode: src, alt, caption, title, link, target, rel, attr, attrlink and class.

Setting the float makes text wrap around the image, instead of it taking up the full width of the page.

Here is an example of how to use it to add a picture to the home page:

{{<image
    float="right"
    width="11em"
    frame="true"
    caption="Picture of me"
    src="img/portrait.jpg"
>}}

Make sure the src value points to an existing picture. In this case it should be in static/img/portrait.jpg.

The contact-box shortcode

The contact-box shortcode creates a frame with links to your social media or other contact info. The frame floats to the right side of the page, so the text that follows it in the page wraps around it.

What social media links are present in the frame is decided by the social key of your site configuration. See here.

For contact-box, there are three optional parameters, float, width and height. This is similar to the image shortcode. Float makes text wrap around the box (can be right or left), and the other two naturally set the dimensions of the <div>, using inline CSS. The parameters defaults to floating to the right, the width defaults to 12em, and the height defaults to auto. If the width is too small to fit the links, the box grows to fit them.

The social shortcode

This is similar to the contact-box shortcode. It just shows clickable icons for your configured social media accounts. Like contact-box, the social key of the site configuration is the source of what social media to include and what your handles are.

The gallery shortcodes

There are four shortcodes for creating a gallery:

  • gallery-category
  • gallery-photo
  • gallery-modal
  • gallery-script

The first two are used in combination to create the actual gallery. Do something like the following in one of your pages:

{{< gallery-category >}}
    {{< gallery-photo fn="<filename of first picture>" caption="<your caption>">}}
    {{< gallery-photo fn="<filename of second picture>" caption="<your caption>">}}
    {{< gallery-photo fn="<filename of third picture>" caption="<your caption>">}}
    {{< gallery-photo fn="<filename of fourth picture>" caption="<your caption>">}}
{{< /gallery-category >}}

The pictures should be under static/img/thumbnails in your project.

If you want a modal to pop up with a zoomed in version, add the other two shortcodes at the bottom of your page:

{{< gallery-modal >}}
{{< gallery-script >}}

And place corresponding full-size images under static/img/fullsize. The file names need to be the same as for the thumbnails.

Thumbnails should of course be small so that your page loads fast and full-size should be large enough that they don't look pixelated when covering the full space of a web browser. One way to resize images is with GraphicsMagick: gm mogrify -resize 1920x1920 *.jpg, which will resize all images in the current folder to a maximum width/height of 1920 pixels (while maintaining the aspect ratio).

The resume shortcodes

There are some shortcodes that can help you create a resume. These are:

  • container
  • resume-section
  • resume-category
  • resume-entry

Container just creates a <div> element with a specific class. resume-section needs a title which will be shown to the left of its content (if it can fit on the screen, otherwise it's on top). Within this, you put one or more resume-entry shortcodes. This shortcode takes the three parameters what, where and when (see example usage below). It also takes raw HTML within the shortcode tags. There is styling for <p>s, links, and unordered and ordered lists. Apart from that, site-wide CSS is used. Example usage:

{{< container >}}
    {{< resume-section title="About Me" >}}
        {{< resume-entry >}}
            <p>
            Some info about you.
            </p>
        {{< /resume-entry >}}
    {{< /resume-section >}}

    {{< resume-section title="Education" >}}
        {{< resume-entry what="Bachelor's program of Computer Science"
                         where="Sidney University"
                         when="2010–2013">}}
            <ol>
                <li> Some comment on what skills you learned</li>
                <li> Some other comment </li>
            </ol>
        {{< /resume-entry >}}
    {{< /resume-section >}}
{{< /container >}}

A tip is that you can also use the resume-entry shortcode with markdown. Just switch use % instead of < and make sure that your markdown doesn't have any white space in front of it (or all of it will be interpreted as code):

        {{% resume-entry what="Bachelor's program of Computer Science"
                         where="Sidney University"
                         when="2010–2013" %}}
* Some comment on what skills you learned
* Some other comment
        {{% /resume-entry %}}

Navigation bar

How to add a page to the navigation bar

Add it to main menu in the front matter of the page:

[menu.main]
identifier = 'contact'
name = 'About me'
weight = 90

Add pages to the navigation bar in their own front matter like this. You only need the site configuration for an entry that has no page, like the button for a drop-down menu of its own.

How to add a page to drop-down menu

This theme has a navigation bar at the top of all pages, with buttons like "Home", "Blog", "About me", etc. depending on how you configure it. You can make it so you get a drop-down menu when hovering over a button. An example is the "Blog" button in the demonstration website.

If the button you want to use as the root of the drop down menu already exists, you just need to set it as the parent of your page's menu entry. Your page's front matter might look like this:

If your page is "About blog" and you want to add it to blog drop-down.

[menu.main]
parent = 'blog'
name = 'About blog'

You might want to have a button just for holding the drop-down menu. If so, create a menu entry for a non-existent page in your site configuration:

[menu]
  [[menu.main]]
    identifier = "other"
    name = "Other"
    pageRef = '#'
    weight = 30

The lower the weight, the further to the left in the navigation bar the entry goes. A pageRef of '#' makes it so that pressing the button doesn't change the page.

Now that you have created a dummy menu entry, you can add your real page to it just like before by referencing it as a parent:

[menu.main]
parent = 'other'
name = 'My links'

Fonts

Notrack sets text in FreeSerif, and headings, the navigation bar and a few labels in FreeSans. Both are from GNU FreeFont, a project to give free software free fonts for as many of the world's writing systems as possible. Notrack uses them because they are free software, like the theme itself. They grew out of versions of the classic PostScript fonts that URW++ released under the GPL, which is why FreeSerif looks much like Times and FreeSans like Helvetica. Code is set in Mononoki.

The theme's fonts cover these writing systems, in regular, bold and italic:

  • Latin, for every European language that uses it, and Vietnamese
  • Greek
  • Cyrillic, e.g. Russian, Ukrainian, Bulgarian and Serbian
  • Armenian, Georgian and Hebrew
  • Thai, except in headings and other text in FreeSans

Characters in other writing systems, e.g. Arabic, Devanagari, Tamil, Chinese or Japanese, are drawn with the fonts on the visitor's device. A browser downloads only the parts of the fonts that a page uses, so a page in English downloads nothing for Greek.

To use the fonts in your own CSS, e.g. in assets/css/userstyles.css, refer to them by name. Bold and italic text in them is drawn with their real bold and italic faces.

.note {
    font-family: FreeSans, sans-serif;
}

Other site configuration

How to set a footer

If you want to add a footer to your web page, you can use the footer key in your configuration, e.g:

[params]
footer = """\
  This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 \
  International License.\
  """

This will add a HTML

element with a element with your text in it.

How to disable or customize home page blog summary

By default, the theme provides summaries of the three latest blog posts on the home page if you have a blog. If you don't want that, set showBlogLatest to false in your site configuration file. You may also want to change the number of posts shown and the heading above it (default "Latest Blog Posts"). In hugo.toml, it would look like this:

[params]
showBlogLatest = true
blogLatestHeading = 'Latest posts'
nBlogLatest = 6

How to change the date format

Blog posts show the date they were posted, e.g. "2026-03-05". To show it in another format, set dateFormat in your site configuration:

[params]
dateFormat = ':date_long'

The value can be a predefined format, such as :date_long ("March 5, 2026") or :date_medium ("Mar 5, 2026"), or a layout like 2 January 2006. See Hugo's documentation of time.Format for all options. Predefined formats and the names of months and weekdays follow the locale of your site, so with locale = 'de-DE', :date_long gives 5. März 2026.

The archive page uses dateFormat too. Without it, the archive shows only the day and month, e.g. "5/3", since the posts are grouped by year.

How to translate the theme's text

The theme supports English and the languages you find listed in i18n/. To set a language other than English, set e.g. defaultContentLanguage = 'de'. If your language is not supported, you can write your own translation by copying i18n/en.yaml from the theme to the i18n/ folder on your site and name it after the defaultContentLanguage you wish to use.

Any text you leave out will stay in English. You can see which texts on your pages are still missing a translation by building your site with hugo --printI18nWarnings.

If you only want to change some of the English texts, create i18n/en.yaml in your site with just those keys.

If you have set a heading with blogLatestHeading, that will be shown instead of the translation. The same goes for the link to the archive page, which always shows the title of the archive page if it has one.

How to change or add social sites

The sites that the social and contact-box shortcodes can link to are defined in data/notrack/social.yaml. To change one of them or add one, create data/notrack/social.yaml in your site with just the sites you want to change or add. Hugo merges it with the theme's file. For example, this shows GitHub with a different icon and adds Chess.com:

github:
  weight: 1
  prefix: https://github.com/
  title: GitHub
  icon:
    class: fa-brands fa-github

chess:
  weight: 100
  prefix: https://www.chess.com/member/
  title: Chess.com
  icon:
    class: fa-solid fa-chess-knight

Then use the new key in your configuration as usual:

[params.social]
chess = '<your user name>'

A site in your file replaces the theme's site with the same key as a whole, so copy all of its fields, not only the one you change.

Every site has a weight, a title and an icon, and one of prefix, template and instance, which build the link:

  • weight: The position among the links, where lower comes first.
  • title: The text of the link.
  • icon.class: The classes of an icon from Font Awesome Free 7, which comes with the theme. Search for an icon on the Font Awesome website, limited to free icons, and copy the classes from the code it shows, e.g. fa-solid fa-chess-knight. fas and fab, as in the theme's file, are short for fa-solid and fa-brands.
  • prefix: The start of the link, which your value from [params.social] is added to.
  • template: The link with %v where your value goes, for when it goes in the middle, e.g. https://%v.example.org/.
  • instance: For a site where users choose the server, like Mastodon, the path of a profile on the server, e.g. /@%v. The value in [params.social] is then a full handle like @user@example.org.

How to change the text size

The default text size is quite large, and will stay that way so that existing sites don't change. You can make it smaller by creating assets/css/userstyles.css in your site and adding:

:root {
    --base-font-size: 1em;
}

The default is 1.1em. The size you set is roughly the size on phones, where body text is 1.1 times it. On wider screens it's larger: 1.2 to 1.3 times on laptops and up to 1.6 times on the widest screens. Headings and all other text scale with it.

Acknowledgements and attributions

The theme does not secretly download any resources from other websites or CDNs. It does, however, make use of a few other projects. These are included in the theme files, so your homepage will serve the resources.

FreeSerif and FreeSans are from GNU FreeFont. They are licensed under "GPLv3 or later", with an exception for documents that embed them. The full fonts are in font-sources, and the files under static/fonts that your site serves are subsets of them, made by .github/scripts/subset-fonts.py. Each file keeps the copyright and license notice of the font.

The monospace font under static/fonts, used for code in the theme, is Mononoki. It is licensed under SIL OFL 1.1 (https://scripts.sil.org/OFL).

The icons used for the contact-box and social shortcodes are from Font Awesome project. The icons are licensed under CC BY 4.0, the fonts under SIL OFL 1.1 and the code under the MIT license, as described in static/fontawesome/LICENSE.txt. A HTML comment is included in the contact-box shortcode to show the license and source.

For matching the icons from Font Awesome with names for various social networking services, I use the social.yml file from the LoveIt theme, which uses the MIT license. I modified it to use the Font Awesome Solid font for the email icon, because the one in the original file was using the Font Awesome Regular font, which it seems only Pro users of Font Awesome can use. The solid one also looks better.

All of the images in the example site are in the public domain.

Contributing

If you find a bug, please open an issue.

If some change could be made or something could be added that is in line with the style and philosophy of the theme, and it doesn't break anything, feel free to make a pull request.

FAQ

Q: How do I update the theme?

cd to it and do a git pull.

Q: I would like to change the CSS styling of the site looks

You can add your own CSS by creating a file assets/css/userstyles.css. The theme will automatically pick it up.

Q: My pages don't show up on the site

Have you removed draft = true? Have you added the page to a menu? Also try restarting hugo server.

About

A libre hugo personal webpage theme without reliance on third parties and no tracking.

Resources

Stars

61 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages