2021-08-25 11:33:29 +00:00
+++
title = "Configuration"
weight = 20
+++
2017-08-16 22:57:44 +00:00
## Global site parameters
2021-09-11 13:46:14 +00:00
On top of [Hugo global configuration ](https://gohugo.io/overview/configuration/ ), the Relearn theme lets you define the following parameters in your `config.toml` (here, values are default).
2017-08-16 22:57:44 +00:00
Note that some of these parameters are explained in details in other sections of this documentation.
```toml
[params]
2021-09-23 20:27:58 +00:00
# This controls whether submenus will be expanded (true), or collapsed (false) in the
# menu; if no setting is given, the first menu level is set to false, all others to true;
# this can be overridden in the pages frontmatter
alwaysopen = true
2022-02-14 23:22:34 +00:00
# Prefix URL to edit current page. Will display an "Edit" button on top right hand corner of every page.
2017-08-16 22:57:44 +00:00
# Useful to give opportunity to people to create merge request for your doc.
# See the config.toml file from this documentation site to have an example.
editURL = ""
# Author of the site, will be used in meta information
author = ""
# Description of the site, will be used in meta information
description = ""
# Shows a checkmark for visited pages on the menu
showVisitedLinks = false
# Disable search function. It will hide search bar
disableSearch = false
2021-09-03 18:01:46 +00:00
# Disable search in hidden pages, otherwise they will be shown in search box
disableSearchHiddenPages = false
2021-09-09 20:26:24 +00:00
# Disables hidden pages from showing up in the sitemap and on Google (et all), otherwise they may be indexed by search engines
disableSeoHiddenPages = false
2021-09-24 04:59:28 +00:00
# Disables hidden pages from showing up on the tags page although the tag term will be displayed even if all pages are hidden
disableTagHiddenPages = false
2020-03-09 15:50:24 +00:00
# Javascript and CSS cache are automatically busted when new version of site is generated.
2017-08-16 22:57:44 +00:00
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
disableAssetsBusting = false
# Set this to true to disable copy-to-clipboard button for inline code.
disableInlineCopyToClipBoard = false
2020-03-09 15:50:24 +00:00
# A title for shortcuts in menu is set by default. Set this to true to disable it.
2017-08-16 22:57:44 +00:00
disableShortcutsTitle = false
2020-10-21 16:53:27 +00:00
# If set to false, a Home button will appear below the search bar on the menu.
# It is redirecting to the landing page of the current language if specified. (Default is "/")
disableLandingPageButton = true
2017-08-20 15:10:29 +00:00
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = false
2018-10-23 02:57:19 +00:00
# Hide breadcrumbs in the header and only show the current page title
disableBreadcrumb = true
2021-11-03 19:44:23 +00:00
# If set to true, hide table of contents menu in the header of all pages
disableToc = false
2022-03-16 21:40:38 +00:00
# If set to false, load the Mermaid module on every page regardless if a Mermaid shortcode or Mermaid codefence is present
2020-09-11 13:57:25 +00:00
disableMermaid = false
2021-09-11 13:46:14 +00:00
# Specifies the remote location of the Mermaid js
2020-09-11 13:57:25 +00:00
customMermaidURL = "https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js"
2021-09-11 13:46:14 +00:00
# Initialization parameter for Mermaid, see Mermaid documentation
2021-07-02 21:18:54 +00:00
mermaidInitialize = "{ \"theme\": \"default\" }"
2018-10-23 02:57:19 +00:00
# Hide Next and Previous page buttons normally displayed full height beside content
disableNextPrev = true
2021-09-27 20:03:10 +00:00
# Order sections in menu by "weight" or "title". Default to "weight";
# this can be overridden in the pages frontmatter
2017-08-16 22:57:44 +00:00
ordersectionsby = "weight"
2022-02-14 20:44:01 +00:00
# Change default color scheme with a variant one. Eg. can be "red", "blue", "green" or an array like [ "blue", "green" ].
themeVariant = "relearn-light"
2020-03-09 15:50:24 +00:00
# Provide a list of custom css files to load relative from the `static/` folder in the site root.
custom_css = ["css/foo.css", "css/bar.css"]
2020-09-11 08:31:22 +00:00
# Change the title separator. Default to "::".
titleSeparator = "-"
2017-08-16 22:57:44 +00:00
```
2021-10-17 21:03:41 +00:00
## A word on running your site in a subfolder
The theme runs best if your site is installed in the root of your webserver. If your site is served from a subfolder, eg. `https://example.com/mysite/` , you have to set the following lines to your `config.toml`
````toml
baseURL = "https://example.com/mysite/"
canonifyURLs = true
````
Without `canonifyURLs=true` URLs in sublemental pages (like `sitemap.xml` , `rss.xml` ) will be generated falsly while your HTML files will still work. See https://github.com/gohugoio/hugo/issues/5226.
2017-08-16 22:57:44 +00:00
## Activate search
If not already present, add the follow lines in the same `config.toml` file.
```toml
[outputs]
home = [ "HTML", "RSS", "JSON"]
```
2021-06-30 12:56:06 +00:00
Relearn theme uses the last improvement available in hugo version 20+ to generate a json index file ready to be consumed by lunr.js javascript search engine.
2017-08-16 22:57:44 +00:00
2020-03-09 15:50:24 +00:00
> Hugo generate lunrjs index.json at the root of public folder.
2018-01-28 09:54:02 +00:00
> When you build the site with `hugo server`, hugo generates it internally and of course it doesn’ t show up in the filesystem
2020-09-11 13:57:25 +00:00
## Mermaid
2021-09-11 13:46:14 +00:00
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 ]({{< relref "shortcodes/mermaid.md" >}} ) for additional documentation.
2020-09-11 13:57:25 +00:00
> Example:
>
2021-08-23 21:51:52 +00:00
> Mermaid is globally disabled. By default it won't be loaded by any page.
2021-09-11 13:46:14 +00:00
> On page "Architecture" you need a class diagram. You can set the Mermaid parameters locally to only load mermaid on this page (not on the others).
2020-09-11 13:57:25 +00:00
2021-09-11 13:46:14 +00:00
You also can disable Mermaid for specific pages while globally enabled.
2020-10-21 16:53:27 +00:00
## Home Button Configuration
2021-08-23 22:46:53 +00:00
If the `disableLandingPageButton` option is set to `false` , a Home button will appear
2020-10-21 16:53:27 +00:00
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:
```toml
2021-11-24 11:01:36 +00:00
[Languages]
[Languages.en]
2020-10-21 16:53:27 +00:00
...
2021-10-17 21:03:41 +00:00
landingPageURL = "/"
2021-09-11 13:46:14 +00:00
landingPageName = "< i class = 'fas fa-home' > < / i > Home"
2020-10-21 16:53:27 +00:00
...
2021-11-24 11:01:36 +00:00
[Languages.pir]
2020-10-21 16:53:27 +00:00
...
2021-10-17 21:03:41 +00:00
landingPageURL = "/pir/"
2021-09-11 13:46:14 +00:00
landingPageName = "< i class = 'fas fa-home' > < / i > Arrr! Homme"
2020-10-21 16:53:27 +00:00
...
```
If those params are not configured for a specific language, they will get their
default values:
```toml
landingPageURL = "/"
landingPageName = "< i class = 'fas fa-home' > < / i > Home"
```
2021-08-23 21:51:52 +00:00
The home button is going to look like this:
2020-10-21 16:53:27 +00:00
2022-02-22 17:21:20 +00:00
![Default Home Button ](images/home_button_defaults.png?classes=shadow&width=300px )