mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
code highlighter: avoid unstyled blocks for indention in docs #32
This commit is contained in:
parent
b29f1ce055
commit
0d66a97284
5 changed files with 168 additions and 144 deletions
|
@ -12,35 +12,39 @@ Edit the website configuration `config.toml` and add a `[[menu.shortcuts]]` entr
|
|||
|
||||
Example from the current website:
|
||||
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
````toml
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Hugo Documentation"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Hugo Documentation"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
````
|
||||
|
||||
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.
|
||||
|
||||
For example, in your local `i18n/en.toml` file, add the following content
|
||||
|
||||
[Shortcuts-Title]
|
||||
other = "<Your value>"
|
||||
````toml
|
||||
[Shortcuts-Title]
|
||||
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)
|
||||
|
||||
|
@ -48,62 +52,63 @@ 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>`.
|
||||
|
||||
|
||||
Example from the current website:
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
title = "Documentation for Hugo Relearn Theme"
|
||||
weight = 1
|
||||
languageName = "English"
|
||||
````toml
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
title = "Documentation for Hugo Relearn Theme"
|
||||
weight = 1
|
||||
languageName = "English"
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Hugo Documentation"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Hugo Documentation"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
|
||||
[Languages.fr]
|
||||
title = "Documentation du thème Hugo Relearn"
|
||||
weight = 2
|
||||
languageName = "Français"
|
||||
[Languages.fr]
|
||||
title = "Documentation du thème Hugo Relearn"
|
||||
weight = 2
|
||||
languageName = "Français"
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Repo Github"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Repo Github"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Vitrine"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Vitrine"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Documentation Hugo"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Documentation Hugo"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Crédits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Crédits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
````
|
||||
|
||||
Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo multilingual menus](https://gohugo.io/content-management/multilingual/#menus)
|
|
@ -10,29 +10,31 @@ 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.
|
||||
|
||||
content
|
||||
├── level-one
|
||||
│ ├── level-two
|
||||
│ │ ├── level-three
|
||||
│ │ │ ├── level-four
|
||||
│ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four
|
||||
│ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a
|
||||
│ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b
|
||||
│ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c
|
||||
│ │ │ ├── _index.md <-- /level-one/level-two/level-three
|
||||
│ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a
|
||||
│ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b
|
||||
│ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c
|
||||
│ │ ├── _index.md <-- /level-one/level-two
|
||||
│ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a
|
||||
│ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b
|
||||
│ │ └── page-2-c.md <-- /level-one/level-two/page-2-c
|
||||
│ ├── _index.md <-- /level-one
|
||||
│ ├── page-1-a.md <-- /level-one/page-1-a
|
||||
│ ├── page-1-b.md <-- /level-one/page-1-b
|
||||
│ └── page-1-c.md <-- /level-one/page-1-c
|
||||
├── _index.md <-- /
|
||||
└── page-top.md <-- /page-top
|
||||
````plaintext
|
||||
content
|
||||
├── level-one
|
||||
│ ├── level-two
|
||||
│ │ ├── level-three
|
||||
│ │ │ ├── level-four
|
||||
│ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four
|
||||
│ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a
|
||||
│ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b
|
||||
│ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c
|
||||
│ │ │ ├── _index.md <-- /level-one/level-two/level-three
|
||||
│ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a
|
||||
│ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b
|
||||
│ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c
|
||||
│ │ ├── _index.md <-- /level-one/level-two
|
||||
│ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a
|
||||
│ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b
|
||||
│ │ └── page-2-c.md <-- /level-one/level-two/page-2-c
|
||||
│ ├── _index.md <-- /level-one
|
||||
│ ├── page-1-a.md <-- /level-one/page-1-a
|
||||
│ ├── page-1-b.md <-- /level-one/page-1-b
|
||||
│ └── page-1-c.md <-- /level-one/page-1-c
|
||||
├── _index.md <-- /
|
||||
└── page-top.md <-- /page-top
|
||||
````
|
||||
|
||||
{{% notice note %}}
|
||||
`_index.md` is required in each folder, it’s your “folder home page”
|
||||
|
|
|
@ -51,7 +51,9 @@ For example:
|
|||
|
||||
#### List of attachments ending in pdf or mp4
|
||||
|
||||
{{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}}
|
||||
````go
|
||||
{{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}}
|
||||
````
|
||||
|
||||
renders as
|
||||
|
||||
|
@ -59,26 +61,33 @@ renders as
|
|||
|
||||
#### Colored styled box
|
||||
|
||||
{{%/*attachments style="orange" /*/%}}
|
||||
````go
|
||||
{{%/*attachments style="orange" /*/%}}
|
||||
````
|
||||
|
||||
renders as
|
||||
|
||||
{{% attachments style="orange" /%}}
|
||||
|
||||
|
||||
{{%/*attachments style="grey" /*/%}}
|
||||
````go
|
||||
{{%/*attachments style="grey" /*/%}}
|
||||
````
|
||||
|
||||
renders as
|
||||
|
||||
{{% attachments style="grey" /%}}
|
||||
|
||||
{{%/*attachments style="blue" /*/%}}
|
||||
````go
|
||||
{{%/*attachments style="blue" /*/%}}
|
||||
````
|
||||
|
||||
renders as
|
||||
|
||||
{{% attachments style="blue" /%}}
|
||||
|
||||
{{%/*attachments style="green" /*/%}}
|
||||
````go
|
||||
{{%/*attachments style="green" /*/%}}
|
||||
````
|
||||
|
||||
renders as
|
||||
|
||||
|
|
|
@ -18,28 +18,32 @@ Use the children shortcode to list the child pages of a page and the further des
|
|||
|
||||
## Demo
|
||||
|
||||
{{%/* children */%}}
|
||||
````go
|
||||
{{%/* children */%}}
|
||||
````
|
||||
|
||||
{{% children %}}
|
||||
|
||||
{{%/* children description="true" */%}}
|
||||
````go
|
||||
{{%/* children description="true" */%}}
|
||||
````
|
||||
|
||||
{{%children description="true" %}}
|
||||
|
||||
{{%/* children depth="3" showhidden="true" */%}}
|
||||
````go
|
||||
{{%/* children depth="3" showhidden="true" */%}}
|
||||
````
|
||||
|
||||
{{% children depth="3" showhidden="true" %}}
|
||||
|
||||
{{%/* children style="h2" depth="3" description="true" */%}}
|
||||
````go
|
||||
{{%/* children style="h2" depth="3" description="true" */%}}
|
||||
````
|
||||
|
||||
{{% children style="h2" depth="3" description="true" %}}
|
||||
|
||||
{{%/* children style="div" depth="999" */%}}
|
||||
````go
|
||||
{{%/* children style="div" depth="999" */%}}
|
||||
````
|
||||
|
||||
{{% children style="div" depth="999" %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -8,23 +8,25 @@ snippets for multiple languages or providing configuration in different formats.
|
|||
|
||||
## Code example
|
||||
|
||||
{{</* tabs */>}}
|
||||
{{%/* tab name="python" */%}}
|
||||
```python
|
||||
print("Hello World!")
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="R" */%}}
|
||||
```R
|
||||
> print("Hello World!")
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="Bash" */%}}
|
||||
```Bash
|
||||
echo "Hello World!"
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{</* /tabs */>}}
|
||||
````go
|
||||
{{</* tabs */>}}
|
||||
{{%/* tab name="python" */%}}
|
||||
```python
|
||||
print("Hello World!")
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="R" */%}}
|
||||
```R
|
||||
> print("Hello World!")
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="Bash" */%}}
|
||||
```Bash
|
||||
echo "Hello World!"
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{</* /tabs */>}}
|
||||
````
|
||||
|
||||
Renders as:
|
||||
|
||||
|
@ -68,25 +70,27 @@ echo "Hello World!"
|
|||
|
||||
## Config example
|
||||
|
||||
{{</* tabs groupId="config" */>}}
|
||||
{{%/* tab name="json" */%}}
|
||||
```json
|
||||
{
|
||||
"Hello": "World"
|
||||
}
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="XML" */%}}
|
||||
```xml
|
||||
<Hello>World</Hello>
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="properties" */%}}
|
||||
```properties
|
||||
Hello = World
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{</* /tabs */>}}
|
||||
````go
|
||||
{{</* tabs groupId="config" */>}}
|
||||
{{%/* tab name="json" */%}}
|
||||
```json
|
||||
{
|
||||
"Hello": "World"
|
||||
}
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="XML" */%}}
|
||||
```xml
|
||||
<Hello>World</Hello>
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{%/* tab name="properties" */%}}
|
||||
```properties
|
||||
Hello = World
|
||||
```
|
||||
{{%/* /tab */%}}
|
||||
{{</* /tabs */>}}
|
||||
````
|
||||
|
||||
Renders as:
|
||||
|
||||
|
@ -104,7 +108,7 @@ Renders as:
|
|||
```
|
||||
{{% /tab %}}
|
||||
{{% tab name="properties" %}}
|
||||
```properties
|
||||
```ini
|
||||
Hello = World
|
||||
```
|
||||
{{% /tab %}}
|
||||
|
@ -115,5 +119,5 @@ When using tab views with different content sets, make sure to use a common `gro
|
|||
`groupId` for different sets. The `groupId` defaults to `'default'`.
|
||||
**Take this into account across the whole site!**
|
||||
The tab selection is restored automatically based on the `groupId` and if it cannot find a tab item because it came
|
||||
from the `'default'` group on a different page then all tabs will be empty at first.
|
||||
from the `'default'` group on a different page then all tabs will be empty at first.
|
||||
{{% /notice %}}
|
||||
|
|
Loading…
Reference in a new issue