docs: adding options and frontmatter index #567

This commit is contained in:
Sören Weber 2024-10-04 17:40:29 +02:00
parent 34c46451bd
commit c9378b1e42
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
24 changed files with 143 additions and 23 deletions

View file

@ -106,7 +106,7 @@ summaryLength = 10
landingPageName = "<i class='fa-fw fas fa-home'></i> Home"
[[languages.en.menu.shortcuts]]
name = "<i class='fa-fw fab fa-github'></i> GitHub repo"
name = "<i class='fa-fw fab fa-github'></i> GitHub Repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
@ -122,15 +122,25 @@ summaryLength = 10
weight = 30
[[languages.en.menu.shortcuts]]
name = "<i class='fa-fw fas fa-tags'></i> Tags"
pageRef = "tags/"
name = "<i class='fa-fw fas fa-gears'></i> All Options"
pageRef = "options/"
weight = 40
[[languages.en.menu.shortcuts]]
name = "<i class='fa-fw fas fa-layer-group'></i> Categories"
pageRef = "categories/"
name = "<i class='fa-fw fab fa-markdown'></i> All Front Matter"
pageRef = "frontmatter/"
weight = 50
# [[languages.en.menu.shortcuts]]
# name = "<i class='fa-fw fas fa-tags'></i> Tags"
# pageRef = "tags/"
# weight = 60
#
# [[languages.en.menu.shortcuts]]
# name = "<i class='fa-fw fas fa-layer-group'></i> Categories"
# pageRef = "categories/"
# weight = 70
# this is ourrr way t' showcase th' multilang settings by
# doing autotrrranlat'n of th' english content; we are
# lazy and don't supporrt furrrther trrranslations; arrr,
@ -152,7 +162,7 @@ summaryLength = 10
landingPageName = "<i class='fa-fw fas home'></i> Arrr! Home"
[[languages.pir.menu.shortcuts]]
name = "<i class='fa-fw fab fa-github'></i> GitHub repo"
name = "<i class='fa-fw fab fa-github'></i> GitHub Repo"
identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10
@ -168,15 +178,25 @@ summaryLength = 10
weight = 30
[[languages.pir.menu.shortcuts]]
name = "<i class='fa-fw fas fa-tags'></i> Arrr! Tags"
pageRef = "tags/"
name = "<i class='fa-fw fas fa-gears'></i> All Options"
pageRef = "options/"
weight = 40
[[languages.pir.menu.shortcuts]]
name = "<i class='fa-fw fas fa-layer-group'></i> Categorrries"
pageRef = "categories/"
name = "<i class='fa-fw fab fa-markdown'></i> All Front Matter"
pageRef = "frontmatter/"
weight = 50
# [[languages.pir.menu.shortcuts]]
# name = "<i class='fa-fw fas fa-tags'></i> Arrr! Tags"
# pageRef = "tags/"
# weight = 60
#
# [[languages.pir.menu.shortcuts]]
# name = "<i class='fa-fw fas fa-layer-group'></i> Categorrries"
# pageRef = "categories/"
# weight = 70
# mounts are only needed in this showcase to access the publicly available screenshots and CHANGELOG;
# remove this section if you don't need further mounts
[module]
@ -231,6 +251,12 @@ summaryLength = 10
source = '../README.md'
target = 'assets/README.md'
[taxonomies]
category = 'categories'
tag = 'tags'
frontmatter = 'frontmatter'
option = 'options'
[params]
# Demo setting for displaying the siteparam shortcode the docs.
siteparam.test.text = "A **nested** option <b>with</b> formatting"

View file

@ -1,5 +1,6 @@
+++
description = "How to configure colors, fonts, favicon and logo"
options = ["themeVariant"]
title = "Branding"
weight = 1
+++

View file

@ -1,6 +1,7 @@
+++
description = "An interactive tool to generate color variant stylesheets"
disableMermaid = false
options = ["themeVariant"]
title = "Stylesheet Generator"
weight = 9
+++
@ -18,9 +19,9 @@ To better understand this select the `neon` variant and modify the different hea
Once you've changed a color, the variant selector will show a "My custom variant" entry and your changes are stored in the browser. You can **browse to other pages** and even close the browser **without losing your changes**.
Once you are satisfied, you can download the new variants file and copy it into your site's `assets/css` directory. Afterwards you have to adjust the `themeVariant` parameter in your `hugo.toml` to your chosen file name.
Once you are satisfied, you can download the new variants file and copy it into your site's `assets/css` directory. Afterwards you have to adjust the `params.themeVariant` option in your `hugo.toml` to your chosen file name.
Eg. if your new variants file is named `theme-my-custom-variant.css`, you have to set `themeVariant='my-custom-variant'` to use it.
Eg. if your new variants file is named `theme-my-custom-variant.css`, you have to set `params.themeVariant='my-custom-variant'` to use it.
See the docs for [further configuration options](configuration/appearance/branding)
{{% /expand %}}

View file

@ -1,5 +1,6 @@
+++
description = "Configure the site's topbar"
options = ["breadcrumbSeparator", "disableBreadcrumb", "disableNextPrev", "disableRootBreadcrumb", "disableToc", "editURL"]
title = "Topbar"
weight = 3
+++

View file

@ -1,5 +1,6 @@
+++
description = "How to configure heading anchors"
options = ["disableAnchorCopy", "disableAnchorScrolling"]
title = "Headings"
weight = 3
+++

View file

@ -1,5 +1,6 @@
+++
description = "Learn about the hiddes pages feature"
options = ["disableSearchHiddenPages", "disableSeoHiddenPages", "disableTagHiddenPages"]
title = "Hidden Pages"
weight = 5
+++
@ -20,7 +21,7 @@ To hide hidden pages from search results of the search popup and dedicated searc
## Hide from Crawlers
To hide hidden pages from crawlers by removing links from the sitemap and rss feed, set `params.disableSearchHiddenPages=true`.
To hide hidden pages from crawlers by removing links from the sitemap and rss feed, set `params.disableSeoHiddenPages=true`.
## Hide from Taxonomies

View file

@ -1,5 +1,6 @@
+++
description = "How to extend the topbar"
options = ["editURL"]
title = "Topbar Modification"
weight = 1
+++

View file

