Global site parameters
On top of Hugo global configuration, the Relearn theme lets you define the following parameters in your
config.toml (here, values are default).
Note that some of these parameters are explained in details in other sections of this documentation.
Serving your page from a subfolder
If your site is served from a subfolder, eg.
https://example.com/mysite/, you have to set the following lines to your
baseURL = "https://example.com/mysite/" canonifyURLs = true relativeURLs = true
canonifyURLs=true URLs in sublemental pages (like
rss.xml) will be generated falsly while your HTML files will still work. See https://github.com/gohugoio/hugo/issues/5226.
Serving your page from the filesystem
If you want your page served from the filesystem by using URLs starting with
file:// you’ll need the following configuration in your
relativeURLs = true
The theme will append an additional
index.html to all branch bundle links by default to make the page be servable from the file system. If you don’t care about the file system and only serve your page via a webserver you can also generate the links without this change by adding this to your
[params] disableExplicitIndexURLs = true
If you want to use the search feature from the file system using an older installation of the theme make sure to change your outputformat for the homepage from the now deprecated
SEARCH as seen below.
If not already present, add the following lines in the same
[outputs] home = ["HTML", "RSS", "SEARCH"]
SEARCH outputformat was named
JSON in previous releases but was implemented differently. Although
JSON still works, it is now deprecated.
Activate dedicated search page
You can add a dedicated search page for your page by adding the
SEARCHPAGE outputformat to your home page by adding the following lines in your
[outputs] home = ["HTML", "RSS", "SEARCH", "SEARCHPAGE"]
You can access this page by either clicking on the magnifier glass or by typing some search term and pressing
ENTER inside of the menu’s search box .
Activate print support
You can activate print support to add the capability to print whole chapters or even the complete site. Just add the
config.toml as seen below:
[outputs] home = ["HTML", "RSS", "PRINT", "SEARCH"] section = ["HTML", "RSS", "PRINT"] page = ["HTML", "RSS", "PRINT"]
This will add a little printer icon in the top bar. It will switch the page to print preview when clicked. You can then send this page to the printer by using your browser’s usual print functionality.
The resulting URL will not be configured ugly in terms of Hugo’s URL handling even if you’ve set
uglyURLs=true in your
config.toml. This is due to the fact that for one mime type only one suffix can be configured.
Nevertheless, if you’re unhappy with the resulting URLs you can manually redefine
outputFormats.PRINT in your own
config.toml to your liking.
The MathJax configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one. See Math for additional documentation.
MathJax is globally disabled. By default it won’t be loaded by any page.
You also can disable MathJax for specific pages while globally enabled.
The Mermaid configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one. See Mermaid for additional documentation.
Mermaid is globally disabled. By default it won’t be loaded by any page.
You also can disable Mermaid for specific pages while globally enabled.
Home Button Configuration
disableLandingPageButton option is set to
false, a Home button will appear
on the left menu. It is an alternative for clicking on the logo. To edit the
appearance, you will have to configure two parameters for the defined languages:
[Languages] [Languages.en] ... landingPageName = "<i class='fas fa-home'></i> Home" ... [Languages.pir] ... landingPageName = "<i class='fas fa-home'></i> Arrr! Homme" ...
If those params are not configured for a specific language, they will get their default values:
landingPageName = "<i class='fas fa-home'></i> Home"
The home button is going to look like this: