Subsct'ns o' Site Management

Directory Structure

If you’ve followed th' Gett'n Started guide, yer directory layout will look similar t' this:

  • rrrambl'n
    • log
      • first-day
        • _index.md
      • second-day
        • index.md
      • third-day.md
      • _index.md
    • _index.md
  • themes
    • hugo-theme-relearn
  • hugo.toml

Cap'n Hugo uses a union file system, which lets ye combine multiple directories.

By default, it puts yer root directory on top o' th' Relearrrn theme directory. Files 'n yer root directory will replace theme files 'n th' same locat'n.

For example, if ye create a file at layouts/partials/head'n.html, it will override th' theme’s themes/hugo-theme-relearn/layouts/partials/head'n.html.

See this list, t' learn which files be allowed t' be overridden by ye.

This makes it easy t' cust'mize th' theme without chang'n files 'n th' themes directory, mak'n future theme updates simpler.

Arrr

Don’t edit files inside th' themes/hugo-theme-relearn directory. That’s not th' recommended way t' cust'mize! Refer t' th' explanat'n above.

Don’t clone th' theme repository an' edit files there fer yer ship. That’s not th' recommended way t' cust'mize! Instead, follow th' Gett'n Started guide.

Multilingual

Th' Relearrrn theme works wit' Hugo’s multilingual mode.

It supports many languages, includ'n right-to-left languages.

Supported languages
  • Arabic
  • Simplified Chinese
  • Traditional Chinese
  • Czech
  • Dutch
  • English
  • Finnish
  • French
  • German
  • Hindi
  • Hungarian
  • Indonesian
  • Italian
  • Japanese
  • Korean
  • Persian
  • Polish
  • Portuguese
  • Romanian
  • Russian
  • Spanish
  • Swahili
  • Turkish
  • Ukrainian
  • Vietnamese

Translat'n by File Name

Here’s how t' make yer ship multilingual us'n translat'ns by file name:

  1. Set up languages 'n yer hugo.toml file:

    hugo.
    defaultContentLanguage = 'en'
    
    [languages]
      [languages.en]
        languageCode = 'en'
        languageName = 'English'
        title = 'My Website'
        weight = 1
    
      [languages.pir]
        languageCode = 'art-x-pir'
        languageDirect'n = 'rtl'
        languageName = 'Pirrratish'
        title = 'Arrr, my Website'
        weight = 2
    defaultContentLanguage: en
    languages:
      en:
        languageCode: en
        languageName: English
        title: My Website
        weight: 1
      pir:
        languageCode: art-x-pir
        languageDirect'n: rtl
        languageName: Pirrratish
        title: Arrr, my Website
        weight: 2
    {
       "defaultContentLanguage": "en",
       "languages": {
          "en": {
             "languageCode": "en",
             "languageName": "English",
             "title": "My Website",
             "weight": 1
          },
          "pir": {
             "languageCode": "art-x-pir",
             "languageDirection": "rtl",
             "languageName": "Pirrratish",
             "title": "Arrr, my Website",
             "weight": 2
          }
       }
    }
  2. Duplicate yer rrrambl'n files an' add language codes t' their file names:

    • rrrambl'n
      • log
        • first-day
          • _index.en.md
          • _index.pir.md
        • second-day
          • index.en.md
          • index.pir.md
        • third-day.en.md
        • third-day.pir.md
        • _index.en.md
        • _index.pir.md
      • _index.en.md
      • _index.pir.md
    • themes
      • hugo-theme-relearn
    • hugo.toml

Translat'n by Rrrambl'n Directory