@ -7,12 +7,14 @@ weight = 6
On top of [Hugo's global configuration options](https://gohugo.io/overview/configuration/), you can set further options unique to the theme in your `hugo.toml`.
This is the complete list of theme options. Note that all these options are explained in detail in other sections of this documentation.
This is the complete list of options supported by the theme.
The values shown here, reflect the options active in this documentation. The default values can be taken from the [annotated example](#annotated-config-options) below.
See the [index](options/) for pointers to in-detail documentation.
## All config options
The values reflect example options. The defaults can be taken from the [annotated example](#annotated-config-options) below.
{{< multiconfig file=hugo section=params >}}
{{% include "config/_default/params.toml" %}}
{{< /multiconfig >}}

View file

@ -1,12 +1,13 @@
+++
description = "Configure the header and footer of the sidebar"
options = ["disableLandingPageButton", "showVisitedLinks"]
title = "Header & Footer"
weight = 2
+++
## Home Button Configuration
If `disableLandingPageButton=true`, the Home button will be hidden on the left menu.
If `params.disableLandingPageButton=true`, the Home button will be hidden on the left menu.
If you display the Home button, it is an alternative for clicking on the logo. To edit its logo or text, you will have to configure the `landingPageName` for the defined languages

View file

@ -1,5 +1,6 @@
+++
description = "Default behavior of the navigation menu"
options = ["alwaysopen", "ordersectionsby"]
title = "Navigation Menu"
weight = 4
+++

View file

@ -1,5 +1,6 @@
+++
description = "Configure search and the search form"
options = ["additionalContentLanguage", "disableSearch", "disableSearchIndex", "disableSearchPage", "searchIndexURL", "searchPageURL"]
title = "Search"
weight = 3
+++
@ -16,14 +17,14 @@ Each level depends on the previous level to be enabled, eg. the dedicated search
By default all three levels are enabled. You can disable each level by the following settings in your `hugo.toml`:
- in-page search: `disableSearch=true`
- search popup: `disableSearchIndex=true`
- dedicated search page: `disableSearchPage=true`
- in-page search: `params.disableSearch=true`
- search popup: `params.disableSearchIndex=true`
- dedicated search page: `params.disableSearchPage=true`
By default the following files will be created, relative to each languages home page but can be overwritten:
- search popup: `searchindex.js`, configured by `searchIndexURL`
- dedicated search page: `search/index.html`, configured by `searchPageURL`
- search popup: `searchindex.js`, configured by `params.searchIndexURL`
- dedicated search page: `search/index.html`, configured by `params.searchPageURL`
{{% notice note %}}
You only need to reconfigure the file / page URLs if you have own content at those URLs in your project. Eg. this can happen if you set `uglyURLs=true` in your `hugo.toml` and defining a Markdown file `content/search.md`.

View file

@ -1,5 +1,6 @@
+++
description = "Options for specific deployment needs"
options = ["disableExplicitIndexURLs"]
title = "Deployment Scenarios"
weight = 3
+++

View file

@ -1,5 +1,6 @@
+++
description = "How to configure your site to be multilingual"
options = ["disableLanguageSwitchingButton"]
title = "Multilingual"
weight = 2
+++

View file

@ -3,7 +3,11 @@ title = "Frontmatter Reference"
weight = 6
+++
Each Hugo page **has to define** a [frontmatter](https://gohugo.io/content/front-matter/).
Each Hugo page **has to define** a [front matter](https://gohugo.io/content/front-matter/).
This is the complete list of front matter supported by the theme.
See the [index](frontmatter/) for pointers to in-detail documentation.
## All Frontmatter Options

View file

@ -0,0 +1,8 @@
+++
+++
Each Hugo page **has to define** a [frontmatter](https://gohugo.io/content/front-matter/).
This is the complete list of front matter supported by the theme.
See the [reference](content/frontmatter/) for examples.

View file

@ -0,0 +1,5 @@
+++
title = "Tag-a-taggs"
singulartitle = "Tagga"
+++
{{< piratify >}}

View file

@ -8,7 +8,9 @@ Here's how to start your new website. If you're new to Hugo, we recommend learni
## Install Hugo
Install Hugo {{% badge color="fuchsia" icon="fa-fw fab fa-hackerrank" title=" " %}}0.126.0{{% /badge %}} or newer for your operating system [following the instructions](https://gohugo.io/installation/).
Download and install Hugo {{% badge color="fuchsia" icon="fa-fw fab fa-hackerrank" title=" " %}}0.126.0{{% /badge %}} or newer for your operating system [following the instructions](https://gohugo.io/installation/).
The _standard_ edition of Hugo is sufficient but you can also use the _extended_ edition.
## Create your Project

View file

@ -0,0 +1,8 @@
+++
+++
On top of [Hugo's global configuration options](https://gohugo.io/overview/configuration/), you can set further options unique to the theme in your `hugo.toml`.
This is the complete list of options supported by the theme.
See the [reference](configuration/options/) for examples.

View file

@ -0,0 +1,5 @@
+++
title = "Tag-a-taggs"
singulartitle = "Tagga"
+++
{{< piratify >}}

View file

@ -1,5 +1,6 @@
+++
description = "Render code with a syntax highlighter"
options = ["highlightWrap"]
title = "Highlight"
+++

View file

@ -1,5 +1,6 @@
+++
description = "Beautiful math and chemical formulae"
options = ["disableMathJax", "mathJaxInitialize"]
title = "Math"
+++

View file

@ -1,5 +1,6 @@
+++
description = "Generate diagrams and flowcharts from text"
options = ["mermaidInitialize", "mermaidZoom"]
title = "Mermaid"
+++

View file

@ -1,5 +1,6 @@
+++
description = "Disclaimers to help you structure your page"
options = ["boxStyle"]
title = "Notice"
+++

View file

@ -0,0 +1,45 @@
{{- $LastModifierDisplayName := "" }}
{{- $LastModifierEmail := "" }}
{{- $Date := "" }}
{{- with .GitInfo }}
{{- with .AuthorName }}
{{- $LastModifierDisplayName = . }}
{{- end }}
{{- with .AuthorEmail }}
{{- $LastModifierEmail = . }}
{{- end }}
{{- with .AuthorDate }}
{{- $Date = . | time.Format ":date_medium" }}
{{- end }}
{{- else }}
{{- with .Params.LastModifierDisplayName }}
{{- $LastModifierDisplayName = . }}
{{- end }}
{{- with .Params.LastModifierEmail }}
{{- $LastModifierEmail = . }}
{{- end }}
{{- with .Date }}
{{- $Date = . | time.Format ":date_medium" }}
{{- end }}
{{- end }}
{{- if $LastModifierDisplayName }}
<i class='fa-fw fas fa-user'></i> {{ with $LastModifierEmail }}<a href="mailto:{{ . }}">{{ end }}{{ $LastModifierDisplayName }}{{ with $LastModifierEmail }}</a>{{ end }}
{{- with $Date }}
<i class='fa-fw fas fa-calendar'></i> {{ . }}
{{- end }}
{{- end }}
{{- partial "term-list.html" (dict
"page" .
"taxonomy" "options"
"icon" "gears"
) }}
{{- partial "term-list.html" (dict
"page" .
"taxonomy" "frontmatters"
"icon" "fa-fw fab fa-markdown"
) }}
{{- partial "term-list.html" (dict
"page" .
"taxonomy" "categories"
"icon" "layer-group"
) }}