code highlighter: avoid unstyled blocks for indention in docs #32

This commit is contained in:
Sören Weber 2021-08-24 00:25:15 +02:00
parent b29f1ce055
commit 0d66a97284
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
5 changed files with 168 additions and 144 deletions

View file

@ -12,6 +12,7 @@ Edit the website configuration `config.toml` and add a `[[menu.shortcuts]]` entr
Example from the current website: Example from the current website:
````toml
[[menu.shortcuts]] [[menu.shortcuts]]
name = "<i class='fab fa-github'></i> Github repo" name = "<i class='fab fa-github'></i> Github repo"
identifier = "ds" identifier = "ds"
@ -33,14 +34,17 @@ Example from the current website:
name = "<i class='fas fa-bullhorn'></i> Credits" name = "<i class='fas fa-bullhorn'></i> Credits"
url = "/credits" url = "/credits"
weight = 30 weight = 30
````
By default, shortcuts are preceded by a title. This title can be disabled by setting `disableShortcutsTitle=true`. By default, shortcuts are preceded by a title. This title can be disabled by setting `disableShortcutsTitle=true`.
However, if you want to keep the title but change its value, it can be overriden by changing your local i18n translation string configuration. However, if you want to keep the title but change its value, it can be overriden by changing your local i18n translation string configuration.
For example, in your local `i18n/en.toml` file, add the following content For example, in your local `i18n/en.toml` file, add the following content
````toml
[Shortcuts-Title] [Shortcuts-Title]
other = "<Your value>" other = "<Your value>"
````
Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo i18n translation strings](https://gohugo.io/content-management/multilingual/#translation-of-strings) Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo i18n translation strings](https://gohugo.io/content-management/multilingual/#translation-of-strings)
@ -48,9 +52,9 @@ Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo i18n tran
When using a multilingual website, you can set different menus for each language. In the `config.toml` file, prefix your menu configuration by `Languages.<language-id>`. When using a multilingual website, you can set different menus for each language. In the `config.toml` file, prefix your menu configuration by `Languages.<language-id>`.
Example from the current website: Example from the current website:
````toml
[Languages] [Languages]
[Languages.en] [Languages.en]
title = "Documentation for Hugo Relearn Theme" title = "Documentation for Hugo Relearn Theme"
@ -105,5 +109,6 @@ Example from the current website:
name = "<i class='fas fa-bullhorn'></i> Crédits" name = "<i class='fas fa-bullhorn'></i> Crédits"
url = "/credits" url = "/credits"
weight = 30 weight = 30
````
Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo multilingual menus](https://gohugo.io/content-management/multilingual/#menus) Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo multilingual menus](https://gohugo.io/content-management/multilingual/#menus)

View file

@ -10,6 +10,7 @@ In **Hugo**, pages are the core of your site. Once it is configured, pages are d
Organize your site like [any other Hugo project](https://gohugo.io/content/organization/). Typically, you will have a *content* folder with all your pages. Organize your site like [any other Hugo project](https://gohugo.io/content/organization/). Typically, you will have a *content* folder with all your pages.
````plaintext
content content
├── level-one ├── level-one
│ ├── level-two │ ├── level-two
@ -33,6 +34,7 @@ Organize your site like [any other Hugo project](https://gohugo.io/content/organ
│ └── page-1-c.md <-- /level-one/page-1-c │ └── page-1-c.md <-- /level-one/page-1-c
├── _index.md <-- / ├── _index.md <-- /
└── page-top.md <-- /page-top └── page-top.md <-- /page-top
````
{{% notice note %}} {{% notice note %}}
`_index.md` is required in each folder, its your “folder home page” `_index.md` is required in each folder, its your “folder home page”

View file

@ -51,7 +51,9 @@ For example:
#### List of attachments ending in pdf or mp4 #### List of attachments ending in pdf or mp4
````go
{{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}} {{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}}
````
renders as renders as
@ -59,26 +61,33 @@ renders as
#### Colored styled box #### Colored styled box
````go
{{%/*attachments style="orange" /*/%}} {{%/*attachments style="orange" /*/%}}
````
renders as renders as
{{% attachments style="orange" /%}} {{% attachments style="orange" /%}}
````go
{{%/*attachments style="grey" /*/%}} {{%/*attachments style="grey" /*/%}}
````
renders as renders as
{{% attachments style="grey" /%}} {{% attachments style="grey" /%}}
````go
{{%/*attachments style="blue" /*/%}} {{%/*attachments style="blue" /*/%}}
````
renders as renders as
{{% attachments style="blue" /%}} {{% attachments style="blue" /%}}
````go
{{%/*attachments style="green" /*/%}} {{%/*attachments style="green" /*/%}}
````
renders as renders as

View file

@ -18,28 +18,32 @@ Use the children shortcode to list the child pages of a page and the further des
## Demo ## Demo
````go
{{%/* children */%}} {{%/* children */%}}
````
{{% children %}} {{% children %}}
````go
{{%/* children description="true" */%}} {{%/* children description="true" */%}}
````
{{%children description="true" %}} {{%children description="true" %}}
````go
{{%/* children depth="3" showhidden="true" */%}} {{%/* children depth="3" showhidden="true" */%}}
````
{{% children depth="3" showhidden="true" %}} {{% children depth="3" showhidden="true" %}}
````go
{{%/* children style="h2" depth="3" description="true" */%}} {{%/* children style="h2" depth="3" description="true" */%}}
````
{{% children style="h2" depth="3" description="true" %}} {{% children style="h2" depth="3" description="true" %}}
````go
{{%/* children style="div" depth="999" */%}} {{%/* children style="div" depth="999" */%}}
````
{{% children style="div" depth="999" %}} {{% children style="div" depth="999" %}}

View file

@ -8,6 +8,7 @@ snippets for multiple languages or providing configuration in different formats.
## Code example ## Code example
````go
{{</* tabs */>}} {{</* tabs */>}}
{{%/* tab name="python" */%}} {{%/* tab name="python" */%}}
```python ```python
@ -25,6 +26,7 @@ snippets for multiple languages or providing configuration in different formats.
``` ```
{{%/* /tab */%}} {{%/* /tab */%}}
{{</* /tabs */>}} {{</* /tabs */>}}
````
Renders as: Renders as:
@ -68,6 +70,7 @@ echo "Hello World!"
## Config example ## Config example
````go
{{</* tabs groupId="config" */>}} {{</* tabs groupId="config" */>}}
{{%/* tab name="json" */%}} {{%/* tab name="json" */%}}
```json ```json
@ -87,6 +90,7 @@ echo "Hello World!"
``` ```
{{%/* /tab */%}} {{%/* /tab */%}}
{{</* /tabs */>}} {{</* /tabs */>}}
````
Renders as: Renders as:
@ -104,7 +108,7 @@ Renders as:
``` ```
{{% /tab %}} {{% /tab %}}
{{% tab name="properties" %}} {{% tab name="properties" %}}
```properties ```ini
Hello = World Hello = World
``` ```
{{% /tab %}} {{% /tab %}}