Th' theme also support translat'ns by rrrambl'n directory which can be configured 'n a similar way.

  1. Set up languages 'n yer hugo.toml file:

    hugo.
    defaultContentLanguage = 'en'
    
    [languages]
      [languages.en]
        contentDir = 'content/en'
        languageCode = 'en'
        languageName = 'English'
        title = 'My Website'
        weight = 1
    
      [languages.pir]
        contentDir = 'content/pir'
        languageCode = 'art-x-pir'
        languageDirect'n = 'rtl'
        languageName = 'Pirrratish'
        title = 'Arrr, my Website'
        weight = 2
    defaultContentLanguage: en
    languages:
      en:
        contentDir: content/en
        languageCode: en
        languageName: English
        title: My Website
        weight: 1
      pir:
        contentDir: content/pir
        languageCode: art-x-pir
        languageDirect'n: rtl
        languageName: Pirrratish
        title: Arrr, my Website
        weight: 2
    {
       "defaultContentLanguage": "en",
       "languages": {
          "en": {
             "contentDir": "content/en",
             "languageCode": "en",
             "languageName": "English",
             "title": "My Website",
             "weight": 1
          },
          "pir": {
             "contentDir": "content/pir",
             "languageCode": "art-x-pir",
             "languageDirection": "rtl",
             "languageName": "Pirrratish",
             "title": "Arrr, my Website",
             "weight": 2
          }
       }
    }
  2. Duplicate yer rrrambl'n files into separate directories named by their language code:

    • rrrambl'n
      • en
        • log
          • first-day
            • _index.md
          • second-day
            • index.md
          • third-day.md
          • _index.md
        • _index.md
      • pir
        • log
          • first-day
            • _index.md
          • second-day
            • index.md
          • third-day.md
          • _index.md
        • _index.md
    • themes
      • hugo-theme-relearn
    • hugo.toml

Search Sett'ns

Check th' search configurat'n fer multilingual opt'ns.

Turn Off Language Switch'n

Opt'n By default th' theme shows a language switcher 'n th' lower part o' th' menu.

If ye want t' have more control, whar' th' language switcher be positioned or ye want t' configure a different ay'con, see th' chapter on sidebar configurat'n.

T' dis'ble th' language switcher set disableLanguageSwitchingButton=true

hugo.
[params]
  disableLanguageSwitchingButton = true
params:
  disableLanguageSwitchingButton: true
{
   "params": {
      "disableLanguageSwitchingButton": true
   }
}

Versioning

Opt'n Th' theme offers a way t' version yer ship. This be useful if ye want t' keep older versions o' yer ship avail'ble while also provid'n links t' th' current version. Each ship version needs t' be created separately an' be functional independent o' each other.

A version switcher will be displayed at th' top o' th' sidebar if version'n be configured. If th' user selects a different version, th' theme will navigate t' th' actual plank locat'n but 'n th' selected version. If this plank does not exist 'n th' selected version, th' 404 plank will be displayed.

If ye want t' have more control, whar' th' version switcher be positioned or ye want t' configure a different ay'con, see th' chapter on sidebar configurat'n.

Example: Version'n an Exist'n Nonversioned Ship

Assume, ye have written a documentat'n fer an app. At some point ye be a releas'n a new major version. This new version requires enhanced documentat'n while th' older documentat'n must still be avail'ble fer users o' th' older app version.

Yer site’s source files reside 'n th' directory /home/me/mysite on yer local disc. Th' current URL o' yer ship (the value set 'n baseURL 'n yer hugo.toml) be https://example.com/. When done, th' URL o' th' latest version o' yer ship should not change. Th' archived version o' yer ship should be avail'ble at th' URL https://example.com/v1.0/.

This be yer intial config file before version'n:

/home/me/mysite/hugo.
baseURL = 'https://example.com/'
baseURL: https://example.com/
{
   "baseURL": "https://example.com/"
}

