mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 10:50:24 +00:00
parent
5818228df3
commit
5574ec073e
73 changed files with 535 additions and 114 deletions
|
@ -6,7 +6,7 @@ A theme for [Hugo](https://gohugo.io/) designed for documentation.
|
|||
|
||||
## Motivation
|
||||
|
||||
The theme initially was a fork of the great [hugo-theme-learn](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for hugo-theme-learn.
|
||||
The theme initially was a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for the Learn theme.
|
||||
|
||||
## Main features
|
||||
|
||||
|
@ -49,4 +49,4 @@ This theme is licensed under the [MIT License](https://github.com/McShelby/hugo-
|
|||
|
||||
Special thanks to [everyone who has contributed](https://github.com/McShelby/hugo-theme-relearn/graphs/contributors) to this project.
|
||||
|
||||
Many thanks to [@matcornic](https://github.com/matcornic) for his work on [hugo-theme-learn](https://github.com/matcornic/hugo-theme-learn).
|
||||
Many thanks to [@matcornic](https://github.com/matcornic) for his work on the [Learn theme](https://github.com/matcornic/hugo-theme-learn).
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
baseURL = "https://example.com"
|
||||
languageCode = "en-US"
|
||||
languageCode = "en"
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
title = "Hugo Relearn Documentation"
|
||||
theme = "hugo-theme-relearn"
|
||||
themesdir = "../.."
|
||||
metaDataFormat = "yaml"
|
||||
defaultContentLanguageInSubdir = true
|
||||
relativeURLs = true
|
||||
|
||||
[params]
|
||||
|
@ -41,7 +40,7 @@ relativeURLs = true
|
|||
title = "Documentation for Hugo Relearn Theme"
|
||||
weight = 1
|
||||
languageName = "English"
|
||||
landingPageURL = "/"
|
||||
landingPageURL = "/en"
|
||||
landingPageName = "<i class='fas fa-home'></i> Home"
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
|
@ -65,3 +64,32 @@ relativeURLs = true
|
|||
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
|
||||
[Languages.en-pir]
|
||||
title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
|
||||
weight = 1
|
||||
languageName = "Arrr! Pirrrates"
|
||||
landingPageURL = "/en-pir"
|
||||
landingPageName = "<i class='fas fa-home'></i> Arrr! Home"
|
||||
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
|
||||
url = "showcase"
|
||||
weight = 11
|
||||
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentat'n"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
|
|
4
exampleSite/content/_index.en-pir.md
Normal file
4
exampleSite/content/_index.en-pir.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
+++
|
||||
title = "Relearrrn Theme fer Cap'n Hugo"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -4,28 +4,28 @@ title = "Relearn Theme for Hugo"
|
|||
|
||||
# Hugo Relearn Theme
|
||||
|
||||
[Hugo-theme-relearn](http://github.com/McShelby/hugo-theme-relearn) is a theme for [Hugo](https://gohugo.io/), a static website generator written in Go. Where Hugo is often used for blogs, this theme is designed with documentation in mind.
|
||||
The [Relearn theme](http://github.com/McShelby/hugo-theme-relearn) is a theme for [Hugo](https://gohugo.io/), a static website generator written in Go. Where Hugo is often used for blogs, this theme is designed with documentation in mind.
|
||||
|
||||
{{% notice info %}}
|
||||
The theme initially was a fork of the great [hugo-theme-learn](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for hugo-theme-learn.
|
||||
The theme initially was a fork of the great [Learn theme](https://github.com/matcornic/hugo-theme-learn) with the aim of fixing long outstanding bugs and adepting to latest Hugo features. As far as possible this theme tries to be a drop-in replacement for Learn theme.
|
||||
{{% /notice %}}
|
||||
|
||||
## Main features
|
||||
|
||||
* [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}})
|
||||
* [Multilingual mode]({{%relref "cont/i18n/_index.md" %}})
|
||||
* [Multilingual mode]({{%relref "cont/i18n" %}})
|
||||
* Unlimited menu levels
|
||||
* Automatic next/prev buttons to navigate through menu entries
|
||||
* [Image resizing, shadow...]({{%relref "cont/markdown.en.md#images" %}})
|
||||
* [Attachments files]({{%relref "shortcodes/attachments.en.md" %}})
|
||||
* [List child pages]({{%relref "shortcodes/children/_index.md" %}})
|
||||
* [Mermaid diagram]({{%relref "shortcodes/mermaid.en.md" %}}) (flowchart, sequence, gantt)
|
||||
* [Customizable look and feel and theme variants]({{%relref "basics/customization/_index.md"%}})
|
||||
* [Buttons]({{%relref "shortcodes/button.en.md" %}})
|
||||
* [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice.en.md" %}})
|
||||
* [Expand]({{%relref "shortcodes/expand.en.md" %}})
|
||||
* [Tabs]({{%relref "shortcodes/tabs.en.md" %}})
|
||||
* [File inclusion]({{%relref "shortcodes/include.en.md" %}})
|
||||
* [Image resizing, shadow...]({{%relref "cont/markdown#images" %}})
|
||||
* [Attachments files]({{%relref "shortcodes/attachments" %}})
|
||||
* [List child pages]({{%relref "shortcodes/children" %}})
|
||||
* [Mermaid diagram]({{%relref "shortcodes/mermaid" %}}) (flowchart, sequence, gantt)
|
||||
* [Customizable look and feel and theme variants]({{%relref "basics/customization"%}})
|
||||
* [Buttons]({{%relref "shortcodes/button" %}})
|
||||
* [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice" %}})
|
||||
* [Expand]({{%relref "shortcodes/expand" %}})
|
||||
* [Tabs]({{%relref "shortcodes/tabs" %}})
|
||||
* [File inclusion]({{%relref "shortcodes/include" %}})
|
||||
|
||||
![Screenshot](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png?width=40pc&classes=shadow)
|
||||
|
||||
|
@ -45,4 +45,4 @@ This theme is licensed under the [MIT License](https://github.com/McShelby/hugo-
|
|||
|
||||
## Credits
|
||||
|
||||
This theme would not be possible without the work of many others. See the [credits]({{%relref "credits.md" %}}) for a detailed list.
|
||||
This theme would not be possible without the work of many others. See the [credits]({{%relref "credits" %}}) for a detailed list.
|
||||
|
|
6
exampleSite/content/basics/_index.en-pir.md
Normal file
6
exampleSite/content/basics/_index.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
chapter = true
|
||||
title = "Basics"
|
||||
weight = 1
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Configurrrat'n"
|
||||
weight = 20
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -5,7 +5,7 @@ weight = 20
|
|||
|
||||
## Global site parameters
|
||||
|
||||
On top of [Hugo global configuration](https://gohugo.io/overview/configuration/), **Hugo-theme-relearn** lets you define the following parameters in your `config.toml` (here, values are default).
|
||||
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).
|
||||
|
||||
Note that some of these parameters are explained in details in other sections of this documentation.
|
||||
|
||||
|
@ -41,11 +41,11 @@ Note that some of these parameters are explained in details in other sections of
|
|||
disableLanguageSwitchingButton = false
|
||||
# Hide breadcrumbs in the header and only show the current page title
|
||||
disableBreadcrumb = true
|
||||
# If set to true, prevents Hugo from including the mermaid module if not needed (will reduce load times and traffic)
|
||||
# If set to true, prevents Hugo from including the Mermaid module if not needed (will reduce load times and traffic)
|
||||
disableMermaid = false
|
||||
# Specifies the remote location of the mermaid js
|
||||
# Specifies the remote location of the Mermaid js
|
||||
customMermaidURL = "https://unpkg.com/mermaid@8.8.0/dist/mermaid.min.js"
|
||||
# Initialization parameter for mermaid, see mermaid documentation
|
||||
# Initialization parameter for Mermaid, see Mermaid documentation
|
||||
mermaidInitialize = "{ \"theme\": \"default\" }"
|
||||
# Hide Next and Previous page buttons normally displayed full height beside content
|
||||
disableNextPrev = true
|
||||
|
@ -75,14 +75,14 @@ Relearn theme uses the last improvement available in hugo version 20+ to generat
|
|||
|
||||
## Mermaid
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
> Example:
|
||||
>
|
||||
> Mermaid is globally disabled. By default it won't be loaded by any page.
|
||||
> 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).
|
||||
> 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).
|
||||
|
||||
You also can disable mermaid for specific pages while globally enabled.
|
||||
You also can disable Mermaid for specific pages while globally enabled.
|
||||
|
||||
## Home Button Configuration
|
||||
|
||||
|
@ -95,12 +95,12 @@ appearance, you will have to configure two parameters for the defined languages:
|
|||
[Lanugages.en]
|
||||
...
|
||||
landingPageURL = "/en"
|
||||
landingPageName = "<i class='fas fa-home'></i> Redirect to Home"
|
||||
landingPageName = "<i class='fas fa-home'></i> Home"
|
||||
...
|
||||
[Lanugages.fr]
|
||||
[Lanugages.en-pir]
|
||||
...
|
||||
landingPageURL = "/fr"
|
||||
landingPageName = "<i class='fas fa-home'></i> Accueil"
|
||||
landingPageURL = "/en-pir"
|
||||
landingPageName = "<i class='fas fa-home'></i> Arrr! Homme"
|
||||
...
|
||||
```
|
||||
|
||||
|
@ -114,4 +114,4 @@ landingPageName = "<i class='fas fa-home'></i> Home"
|
|||
|
||||
The home button is going to look like this:
|
||||
|
||||
![Default Home Button](images/home_button_defaults.png?width=100%)
|
||||
![Default Home Button](/basics/configuration/images/home_button_defaults.png?width=100%)
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Customizat'n"
|
||||
weight = 25
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -3,7 +3,7 @@ title = "Customization"
|
|||
weight = 25
|
||||
+++
|
||||
|
||||
**Hugo-theme-relearn** has been built to be as configurable as possible by defining multiple [partials](https://gohugo.io/templates/partials/)
|
||||
The Relearn theme has been built to be as configurable as possible by defining multiple [partials](https://gohugo.io/templates/partials/)
|
||||
|
||||
In `themes/hugo-theme-relearn/layouts/partials/`, you will find all the partials defined for this theme. If you need to overwrite something, don't change the code directly. Instead [follow this page](https://gohugo.io/themes/customizing/). You'd create a new partial in the `layouts/partials` folder of your local project. This partial will have the priority.
|
||||
|
||||
|
@ -45,7 +45,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
|
|||
|
||||
## Change default colors {#theme-variant}
|
||||
|
||||
**Hugo Relearn theme** let you choose between some predefined color scheme variants, but feel free to add one yourself!
|
||||
The Relearn theme let you choose between some predefined color scheme variants, but feel free to add one yourself!
|
||||
|
||||
### Standard variant
|
||||
|
||||
|
@ -55,7 +55,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
|
|||
themeVariant = ""
|
||||
```
|
||||
|
||||
![Red variant](images/standard-variant.png?width=60pc)
|
||||
![Red variant](/basics/customization/images/standard-variant.png?width=60pc)
|
||||
|
||||
### Red variant
|
||||
|
||||
|
@ -65,7 +65,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
|
|||
themeVariant = "red"
|
||||
```
|
||||
|
||||
![Red variant](images/red-variant.png?width=60pc)
|
||||
![Red variant](/basics/customization/images/red-variant.png?width=60pc)
|
||||
|
||||
### Blue variant
|
||||
|
||||
|
@ -75,7 +75,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
|
|||
themeVariant = "blue"
|
||||
```
|
||||
|
||||
![Blue variant](images/blue-variant.png?width=60pc)
|
||||
![Blue variant](/basics/customization/images/blue-variant.png?width=60pc)
|
||||
|
||||
### Green variant
|
||||
|
||||
|
@ -85,7 +85,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
|
|||
themeVariant = "green"
|
||||
```
|
||||
|
||||
![Green variant](images/green-variant.png?width=60pc)
|
||||
![Green variant](/basics/customization/images/green-variant.png?width=60pc)
|
||||
|
||||
### 'Mine‘ variant
|
||||
|
||||
|
|
5
exampleSite/content/basics/history/_index.en-pir.md
Normal file
5
exampleSite/content/basics/history/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Historrry"
|
||||
weight = 30
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/basics/installation/_index.en-pir.md
Normal file
5
exampleSite/content/basics/installation/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Installat'n"
|
||||
weight = 15
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -15,7 +15,7 @@ hugo new site <new_project>
|
|||
|
||||
## Install the theme
|
||||
|
||||
Install the **Hugo-theme-relearn** theme by following [this documentation](https://gohugo.io/getting-started/quick-start/#step-3-add-a-theme)
|
||||
Install the Relearn theme by following [this documentation](https://gohugo.io/getting-started/quick-start/#step-3-add-a-theme)
|
||||
|
||||
This theme's repository is: https://github.com/McShelby/hugo-theme-relearn.git
|
||||
|
||||
|
@ -48,9 +48,9 @@ Discover what this Hugo theme is all about and the core concepts behind it.
|
|||
|
||||
renders as
|
||||
|
||||
![A Chapter](images/chapter.png?classes=shadow&width=60pc)
|
||||
![A Chapter](/basics/installation/images/chapter.png?classes=shadow&width=60pc)
|
||||
|
||||
**Hugo-theme-relearn** provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
|
||||
The Relearn theme provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
|
||||
|
||||
```shell
|
||||
hugo new --kind chapter basics/_index.md
|
||||
|
@ -98,5 +98,5 @@ hugo
|
|||
A `public` folder will be generated, containing all static content and assets for your website. It can now be deployed on any web server.
|
||||
|
||||
{{% notice note %}}
|
||||
This website can be automatically published and hosted with [Netlify](https://www.netlify.com/) (Read more about [Automated HUGO deployments with Netlify](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)). Alternatively, you can use [Github pages](https://gohugo.io/hosting-and-deployment/hosting-on-github/)
|
||||
This website can be automatically published and hosted with [Netlify](https://www.netlify.com/) (Read more about [Automated HUGO deployments with Netlify](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)). Alternatively, you can use [GitHub pages](https://gohugo.io/hosting-and-deployment/hosting-on-github/)
|
||||
{{% /notice %}}
|
||||
|
|
5
exampleSite/content/basics/migration/_index.en-pir.md
Normal file
5
exampleSite/content/basics/migration/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Migrrrat'n"
|
||||
weight = 17
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -3,9 +3,9 @@ title = "Migration"
|
|||
weight = 17
|
||||
+++
|
||||
|
||||
If you are upgrading from a previous version of the theme or even from the hugo-theme-learn, you may have to change a few things in your own installation.
|
||||
If you are upgrading from a previous version of the theme or even from the Learn theme, you may have to change a few things in your own installation.
|
||||
|
||||
For a detailed list of changes, the [history page]({{%relref "basics/history" %}}).
|
||||
For a detailed list of changes, see the [history page]({{%relref "basics/history" %}}).
|
||||
|
||||
## From this theme
|
||||
|
||||
|
|
6
exampleSite/content/basics/requirements/_index.en-pir.md
Normal file
6
exampleSite/content/basics/requirements/_index.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
disableToc = true
|
||||
title = "Requirrrements"
|
||||
weight = 10
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -8,4 +8,4 @@ Thanks to the simplicity of Hugo, this page is as empty as this theme needs requ
|
|||
|
||||
Just download latest version of [Hugo binary (> 0.25)](https://gohugo.io/getting-started/installing/) for your OS (Windows, Linux, Mac) : it's that simple.
|
||||
|
||||
![Magic](images/magic.gif?classes=shadow)
|
||||
![Magic](/basics/requirements/images/magic.gif?classes=shadow)
|
||||
|
|
6
exampleSite/content/cont/_index.en-pir.md
Normal file
6
exampleSite/content/cont/_index.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
chapter = true
|
||||
title = "Rambl'n"
|
||||
weight = 2
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/cont/archetypes.en-pir.md
Normal file
5
exampleSite/content/cont/archetypes.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Arrrchetypes"
|
||||
weight = 10
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/cont/i18n/_index.en-pir.md
Normal file
5
exampleSite/content/cont/i18n/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Multilingual an' i18n"
|
||||
weight = 30
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -3,27 +3,25 @@ title = "Multilingual and i18n"
|
|||
weight = 30
|
||||
+++
|
||||
|
||||
**Relearn theme** is fully compatible with Hugo multilingual mode.
|
||||
The Relearn theme is fully compatible with Hugo multilingual mode.
|
||||
|
||||
It provides:
|
||||
|
||||
- Translation strings for default values (English and French). Feel free to contribute!
|
||||
- Translation strings for default values (English, Arabic, Dutch, Piratized English, German, Hindi, Indonesian, Japanese, Piratized English, Portuguese, Russian, Simplified Chinese, Spanish, Turkish). Feel free to contribute!
|
||||
- Automatic menu generation from multilingual content
|
||||
- In-browser language switching
|
||||
|
||||
![I18n menu](images/i18n-menu.gif)
|
||||
![I18n menu](/cont/i18n/images/i18n-menu.gif)
|
||||
|
||||
## Basic configuration
|
||||
|
||||
After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your `config.toml` file.
|
||||
|
||||
For example with current French and English website.
|
||||
For example with current English and Piratized English website.
|
||||
|
||||
```toml
|
||||
# English is the default language
|
||||
defaultContentLanguage = "en"
|
||||
# Force to have /en/my-page and /fr/my-page routes, even for default language.
|
||||
defaultContentLanguageInSubdir= true
|
||||
|
||||
[Languages]
|
||||
[Languages.en]
|
||||
|
@ -31,20 +29,20 @@ title = "Documentation for Hugo Relearn Theme"
|
|||
weight = 1
|
||||
languageName = "English"
|
||||
|
||||
[Languages.fr]
|
||||
title = "Documentation du thème Hugo Relearn"
|
||||
[Languages.en-pir]
|
||||
title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
|
||||
weight = 2
|
||||
languageName = "Français"
|
||||
languageName = "Arrr! Pirrrates"
|
||||
```
|
||||
|
||||
Then, for each new page, append the *id* of the language to the file.
|
||||
|
||||
- Single file `my-page.md` is split in two files:
|
||||
- in English: `my-page.en.md`
|
||||
- in French: `my-page.fr.md`
|
||||
- in English: `my-page.md`
|
||||
- in Piratized English: `my-page.en-pir.md`
|
||||
- Single file `_index.md` is split in two files:
|
||||
- in English: `_index.en.md`
|
||||
- in French: `_index.fr.md`
|
||||
- in English: `_index.md`
|
||||
- in Piratized English: `_index.en-pir.md`
|
||||
|
||||
{{% notice info %}}
|
||||
Be aware that only translated pages are displayed in menu. It's not replaced with default language content.
|
||||
|
@ -56,12 +54,10 @@ Use [slug](https://gohugo.io/content-management/multilingual/#translate-your-con
|
|||
|
||||
## Overwrite translation strings
|
||||
|
||||
Translations strings are used for common default values used in the theme (*Edit this page* button, *Search placeholder* and so on). Translations are available in french and english but you may use another language or want to override default values.
|
||||
Translations strings are used for common default values used in the theme (*Edit this page* button, *Search placeholder* and so on). Translations are available in English and Piratized English but you may use another language or want to override default values.
|
||||
|
||||
To override these values, create a new file in your local i18n folder `i18n/<idlanguage>.toml` and inspire yourself from the theme `themes/hugo-theme-relearn/i18n/en.toml`
|
||||
|
||||
By the way, as these translations could be used by other people, please take the time to propose a translation by [making a PR](https://github.com/McShelby/hugo-theme-relearn/pulls) to the theme!
|
||||
|
||||
## Disable language switching
|
||||
|
||||
Switching the language in the browser is a great feature, but for some reasons you may want to disable it.
|
||||
|
@ -73,5 +69,3 @@ Just set `disableLanguageSwitchingButton=true` in your `config.toml`
|
|||
# When using mulitlingual website, disable the switch language button.
|
||||
disableLanguageSwitchingButton = true
|
||||
```
|
||||
|
||||
![I18n menu](images/i18n-menu.gif)
|
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 40 KiB |
5
exampleSite/content/cont/icons.en-pir.md
Normal file
5
exampleSite/content/cont/icons.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Ay'cons an' logos"
|
||||
weight = 27
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -9,7 +9,7 @@ The Relearn theme for Hugo loads the [**Font Awesome**](https://fontawesome.com)
|
|||
|
||||
Browse through the available icons in the [Font Awesome Gallery](https://fontawesome.com/icons?d=gallery&m=free). Notice that the **free** filter is enabled, as only the free icons are available by default.
|
||||
|
||||
Once on the Font Awesome page for a specific icon, for example the page for the [heart](https://fontawesome.com/icons/heart?style=solid), copy the HTML reference and paste into the markdown content.
|
||||
Once on the Font Awesome page for a specific icon, for example the page for the [heart](https://fontawesome.com/icons/heart?style=solid), copy the HTML reference and paste into the Markdown content.
|
||||
|
||||
The HTML to include the heart icon is:
|
||||
|
||||
|
|
5
exampleSite/content/cont/markdown.en-pir.md
Normal file
5
exampleSite/content/cont/markdown.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Marrrkdown rules"
|
||||
weight = 15
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -10,7 +10,7 @@ Let's face it: Writing content for the Web is tiresome. WYSIWYG editors help all
|
|||
Some of the key benefits are:
|
||||
|
||||
1. Markdown is simple to learn, with minimal extra characters so it's also quicker to write content.
|
||||
2. Less chance of errors when writing in markdown.
|
||||
2. Less chance of errors when writing in Markdown.
|
||||
3. Produces valid XHTML output.
|
||||
4. Keeps the content and the visual display separate, so you cannot mess up the look of your site.
|
||||
5. Write in any text editor or Markdown application you like.
|
||||
|
@ -84,7 +84,7 @@ This is a comment
|
|||
|
||||
## Horizontal Rules
|
||||
|
||||
The HTML `<hr>` element is for creating a "thematic break" between paragraph-level elements. In markdown, you can create a `<hr>` with `---` - three consecutive dashes
|
||||
The HTML `<hr>` element is for creating a "thematic break" between paragraph-level elements. In Markdown, you can create a `<hr>` with `---` - three consecutive dashes
|
||||
|
||||
renders to:
|
||||
|
||||
|
@ -420,7 +420,7 @@ HTML:
|
|||
|
||||
GFM, or "GitHub Flavored Markdown" also supports syntax highlighting. To activate it, usually you simply add the file extension of the language you want to use directly after the first code "fence", ` ```js `, and syntax highlighting will automatically be applied in the rendered HTML.
|
||||
|
||||
See [Code Highlighting]({{% relref "syntaxhighlight.md" %}}) for additional documentation.
|
||||
See [Code Highlighting]({{% relref "syntaxhighlight" %}}) for additional documentation.
|
||||
|
||||
For example, to apply syntax highlighting to JavaScript code:
|
||||
|
||||
|
@ -635,7 +635,7 @@ With a reference later in the document defining the URL location:
|
|||
|
||||
### Further image formatting
|
||||
|
||||
The Hugo markdown parser supports additional non-standard functionality.
|
||||
The Hugo Markdown parser supports additional non-standard functionality.
|
||||
|
||||
#### Resizing image
|
||||
|
||||
|
|
5
exampleSite/content/cont/menushortcuts.en-pir.md
Normal file
5
exampleSite/content/cont/menushortcuts.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Menu extrrra shorrrtcuts"
|
||||
weight = 25
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -13,7 +13,7 @@ Example from the current website:
|
|||
|
||||
````toml
|
||||
[[menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
name = "<i class='fab fa-github'></i> GitHub repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
@ -61,7 +61,7 @@ weight = 1
|
|||
languageName = "English"
|
||||
|
||||
[[Languages.en.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Github repo"
|
||||
name = "<i class='fab fa-github'></i> GitHub repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
@ -82,30 +82,30 @@ name = "<i class='fas fa-bullhorn'></i> Credits"
|
|||
url = "/credits"
|
||||
weight = 30
|
||||
|
||||
[Languages.fr]
|
||||
title = "Documentation du thème Hugo Relearn"
|
||||
[Languages.en-pir]
|
||||
title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
|
||||
weight = 2
|
||||
languageName = "Français"
|
||||
languageName = "Arrr! Pirrrates"
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> Repo Github"
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fab fa-github'></i> GitHub repo"
|
||||
identifier = "ds"
|
||||
url = "https://github.com/McShelby/hugo-theme-relearn"
|
||||
weight = 10
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Vitrine"
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-camera'></i> Showcases"
|
||||
url = "/showcase"
|
||||
weight = 11
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Documentation Hugo"
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bookmark'></i> Cap'n Hugo Documentat'n"
|
||||
identifier = "hugodoc"
|
||||
url = "https://gohugo.io/"
|
||||
weight = 20
|
||||
|
||||
[[Languages.fr.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Crédits"
|
||||
[[Languages.en-pir.menu.shortcuts]]
|
||||
name = "<i class='fas fa-bullhorn'></i> Crrredits"
|
||||
url = "/credits"
|
||||
weight = 30
|
||||
````
|
||||
|
|
5
exampleSite/content/cont/pages/_index.en-pir.md
Normal file
5
exampleSite/content/cont/pages/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Planks orrrganizat'n"
|
||||
weight = 5
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -41,12 +41,12 @@ content
|
|||
|
||||
## Types
|
||||
|
||||
**Hugo-theme-relearn** defines two types of pages. *Default* and *Chapter*. Both can be used at any level of the documentation, the only difference being layout display.
|
||||
The Relearn theme defines two types of pages. *Default* and *Chapter*. Both can be used at any level of the documentation, the only difference being layout display.
|
||||
|
||||
A **Chapter** displays a page meant to be used as introduction for a set of child pages. Commonly, it contains a simple title and a catch line to define content that can be found under it.
|
||||
You can define any HTML as prefix for the menu. In the example below, it's just a number but that could be an [icon](https://fortawesome.github.io/Font-Awesome/).
|
||||
|
||||
![Chapter page](images/pages-chapter.png?width=50pc)
|
||||
![Chapter page](/cont/pages/images/pages-chapter.png?width=50pc)
|
||||
|
||||
```markdown
|
||||
+++
|
||||
|
@ -63,11 +63,11 @@ weight = 5
|
|||
Discover what this Hugo theme is all about and the core-concepts behind it.
|
||||
```
|
||||
|
||||
To tell **Hugo-theme-relearn** to consider a page as a chapter, set `chapter=true` in the Front Matter of the page.
|
||||
To tell the Relearn theme to consider a page as a chapter, set `chapter=true` in the Front Matter of the page.
|
||||
|
||||
A **Default** page is any other content page.
|
||||
|
||||
![Default page](images/pages-default.png?width=50pc)
|
||||
![Default page](/cont/pages/images/pages-default.png?width=50pc)
|
||||
|
||||
```toml
|
||||
+++
|
||||
|
@ -86,13 +86,13 @@ Hugo provides a `new` command to create a new website.
|
|||
hugo new site <new_project>
|
||||
```
|
||||
|
||||
**Hugo-theme-relearn** provides [archetypes]({{%relref "cont/archetypes.en.md" %}}) to help you create this kind of pages.
|
||||
The Relearn theme provides [archetypes]({{%relref "cont/archetypes" %}}) to help you create this kind of pages.
|
||||
|
||||
## Front Matter configuration
|
||||
|
||||
Each Hugo page has to define a [Front Matter](https://gohugo.io/content/front-matter/) in *toml*, *yaml* or *json*. This site will use *toml* in all cases.
|
||||
|
||||
**Hugo-theme-relearn** uses the following parameters on top of Hugo ones :
|
||||
The Relearn theme uses the following parameters on top of Hugo ones :
|
||||
|
||||
```toml
|
||||
+++
|
||||
|
@ -120,7 +120,7 @@ LastModifierEmail = ""
|
|||
|
||||
### Add icon to a menu entry
|
||||
|
||||
In the page frontmatter, add a `pre` param to insert any HTML code before the menu label. The example below uses the Github icon.
|
||||
In the page frontmatter, add a `pre` param to insert any HTML code before the menu label. The example below uses the GitHub icon.
|
||||
|
||||
```toml
|
||||
+++
|
||||
|
@ -129,7 +129,7 @@ pre = "<i class='fab fa-github'></i> "
|
|||
+++
|
||||
```
|
||||
|
||||
![Title with icon](images/frontmatter-icon.png)
|
||||
![Title with icon](/cont/pages/images/frontmatter-icon.png)
|
||||
|
||||
### Ordering sibling menu/page entries
|
||||
|
||||
|
@ -146,7 +146,7 @@ weight = 5
|
|||
|
||||
### Using a custom title for menu entries
|
||||
|
||||
By default, **Hugo-theme-relearn** will use a page's `title` attribute for the menu item (or `linkTitle` if defined).
|
||||
By default, the Relearn theme will use a page's `title` attribute for the menu item (or `linkTitle` if defined).
|
||||
|
||||
But a page's title has to be descriptive on its own while the menu is a hierarchy.
|
||||
We've added the `menuTitle` parameter for that purpose:
|
||||
|
@ -174,9 +174,10 @@ The theme generates the menu based on the following rules:
|
|||
- all remaining entries are not shown
|
||||
|
||||
You can see this feature in action on the example page for [children shortcode]({{< relref "shortcodes/children" >}}) and its children pages.
|
||||
## Homepage
|
||||
|
||||
To configure your home page, you basically have three choices:
|
||||
## Your Page
|
||||
|
||||
To configure your page, you basically have three choices:
|
||||
|
||||
1. Create an `_index.md` document in `content` folder and fill the file with *Markdown content*
|
||||
2. Create an `index.html` file in the `static` folder and fill the file with *HTML content*
|
||||
|
|
5
exampleSite/content/cont/syntaxhighlight.en-pir.md
Normal file
5
exampleSite/content/cont/syntaxhighlight.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Code highlight'n"
|
||||
weight = 16
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -3,7 +3,7 @@ title = "Code highlighting"
|
|||
weight = 16
|
||||
+++
|
||||
|
||||
Relearn theme uses [Hugo's built-in syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/) for code.
|
||||
The Relearn theme uses [Hugo's built-in syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/) for code.
|
||||
|
||||
## Markdown syntax
|
||||
|
||||
|
|
6
exampleSite/content/cont/tags.en-pir.md
Normal file
6
exampleSite/content/cont/tags.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
tags = ["documentat'n", "tutorrrial"]
|
||||
title = "Tags"
|
||||
weight = 40
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -4,7 +4,7 @@ title = "Tags"
|
|||
weight = 40
|
||||
+++
|
||||
|
||||
*Relearn theme* supports one default taxonomy of Hugo: the *tag* feature.
|
||||
The Relearn theme supports one default taxonomy of Hugo: the *tag* feature.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
|
5
exampleSite/content/credits.en-pir.md
Normal file
5
exampleSite/content/credits.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
disableToc = true
|
||||
title = "Crrredits"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -7,14 +7,14 @@ title = "Credits"
|
|||
|
||||
Special thanks to [everyone who has contributed](https://github.com/McShelby/hugo-theme-relearn/graphs/contributors) to this project.
|
||||
|
||||
Many thanks to [@matcornic](https://github.com/matcornic) for his work on [hugo-theme-learn](https://github.com/matcornic/hugo-theme-learn).
|
||||
Many thanks to [@matcornic](https://github.com/matcornic) for his work on the [Learn theme](https://github.com/matcornic/hugo-theme-learn).
|
||||
|
||||
## Packages and libraries
|
||||
|
||||
* [mermaid](https://mermaid-js.github.io/mermaid) - generation of diagram and flowchart from text in a similar manner as markdown
|
||||
* [Mermaid](https://mermaid-js.github.io/mermaid) - generation of diagram and flowchart from text in a similar manner as Markdown
|
||||
* [font awesome](http://fontawesome.io/) - the iconic font and CSS framework
|
||||
* [jQuery](https://jquery.com) - The Write Less, Do More, JavaScript Library
|
||||
* [jquery-svg-zoom-pan](https://github.com/DanielHoffmann/jquery-svg-pan-zoom) - enable pan and zoom in mermaid graphs
|
||||
* [jquery-svg-zoom-pan](https://github.com/DanielHoffmann/jquery-svg-pan-zoom) - enable pan and zoom in Mermaid graphs
|
||||
* [lunr](https://lunrjs.com) - Lunr enables you to provide a great search experience without the need for external, server-side, search services...
|
||||
* [clipboard.js](https://zenorocha.github.io/clipboard.js) - copy text to clipboard
|
||||
* [modernizr](https://modernizr.com) - A JavaScript toolkit that allows web developers to use new CSS3 and HTML5 features while maintaining a fine level of control over browsers that don't support
|
||||
|
|
6
exampleSite/content/shortcodes/_index.en-pir.md
Normal file
6
exampleSite/content/shortcodes/_index.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
chapter = true
|
||||
title = "Shorrrtcodes"
|
||||
weight = 3
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -14,6 +14,6 @@ But this happens to be a bad idea. Everyone uses Markdown because it's pure and
|
|||
|
||||
To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page.
|
||||
|
||||
**Hugo-theme-relearn** provides multiple shortcodes on top of existing ones.
|
||||
The Relearn theme provides multiple shortcodes on top of existing ones.
|
||||
|
||||
{{%children containerstyle="div" style="h2" description="true" %}}
|
||||
|
|
5
exampleSite/content/shortcodes/attachments.en-pir.md
Normal file
5
exampleSite/content/shortcodes/attachments.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Th' Attachments shorrrtcode displays a list o' files attached t' a plank"
|
||||
title = "Attachments"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
description = "The Attachments shortcode displays a list of files attached to a page."
|
||||
description = "The Attachments shortcode displays a list of files attached to a page"
|
||||
title = "Attachments"
|
||||
+++
|
||||
|
||||
|
@ -12,7 +12,7 @@ The Attachments shortcode displays a list of files attached to a page.
|
|||
The shortcurt lists files found in a **specific folder**.
|
||||
Currently, it support two implementations for pages
|
||||
|
||||
1. If your page is a markdown file, attachements must be placed in a **folder** named like your page and ending with **.files**.
|
||||
1. If your page is a Markdown file, attachements must be placed in a **folder** named like your page and ending with **.files**.
|
||||
|
||||
> * content
|
||||
> * _index.md
|
||||
|
|
5
exampleSite/content/shortcodes/button.en-pir.md
Normal file
5
exampleSite/content/shortcodes/button.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Nice buttons on yer plank"
|
||||
title = "Button"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
description = "Nice buttons on your page."
|
||||
description = "Nice buttons on your page"
|
||||
title = "Button"
|
||||
+++
|
||||
|
||||
|
|
6
exampleSite/content/shortcodes/children/_index.en-pir.md
Normal file
6
exampleSite/content/shortcodes/children/_index.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
descrption = "List th' child planks on a plank"
|
||||
title = "Children"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,7 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1"
|
||||
weight = 10
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,7 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1-1"
|
||||
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
descrption = "This be a hidden demo child plank"
|
||||
hidden = true
|
||||
title = "Plank 1-1-1 (hidden)"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a non-hidden demo child plank o' a hidden parrrent plank"
|
||||
title = "Plank 1-1-1-1"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
descrption = "This be a hidden demo child plank"
|
||||
hidden = true
|
||||
title = "Plank 1-1-1-1-1 (hidden)"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a non-hidden demo child plank on a hidden parrrent plank"
|
||||
title = "Plank 1-1-1-1-1-1"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1-1-2"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1-1-2-1"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1-1-2-2"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 1-1-3"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
title = "Plank 2"
|
||||
weight = 20
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,7 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
descrption = "This be a demo child plank"
|
||||
title = "Plank 3"
|
||||
weight = 30
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "This be a plain plank test nested 'n a parrrent"
|
||||
title = "Plank 3-1"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -0,0 +1,8 @@
|
|||
+++
|
||||
alwaysopen = false
|
||||
descrption = "This be a hidden demo child plank"
|
||||
hidden = true
|
||||
title = "Plank 4 (hidden)"
|
||||
weight = 40
|
||||
+++
|
||||
{{< piratify >}}
|
6
exampleSite/content/shortcodes/children/test.en-pir.md
Normal file
6
exampleSite/content/shortcodes/children/test.en-pir.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
descrption = "This be a plain plank test"
|
||||
title = "Plank X"
|
||||
weight = 1
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/shortcodes/expand.en-pir.md
Normal file
5
exampleSite/content/shortcodes/expand.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Displays an expand'ble/collaps'ble sect'n o' text on yer plank"
|
||||
title = "Expand"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -8,7 +8,7 @@ The Expand shortcode displays an expandable/collapsible section of text on your
|
|||
## Usage
|
||||
|
||||
````go
|
||||
{{%/* expand "Does this relearn theme rock?" { "true" | "false" } */%}}
|
||||
{{%/* expand "Does this Relearn theme rock?" { "true" | "false" } */%}}
|
||||
Yes!
|
||||
{{%/* /expand */%}}
|
||||
````
|
||||
|
|
5
exampleSite/content/shortcodes/include.en-pir.md
Normal file
5
exampleSite/content/shortcodes/include.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Displays content from other Marrrkdown files"
|
||||
title = "Include"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,9 +1,9 @@
|
|||
+++
|
||||
description = "Displays content from other markdown files"
|
||||
description = "Displays content from other Markdown files"
|
||||
title = "Include"
|
||||
+++
|
||||
|
||||
The include shortcode includes other files from your project inside of the current file. This can even contain markdown and will be taken into account when generating the table of contents.
|
||||
The include shortcode includes other files from your project inside of the current file. This can even contain Markdown and will be taken into account when generating the table of contents.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
5
exampleSite/content/shortcodes/mermaid.en-pir.md
Normal file
5
exampleSite/content/shortcodes/mermaid.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Generrrat'n o' diagrrram an' flowcharrrt frrrom text 'n a similar manner as Marrrkdown"
|
||||
title = "Merrrmaid"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
description = "Generation of diagram and flowchart from text in a similar manner as markdown"
|
||||
description = "Generation of diagram and flowchart from text in a similar manner as Markdown"
|
||||
title = "Mermaid"
|
||||
+++
|
||||
|
||||
|
@ -7,7 +7,7 @@ title = "Mermaid"
|
|||
|
||||
## Usage
|
||||
|
||||
Just insert your mermaid code in the `mermaid` shortcode like this:
|
||||
Just insert your Mermaid code in the `mermaid` shortcode like this:
|
||||
|
||||
````go
|
||||
{{</* mermaid [ align=(left|right|center|justify) ] */>}}
|
||||
|
@ -92,7 +92,7 @@ sequenceDiagram
|
|||
{{< mermaid >}}
|
||||
gantt
|
||||
dateFormat YYYY-MM-DD
|
||||
title Adding GANTT diagram functionality to mermaid
|
||||
title Adding GANTT diagram functionality to Mermaid
|
||||
section A section
|
||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
||||
Active task :active, des2, 2014-01-09, 3d
|
||||
|
@ -104,7 +104,7 @@ gantt
|
|||
Create tests for parser :crit, active, 3d
|
||||
Future task in critical line :crit, 5d
|
||||
Create tests for renderer :2d
|
||||
Add to mermaid :1d
|
||||
Add to Mermaid :1d
|
||||
{{< /mermaid >}}
|
||||
|
||||
{{% expand "Show markup" "true" %}}
|
||||
|
@ -112,7 +112,7 @@ gantt
|
|||
{{</* mermaid */>}}
|
||||
gantt
|
||||
dateFormat YYYY-MM-DD
|
||||
title Adding GANTT diagram functionality to mermaid
|
||||
title Adding GANTT diagram functionality to Mermaid
|
||||
section A section
|
||||
Completed task :done, des1, 2014-01-06,2014-01-08
|
||||
Active task :active, des2, 2014-01-09, 3d
|
||||
|
@ -124,7 +124,7 @@ gantt
|
|||
Create tests for parser :crit, active, 3d
|
||||
Future task in critical line :crit, 5d
|
||||
Create tests for renderer :2d
|
||||
Add to mermaid :1d
|
||||
Add to Mermaid :1d
|
||||
{{</* /mermaid */>}}
|
||||
````
|
||||
{{% /expand %}}
|
||||
|
@ -199,11 +199,11 @@ stateDiagram-v2
|
|||
|
||||
## Configuration
|
||||
|
||||
Mermaid is configured with default settings. You can customize mermaids default settings for all of your files thru a JSON object in your `config.toml` or override these settings sidewise thru your pages frontmatter.
|
||||
Mermaid is configured with default settings. You can customize Mermaid's default settings for all of your files thru a JSON object in your `config.toml` or override these settings sidewise thru your pages frontmatter.
|
||||
|
||||
This JSON object is forwarded into mermaids `mermaid.initialize()` function.
|
||||
This JSON object is forwarded into Mermaid's `mermaid.initialize()` function.
|
||||
|
||||
See [mermaid documentation](http://mermaid-js.github.io/mermaid/getting-started/Setup.html#mermaidapi-configuration-defaults) for all allowed settings.
|
||||
See [Mermaid documentation](http://mermaid-js.github.io/mermaid/getting-started/Setup.html#mermaidapi-configuration-defaults) for all allowed settings.
|
||||
|
||||
### Example
|
||||
|
||||
|
|
5
exampleSite/content/shortcodes/notice.en-pir.md
Normal file
5
exampleSite/content/shortcodes/notice.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Disclaimerrrs t' help ye strrructurrre yer plank"
|
||||
title = "Notice"
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/shortcodes/siteparam.en-pir.md
Normal file
5
exampleSite/content/shortcodes/siteparam.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Get value o' ship parrrams varrriables 'n yer plank"
|
||||
title = "Ship param"
|
||||
+++
|
||||
{{< piratify >}}
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
description = "Get value of site params variables in your page."
|
||||
description = "Get value of site params variables in your page"
|
||||
title = "Site param"
|
||||
+++
|
||||
|
||||
|
|
5
exampleSite/content/shortcodes/tabs.en-pir.md
Normal file
5
exampleSite/content/shortcodes/tabs.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
descrption = "Synchr'nize select'n o' content 'n different tabbed views"
|
||||
title = "Tabbed views"
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/showcase.en-pir.md
Normal file
5
exampleSite/content/showcase.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
disableToc = true
|
||||
title = "Showcase"
|
||||
+++
|
||||
{{< piratify >}}
|
7
exampleSite/content/yours/_index.en-pir.md
Normal file
7
exampleSite/content/yours/_index.en-pir.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
+++
|
||||
chapter = true
|
||||
hidden = true
|
||||
title = "This could be yers"
|
||||
weight = 4
|
||||
+++
|
||||
{{< piratify >}}
|
5
exampleSite/content/yours/children-1/_index.en-pir.md
Normal file
5
exampleSite/content/yours/children-1/_index.en-pir.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
hidden = true
|
||||
title = "Th' one an' only hidden child"
|
||||
+++
|
||||
{{< piratify >}}
|
101
exampleSite/layouts/shortcodes/piratify.html
Normal file
101
exampleSite/layouts/shortcodes/piratify.html
Normal file
|
@ -0,0 +1,101 @@
|
|||
{{ $langsrc := .Get 1 | default "en" }}
|
||||
{{ $langtrg := .Page.Language.Lang }}
|
||||
{{ $words := dict
|
||||
"Hugo" "Cap'n Hugo"
|
||||
"Info" "Ahoi"
|
||||
"Note" "Avast"
|
||||
"Tip" "Smarrrt Arrrse"
|
||||
"Warning" "Arrr"
|
||||
"good" "bloody"
|
||||
"shortcode" "shorrrtcode"
|
||||
"Shortcode" "Shorrrtcode"
|
||||
"shortcodes" "shorrrtcodes"
|
||||
"Shortcodes" "Shorrrtcodes"
|
||||
"Mermaid" "Merrrmaid"
|
||||
"Markdown" "Marrrkdown"
|
||||
"Markup" "Marrrkup"
|
||||
"markup" "marrrkup"
|
||||
"for" "fer"
|
||||
"Your" "Yer"
|
||||
"your" "yer"
|
||||
"You" "Ye"
|
||||
"you" "ye"
|
||||
"the" "th'"
|
||||
"The" "Th'"
|
||||
"is" "be"
|
||||
"Is" "Be"
|
||||
"are" "be"
|
||||
"Are" "Be"
|
||||
"Of" "O'"
|
||||
"of" "o'"
|
||||
"To" "T'"
|
||||
"to" "t'"
|
||||
"in" "'n"
|
||||
"With" "Wit'"
|
||||
"with" "wit'"
|
||||
"Where" "Whar'"
|
||||
"where" "whar'"
|
||||
"After" "Aft"
|
||||
"after" "aft"
|
||||
"And" "An'"
|
||||
"and" "an'"
|
||||
"Load" "Board"
|
||||
"load" "board"
|
||||
"Loaded" "Boarded"
|
||||
"loaded" "boarded"
|
||||
"Content" "Rambling"
|
||||
"content" "rambling"
|
||||
"icon" "ay'con"
|
||||
"Icon" "Ay'con"
|
||||
"icons" "ay'cons"
|
||||
"Icons" "Ay'cons"
|
||||
"syntax" "rules"
|
||||
"Syntax" "Rules"
|
||||
"Site" "Ship"
|
||||
"site" "ship"
|
||||
"Page" "Plank"
|
||||
"page" "plank"
|
||||
"Pages" "Planks"
|
||||
"pages" "planks"
|
||||
"Relearn" "Relearrrn"
|
||||
"Learn" "Learrrn"
|
||||
}}
|
||||
|
||||
{{ $specials := dict
|
||||
"(\\w)ing([\\s\\n<.,;?!:])" "'n"
|
||||
"(\\w)ings([\\s\\n<.,;?!:])" "'ns"
|
||||
"(\\w)tion([\\s\\n<.,;?!:])" "t'n"
|
||||
"(\\w)tions([\\s\\n<.,;?!:])" "t'ns"
|
||||
"(\\w)(?:[aeiou])ble([\\s\\n<.,;?!:])" "'ble"
|
||||
"(\\w)(?:[aeiou])mize([\\s\\n<.,;?!:])" "'mize"
|
||||
"(\\w)(?:[aeiou])mizes([\\s\\n<.,;?!:])" "'mizes"
|
||||
"(\\w)(?:[aeiou])nize([\\s\\n<.,;?!:])" "'nize"
|
||||
"(\\w)(?:[aeiou])nizes([\\s\\n<.,;?!:])" "'nizes"
|
||||
"(.)=\"/([^\".]*?\")" (printf "=\"/%s/" $langtrg)
|
||||
}}
|
||||
|
||||
{{ $fix := dict
|
||||
"warn'n" "warning"
|
||||
"sect'n" "section"
|
||||
"n Cap'n" "n"
|
||||
"Documentat'n fer Cap'n Hugo Relearrrn Theme" "Documentation for Hugo Relearn Theme"
|
||||
"Avast right o' John" "Note right of John"
|
||||
}}
|
||||
|
||||
{{ $c := "" }}
|
||||
{{ range .Page.Translations }}
|
||||
{{ if eq .Language.Lang $langsrc }}
|
||||
{{/* $file | readFile | safeHTML */}}
|
||||
{{ $c = .Content }}
|
||||
{{ range $from, $to := $words }}
|
||||
{{ $c = replaceRE (printf "([\\s\\n>])%s([\\s\\n<.,;?!:])" $from) (printf "${1}%s${2}" $to) $c }}
|
||||
{{ end }}
|
||||
{{ range $from, $to := $specials }}
|
||||
{{ $c = replaceRE $from (printf "${1}%s${2}" $to) $c }}
|
||||
{{ end }}
|
||||
{{ range $from, $to := $fix }}
|
||||
{{ $c = replace $c $from $to }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $c | safeHTML }}
|
47
i18n/en-pir.toml
Normal file
47
i18n/en-pir.toml
Normal file
|
@ -0,0 +1,47 @@
|
|||
[Search-placeholder]
|
||||
other = "Searrrch..."
|
||||
|
||||
[Clear-History]
|
||||
other = "Clear Historrry"
|
||||
|
||||
[Attachments-label]
|
||||
other = "Attachments"
|
||||
|
||||
[title-404]
|
||||
other = "Errror"
|
||||
|
||||
[message-404]
|
||||
other = "Woops. Looks like this plank doesn't exist ¯\\_(ツ)_/¯."
|
||||
|
||||
[Go-to-homepage]
|
||||
other = "Go t' homeplank"
|
||||
|
||||
[Edit-this-page]
|
||||
other = "Edit this plank"
|
||||
|
||||
[Shortcuts-Title]
|
||||
other = "Morrre"
|
||||
|
||||
[Expand-title]
|
||||
other = "Expand me..."
|
||||
|
||||
[Byte-symbol]
|
||||
other = "B"
|
||||
|
||||
[Kilobyte-symbol]
|
||||
other = "KB"
|
||||
|
||||
[Megabyte-symbol]
|
||||
other = "MB"
|
||||
|
||||
[note]
|
||||
other = "Avast"
|
||||
|
||||
[info]
|
||||
other = "Ahoi"
|
||||
|
||||
[tip]
|
||||
other = "Smarrrt arrrse"
|
||||
|
||||
[warning]
|
||||
other = "Arrr"
|
|
@ -8,7 +8,7 @@
|
|||
{{else}}
|
||||
<h1>Customize your own home page</h1>
|
||||
<p>
|
||||
The site is working. Don't forget to customize this homepage with your own. You typically have 3 choices :
|
||||
The site is working. Don't forget to customize this page with your own. You typically have 3 choices :
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>1. </b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li>
|
||||
|
|
Loading…
Reference in a new issue