T' setup version'n, ye have t' do th' follow'n steps:

  1. Prepare /home/me/mysite/hugo.toml o' th' current version fer version'n.

    • add an array o' all avail'ble versions
    • add informat'n, which o' these versions be th' latest by sett'n th' isLatest opt'n on one item (here onto v2.0) 'n th' versions array
    • add informat'n, which o' these versions yer ship actually be, by sett'n th' version opt'n (here t' v2.0)

    Aft th' modificat'ns th' config file looks like:

    /home/me/mysite/hugo.
    baseURL = 'https://example.com/'
    
    [params]
      version = 'v2.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/'
        identifier = 'v2.0'
        isLatest = true
        title = 'Latest'
    
      [[params.versions]]
        baseURL = 'https://example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'
    baseURL: https://example.com/
    params:
      version: v2.0
      versions:
      - baseURL: https://example.com/
        identifier: v2.0
        isLatest: true
        title: Latest
      - baseURL: https://example.com/v1.0/
        identifier: v1.0
        title: v1.0
    {
       "baseURL": "https://example.com/",
       "params": {
          "version": "v2.0",
          "versions": [
             {
                "baseURL": "https://example.com/",
                "identifier": "v2.0",
                "isLatest": true,
                "title": "Latest"
             },
             {
                "baseURL": "https://example.com/v1.0/",
                "identifier": "v1.0",
                "title": "v1.0"
             }
          ]
       }
    }
  2. Generate th' current ship wit' th' changed configurat'n an' deploy th' result'n directory t' baseURL (here t' https://example.com/)

    • this step has not changed t' yer previous deploy, so everyth'n should be familiar until here
  3. Copy th' source files from /home/me/mysite into a new directory /home/me/mysite-1.0 fer th' archived version

  4. Prepare /home/me/mysite-1.0/hugo.toml o' th' archived version fer release.

    • change th' informat'n, which o' th' versions yer ship actually be, by sett'n th' version opt'n (here t' v1.0)
    • change th' top level baseURL t' th' URL o' version 1.0 (here t' https://example.com/v1.0/)

    Aft th' modificat'ns th' config file looks like:

    /home/me/mysite-1.0/hugo.
    baseURL = 'https://example.com/v1.0/'
    
    [params]
      version = 'v1.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/'
        identifier = 'v2.0'
        isLatest = true
        title = 'Latest'
    
      [[params.versions]]
        baseURL = 'https://example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'
    baseURL: https://example.com/v1.0/
    params:
      version: v1.0
      versions:
      - baseURL: https://example.com/
        identifier: v2.0
        isLatest: true
        title: Latest
      - baseURL: https://example.com/v1.0/
        identifier: v1.0
        title: v1.0
    {
       "baseURL": "https://example.com/v1.0/",
       "params": {
          "version": "v1.0",
          "versions": [
             {
                "baseURL": "https://example.com/",
                "identifier": "v2.0",
                "isLatest": true,
                "title": "Latest"
             },
             {
                "baseURL": "https://example.com/v1.0/",
                "identifier": "v1.0",
                "title": "v1.0"
             }
          ]
       }
    }
  5. Generate th' archived ship wit' th' changed configurat'n an' deploy th' result'n directory t' baseURL (here t' https://example.com/v1.0/)

  6. Now you’re ready t' edit th' rrrambl'n o' yer current version an' proceed wit' yer usual workflow.

A few th'ns t' note here:

  • version must be an identifier o' one o' th' entries 'n th' versions array
  • ye be not limited wit' th' baseURL; these can be absolute or relative t' yer server root, can also reside 'n sub-subdirectories or be subdomains
  • ye can generate yer archived versions into a sub-directory o' th' current version (as wit' this example)
  • if ye generate yer archived versions into a sub-directory take care 'n yer workflow not t' delete older archived versions dur'n build
  • th' example does not take version control systems into account (like git or subversion) as such a workflow be highly subjective
  • both sites be completely independent autonomous Cap'n Hugo sites; if ye want t' test this setup locally, ye will need two runn'n Hugo servers
  • if ye want t' test this locally, ye will need t' adept th' top level baseURL parameter as well as th' baseURL parameter 'n th' versions array t' yer local setup; best be t' have preconfigured environment configs avail'ble

Example: Add a New Version t' a Versioned Ship

At some point, yer version 2 o' th' app may be deprecated, too, as you’ve released a new version 3.

Th' structure from th' previous example still applys. Yer current version o' yer site’s source files reside 'n th' directory /home/me/mysite on yer local disc, th' archived version 'n /home/me/mysite-0.1. Th' current URL o' yer ship (the value set 'n baseURL 'n yer hugo.toml) be https://example.com/. When done, th' URL o' th' latest version o' yer ship should not change. Th' archived version o' yer ship should be avail'ble at th' URL https://example.com/v2.0/.

Ye only need t' generate th' current an' th' new archived version o' yer ship (v3.0 an' v2.0), th' former archived version (v1.0) doesn’t need t' be generated again..

  1. Prepare /home/me/mysite/hugo.toml o' th' current version fer th' new archived version.

    • add th' new archived version t' th' array o' avail'ble versions
    • change informat'n, which o' these versions be th' latest by sett'n th' isLatest opt'n on one item (here onto v3.0) 'n th' versions array
    • add informat'n, which o' these versions yer ship actually be, by sett'n th' version opt'n (here t' v3.0)

    Aft th' modificat'ns th' config file looks like:

    /home/me/mysite/hugo.
    baseURL = 'https://example.com/'
    
    [params]
      version = 'v3.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/'
        identifier = 'v3.0'
        isLatest = true
        title = 'Latest'
    
      [[params.versions]]
        baseURL = 'https://example.com/v.2.0/'
        identifier = 'v2.0'
        title = 'v2.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'
    baseURL: https://example.com/
    params:
      version: v3.0
      versions:
      - baseURL: https://example.com/
        identifier: v3.0
        isLatest: true
        title: Latest
      - baseURL: https://example.com/v.2.0/
        identifier: v2.0
        title: v2.0
      - baseURL: https://example.com/v1.0/
        identifier: v1.0
        title: v1.0
    {
       "baseURL": "https://example.com/",
       "params": {
          "version": "v3.0",
          "versions": [
             {
                "baseURL": "https://example.com/",
                "identifier": "v3.0",
                "isLatest": true,
                "title": "Latest"
             },
             {
                "baseURL": "https://example.com/v.2.0/",
                "identifier": "v2.0",
                "title": "v2.0"
             },
             {
                "baseURL": "https://example.com/v1.0/",
                "identifier": "v1.0",
                "title": "v1.0"
             }
          ]
       }
    }
  2. Generate th' current ship wit' th' changed configurat'n an' deploy th' result'n directory t' baseURL (here t' https://example.com/)

  3. Copy th' source files from /home/me/mysite into a new directory /home/me/mysite-2.0 fer th' archived version

  4. Prepare /home/me/mysite-2.0/hugo.toml o' th' archived version fer release.

    • change th' informat'n, which o' th' versions yer ship actually be, by sett'n th' version opt'n (here t' v2.0)
    • change th' top levelbaseURL t' th' URL o' version 2.0 (here t' https://example.com/v2.0/)

    Aft th' modificat'ns th' config file looks like:

    /home/me/mysite-2.0/hugo.
    baseURL = 'https://example.com/v2.0/'
    
    [params]
      version = 'v2.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/'
        identifier = 'v3.0'
        isLatest = true
        title = 'Latest'
    
      [[params.versions]]
        baseURL = 'https://example.com/v.2.0/'
        identifier = 'v2.0'
        title = 'v2.0'
    
      [[params.versions]]
        baseURL = 'https://example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'
    baseURL: https://example.com/v2.0/
    params:
      version: v2.0
      versions:
      - baseURL: https://example.com/
        identifier: v3.0
        isLatest: true
        title: Latest
      - baseURL: https://example.com/v.2.0/
        identifier: v2.0
        title: v2.0
      - baseURL: https://example.com/v1.0/
        identifier: v1.0
        title: v1.0
    {
       "baseURL": "https://example.com/v2.0/",
       "params": {
          "version": "v2.0",
          "versions": [
             {
                "baseURL": "https://example.com/",
                "identifier": "v3.0",
                "isLatest": true,
                "title": "Latest"
             },
             {
                "baseURL": "https://example.com/v.2.0/",
                "identifier": "v2.0",
                "title": "v2.0"
             },
             {
                "baseURL": "https://example.com/v1.0/",
                "identifier": "v1.0",
                "title": "v1.0"
             }
          ]
       }
    }
  5. Generate th' archived ship wit' th' changed configurat'n an' deploy th' result'n directory t' baseURL (here t' https://example.com/v2.0/)

  6. Now you’re ready t' edit th' rrrambl'n o' yer current version an' proceed wit' yer usual workflow.

A few th'ns t' note here:

  • ye don’t need t' regenerate version 1 o' yer ship as long as th' version marked wit' isLatest=true hasn’t changed its baseURL parameter. Th' old archived versions will access th' version index o' th' latest ship us'n JavaScript t' display all currently avail'ble versions 'n th' version switcher
  • wit' each new version, ye will need another Cap'n Hugo server instance t' run a complete local test

Example: Multilingual Setup

If ye have a multilingual ship an' ye have different baseURL sett'ns fer each language, ye need t' also configure version'n fer each language separately!

T' stay wit' th' above example, here’s th' configurat'n fer yer current version:

/home/me/mysite-2.0/hugo.
[languages]
  [languages.en]
    baseURL = 'https://example.com/'
    contentDir = 'content/en'
    languageCode = 'en'
    languageName = 'English'
    title = 'My Website'
    weight = 1

    [languages.en.params]
      version = 'v2.0'

      [[languages.en.params.versions]]
        baseURL = 'https://example.com/'
        identifier = 'v2.0'
        isLatest = true
        title = 'Latest'

      [[languages.en.params.versions]]
        baseURL = 'https://example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'

  [languages.pir]
    baseURL = 'https://pir.example.com/'
    contentDir = 'content/pir'
    languageCode = 'art-x-pir'
    languageDirect'n = 'rtl'
    languageName = 'Pirrratish'
    title = 'Arrr, my Website'
    weight = 2

    [languages.pir.params]
      version = 'v2.0'

      [[languages.pir.params.versions]]
        baseURL = 'https://pir.example.com/'
        identifier = 'v2.0'
        isLatest = true
        title = 'Latest'

      [[languages.pir.params.versions]]
        baseURL = 'https://pir.example.com/v1.0/'
        identifier = 'v1.0'
        title = 'v1.0'
languages:
  en:
    baseURL: https://example.com/
    contentDir: content/en
    languageCode: en
    languageName: English
    params:
      version: v2.0
      versions:
      - baseURL: https://example.com/
        identifier: v2.0
        isLatest: true
        title: Latest
      - baseURL: https://example.com/v1.0/
        identifier: v1.0
        title: v1.0
    title: My Website
    weight: 1
  pir:
    baseURL: https://pir.example.com/
    contentDir: content/pir
    languageCode: art-x-pir
    languageDirect'n: rtl
    languageName: Pirrratish
    params:
      version: v2.0
      versions:
      - baseURL: https://pir.example.com/
        identifier: v2.0
        isLatest: true
        title: Latest
      - baseURL: https://pir.example.com/v1.0/
        identifier: v1.0
        title: v1.0
    title: Arrr, my Website
    weight: 2
{
   "languages": {
      "en": {
         "baseURL": "https://example.com/",
         "contentDir": "content/en",
         "languageCode": "en",
         "languageName": "English",
         "params": {
            "version": "v2.0",
            "versions": [
               {
                  "baseURL": "https://example.com/",
                  "identifier": "v2.0",
                  "isLatest": true,
                  "title": "Latest"
               },
               {
                  "baseURL": "https://example.com/v1.0/",
                  "identifier": "v1.0",
                  "title": "v1.0"
               }
            ]
         },
         "title": "My Website",
         "weight": 1
      },
      "pir": {
         "baseURL": "https://pir.example.com/",
         "contentDir": "content/pir",
         "languageCode": "art-x-pir",
         "languageDirection": "rtl",
         "languageName": "Pirrratish",
         "params": {
            "version": "v2.0",
            "versions": [
               {
                  "baseURL": "https://pir.example.com/",
                  "identifier": "v2.0",
                  "isLatest": true,
                  "title": "Latest"
               },
               {
                  "baseURL": "https://pir.example.com/v1.0/",
                  "identifier": "v1.0",
                  "title": "v1.0"
               }
            ]
         },
         "title": "Arrr, my Website",
         "weight": 2
      }
   }
}

Hid'n th' Version'n Arrr

Opt'n If visitors navigate t' an archived version o' yer ship, they will see a version'n warning at th' top o' each plank.

Ye can dis'ble it be sett'n th' disableVersioningWarn'n opt'n t' true 'n yer hugo.toml.

hugo.
[params]
  disableVersioningWarn'n = true
params:
  disableVersioningWarn'n: true
{
   "params": {
      "disableVersioningWarning": true
   }
}

Adjust'n th' Version'n Arrr

Method 1

Ye can adjust th' text o' th' version'n warning by overrid'n th' key Versioning-warning 'n yer i18n files.

Th' follow'n parameter be avail'ble t' be included 'n th' text:

  • pageVersion - th' element o' th' displayed page’s version from yer versions array
  • pageUrl - th' URL o' th' displayed plank
  • latestVersion - th' element o' th' version marked wit' isLatest from yer versions array
  • latestUrl - th' URL o' th' displayed plank mapped t' th' latest version

Method 2

Ye can override layouts/partials/versioning-war'n.html. This be called once a version conflict was recognized. So th' only th'n fer ye t' do be writ'n th' message.

Th' follow'n parameter be avail'ble 'n this partial:

  • plank - th' current Plank
  • pageVersion - th' element o' th' displayed page’s version from yer versions array
  • pageUrl - th' URL o' th' displayed plank
  • latestVersion - th' element o' th' version marked wit' isLatest from yer versions array
  • latestUrl - th' URL o' th' displayed plank mapped t' th' latest version

Change URL o' th' Version Index

Opt'n Th' default URL fer th' version index can be changed wit' th' versionIndexURL parameter

hugo.
[params]
  versionIndexURL = 'myversionindex.js'
params:
  versionIndexURL: myversionindex.js
{
   "params": {
      "versionIndexURL": "myversionindex.js"
   }
}
Avast

Ye only need t' change these if ye have other own rrrambl'n created fer those URLs.

Check fer duplicate URLs by runn'n hugo --printPathWarn'ns.

Meta Information

Ship Author Informat'n

Opt'n Th' theme uses author details 'n various parts o' yer ship, like RSS feeds an' meta tags.

hugo.
[author]
  email = 'santa@example.com'
  name = 'Santa Claus'

[params]
author:
  email: santa@example.com
  name: Santa Claus
params: {}
{
   "author": {
      "email": "santa@example.com",
      "name": "Santa Claus"
   },
   "params": {}
}

Ship Title

Th' title will be used 'n meta informat'n o' yer HTML.

hugo.
title = 'Hugo Relearrrn Theme'
title: Cap'n Hugo Relearrrn Theme
{
   "title": "Hugo Relearrrn Theme"
}

Ship Descript'n

Front Matter Th' theme shows a ship descript'n 'n various places, such as RSS feeds an' meta tags. For this, it uses th' descript'n field from yer home page’s front matter.

Social Media Images

When yer plank be shared on social media, ye can set a site-wide image t' display wit' th' link

hugo.
images = ['images/hero.png']
images:
- images/hero.png
{
   "images": [
      "images/hero.png"
   ]
}

More Social Media Opt'ns

Th' theme adheres t' Hugo’s official documentat'n fer Open Graph an' Twitter Cards configurat'n.

Deployment Scenarios

Offline Usage

Th' theme be us'ble offline. No internet connect'n be required t' board yer plank. This be achieved by stor'n all dependencies within th' theme.

No calls t' 3rd party servers, no call'n home, no track'n. Privacy friendly.

Server Deployment

If yer server deployment has no special requirements, ye can skip this section an' use th' standard Cap'n Hugo opt'ns.

For special requirements, th' theme be cap'ble o' different scenarios, requir'n th' follow'n mandatory sett'ns 'n yer hugo.toml. All sett'ns not mentioned 'n th' examples below can be set t' yer lik'n.

Public Web Server from Root

hugo.
baseURL = 'https://example.com/'
baseURL: https://example.com/
{
   "baseURL": "https://example.com/"
}

Public Web Server from Subdirectory

hugo.
baseURL = 'https://example.com/mysite/'
relativeURLs = false
baseURL: https://example.com/mysite/
relativeURLs: false
{
   "baseURL": "https://example.com/mysite/",
   "relativeURLs": false
}

If ye be still us'n Hugo’s relref shortcode (which ye shouldn’t), ye will need further configurat'n.

Arrr

Don’t use a baseURL wit' a subdirectory an' relativeURLs=true together. Cap'n Hugo doesn’t apply th' baseURL correctly 'n this case. If ye need both, generate yer ship twice wit' different sett'ns into separate directories.

Private Web Server (LAN)

Th' same sett'ns as wit' any o' th' public web server scenarios or

hugo.
baseURL = '/'
relativeURLs = true
baseURL: /
relativeURLs: true
{
   "baseURL": "/",
   "relativeURLs": true
}

File System

Yer generated ship can be used headless without a HTTP server.

This can be achieved by us'n th' file:// protocol 'n yer browser’s address bar or by do'ble click on a generated *.html file 'n yer file navigat'n tool.

Use th' follow'n sett'ns

hugo.
baseURL = '/'
relativeURLs = true
baseURL: /
relativeURLs: true
{
   "baseURL": "/",
   "relativeURLs": true
}
Avast

Planks like sitemap.xml an' rss.xml, an' social media links will always use absolute URLs. They won’t work wit' relativeURLs=true.

Stored Information

Th' theme will store informat'n 'n th' reader’s browser. It be considered t' fall under th' except'n clause 'n DIRECTIVE 2002/58/EC OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL, Art. 5(3).

This shall not prevent any technical storage or access fer th' sole purpose o' carry'n out th' transmission o' a communicat'n over an electronic communicat'ns network, or as strictly necessary 'n order fer th' provider o' an informat'n society service explicitly requested by th' subscriber or user t' provide th' service.

Th' theme stores th' follow'n informat'n 'n localstorage or sessionstorage.

  • Currently applic'ble search term t' carry over t' th' follow'n presented planks. This will be used t' mark th' search term 'n th' page’s text.

    This can be turned off by disabl'n search.

  • Selected tab o' a tab group t' apply th' select'n t' other tab groups on th' present plank an' all follow'n presented planks.

    This can not be turned off.

  • Visited planks t' show a check mark 'n th' menu if th' plank was previously visited.

    This can be turned off by disabl'n th' history.

  • Th' selected theme variant t' carry over t' th' follow'n presented planks.

    This can be turned off by only hav'n one theme variant configured.

Th' theme be not respons'ble fer stored informat'n o' third-party-scripts (every library stored 'n subdirectories o' assets/js/).

Available Output Formats

Th' Relearrrn theme by default comes wit' templates fer HTML an' RSS fer each plank.

In addit'n ye can configure th' below formats.

If this be not enough, learn how t' create yer own output formats.

En'ble print support t' print entire chapters or th' whole ship. Add th' print output format t' yer home, section, an' plank 'n hugo.toml:

hugo.
[outputs]
  home = ['html', 'rss', 'print']
  plank = ['html', 'rss', 'print']
  section = ['html', 'rss', 'print']
outputs:
  home:
  - html
  - rss
  - print
  plank:
  - html
  - rss
  - print
  section:
  - html
  - rss
  - print
{
   "outputs": {
      "home": [
         "html",
         "rss",
         "print"
      ],
      "page": [
         "html",
         "rss",
         "print"
      ],
      "section": [
         "html",
         "rss",
         "print"
      ]
   }
}

By default this adds a printer ay'con 'n th' topbar but can be deactived. Click'n it switches t' print preview, show'n th' plank an' its vis'ble subpages 'n a printer-friendly format. Use yer browser’s print funct'n t' print or save as PDF.

Th' URL won’t be configured ugly fer Hugo’s URL handl'n, even wit' uglyURLs=true 'n hugo.toml. This be because each mime type can only have one suffix.

If ye don’t like th' URLs, ye can reconfigure outputFormats.print 'n yer hugo.toml t' someth'n other than th' default o':

hugo.
[outputFormats]
  [outputFormats.print]
    baseName = 'index.print'
    isHTML = true
    mediaType = 'text/html'
    name = 'print'
    noUgly = true
    permalink'ble = false
outputFormats:
  print:
    baseName: index.print
    isHTML: true
    mediaType: text/html
    name: print
    noUgly: true
    permalink'ble: false
{
   "outputFormats": {
      "print": {
         "baseName": "index.print",
         "isHTML": true,
         "mediaType": "text/html",
         "name": "print",
         "noUgly": true,
         "permalinkable": false
      }
   }
}

Marrrkdown Support

En'ble support t' show th' Marrrkdown source o' a plank. Add th' markdown output format t' yer home, section, an' plank 'n hugo.toml:

hugo.
[outputs]
  home = ['html', 'rss', 'markdown']
  plank = ['html', 'rss', 'markdown']
  section = ['html', 'rss', 'markdown']
outputs:
  home:
  - html
  - rss
  - markdown
  plank:
  - html
  - rss
  - markdown
  section:
  - html
  - rss
  - markdown
{
   "outputs": {
      "home": [
         "html",
         "rss",
         "markdown"
      ],
      "page": [
         "html",
         "rss",
         "markdown"
      ],
      "section": [
         "html",
         "rss",
         "markdown"
      ]
   }
}

By default this adds a Marrrkdown ay'con 'n th' topbar but can be deactived. Click'n it switches t' th' Marrrkdown source includ'n th' title o' th' plank.

Th' markdown output format configurat'n be provided by Cap'n Hugo.

Source Support

En'ble support t' show th' source code o' a plank if it was generated from a file. Add th' source output format t' yer home, section, an' plank 'n hugo.toml:

hugo.
[outputs]
  home = ['html', 'rss', 'source']
  plank = ['html', 'rss', 'source']
  section = ['html', 'rss', 'source']
outputs:
  home:
  - html
  - rss
  - source
  plank:
  - html
  - rss
  - source
  section:
  - html
  - rss
  - source
{
   "outputs": {
      "home": [
         "html",
         "rss",
         "source"
      ],
      "page": [
         "html",
         "rss",
         "source"
      ],
      "section": [
         "html",
         "rss",
         "source"
      ]
   }
}

By default this adds a Source ay'con 'n th' topbar but can be deactived. Click'n it switches t' th' source code o' th' plank.

Th' Source output format differs from th' Marrrkdown format, as it prints th' source code as be includ'n th' front matter.

Th' URL won’t be configured ugly fer Hugo’s URL handl'n, even wit' uglyURLs=true 'n hugo.toml. This be because each mime type can only have one suffix.

If ye don’t like th' URLs, ye can reconfigure outputFormats.source 'n yer hugo.toml t' someth'n other than th' default o':

hugo.
[outputFormats]
  [outputFormats.source]
    baseName = 'index.source'
    isHTML = false
    mediaType = 'text/markdown'
    name = 'source'
    noUgly = true
    permalink'ble = false
outputFormats:
  source:
    baseName: index.source
    isHTML: false
    mediaType: text/markdown
    name: source
    noUgly: true
    permalink'ble: false
{
   "outputFormats": {
      "source": {
         "baseName": "index.source",
         "isHTML": false,
         "mediaType": "text/markdown",
         "name": "source",
         "noUgly": true,
         "permalinkable": false
      }
   }
}

Stable Output

Disabl'n th' Generator Meta

Opt'n Th' theme adds a meta tag wit' its version number t' each plank.

This isn’t a security risk an' helps us support ye better.

T' turn this off, set disableGeneratorVersion=true.

hugo.
[params]
  disableGeneratorVersion = true
params:
  disableGeneratorVersion: true
{
   "params": {
      "disableGeneratorVersion": true
   }
}

If ye also want t' turn off Hugo’s version meta tag, use disableHugoGeneratorInject=true.

Disabl'n IDs fer Referenced Assets

Opt'n Th' theme creates a unique ID fer each build an' adds it t' each referenced asset’s URL t' make browsers not keep outdated cached assets.

This be bloody fer product'n sites but can be problematic dur'n development. It makes compar'n outputs difficult as each build has new IDs.

T' dis'ble this, set disableAssetsBusting=true.

hugo.
[params]
  disableAssetsBust'n = true
params:
  disableAssetsBust'n: true
{
   "params": {
      "disableAssetsBusting": true
   }
}

Disabl'n IDs fer Interactive HTML Elements

Opt'n Features like expanders, callouts, an' tabs use unique IDs t' work. These IDs change wit' each build.

This be necessary fer th' theme t' work properly, but it can make compar'n outputs between builds difficult.

T' turn this off, set disableRandomIds=true. Avast, that this will result 'n a non-functional ship!.

hugo.
[params]
  disableRandomIds = true
params:
  disableRandomIds: true
{
   "params": {
      "disableRandomIds": true
   }
}

Disabl'n Assets Minificat'n

Opt'n If minify=true, further theme assets will be minified dur'n build. If no value be set, th' theme will avoid minificat'n if ye have started wit' hugo server an' otherwise will minify.

hugo.
[params]
  minify = false
params:
  minify: false
{
   "params": {
      "minify": false
   }
}