docs: showcase multilang feature #87

Arrr, Pirrrate trrranslat'n
This commit is contained in:
Sören Weber 2021-09-11 15:46:14 +02:00
parent 5818228df3
commit 5574ec073e
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
73 changed files with 535 additions and 114 deletions

View file

@ -6,7 +6,7 @@ A theme for [Hugo](https://gohugo.io/) designed for documentation.
## Motivation ## 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 ## 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. 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).

View file

@ -1,12 +1,11 @@
baseURL = "https://example.com" baseURL = "https://example.com"
languageCode = "en-US" languageCode = "en"
defaultContentLanguage = "en" defaultContentLanguage = "en"
title = "Hugo Relearn Documentation" title = "Hugo Relearn Documentation"
theme = "hugo-theme-relearn" theme = "hugo-theme-relearn"
themesdir = "../.." themesdir = "../.."
metaDataFormat = "yaml" metaDataFormat = "yaml"
defaultContentLanguageInSubdir = true
relativeURLs = true relativeURLs = true
[params] [params]
@ -41,7 +40,7 @@ relativeURLs = true
title = "Documentation for Hugo Relearn Theme" title = "Documentation for Hugo Relearn Theme"
weight = 1 weight = 1
languageName = "English" languageName = "English"
landingPageURL = "/" landingPageURL = "/en"
landingPageName = "<i class='fas fa-home'></i> Home" landingPageName = "<i class='fas fa-home'></i> Home"
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
@ -65,3 +64,32 @@ relativeURLs = true
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits" name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "/credits" url = "/credits"
weight = 30 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

View file

@ -0,0 +1,4 @@
+++
title = "Relearrrn Theme fer Cap'n Hugo"
+++
{{< piratify >}}

View file

@ -4,28 +4,28 @@ title = "Relearn Theme for Hugo"
# Hugo Relearn Theme # 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 %}} {{% 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 %}} {{% /notice %}}
## Main features ## Main features
* [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}}) * [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}})
* [Multilingual mode]({{%relref "cont/i18n/_index.md" %}}) * [Multilingual mode]({{%relref "cont/i18n" %}})
* Unlimited menu levels * Unlimited menu levels
* Automatic next/prev buttons to navigate through menu entries * Automatic next/prev buttons to navigate through menu entries
* [Image resizing, shadow...]({{%relref "cont/markdown.en.md#images" %}}) * [Image resizing, shadow...]({{%relref "cont/markdown#images" %}})
* [Attachments files]({{%relref "shortcodes/attachments.en.md" %}}) * [Attachments files]({{%relref "shortcodes/attachments" %}})
* [List child pages]({{%relref "shortcodes/children/_index.md" %}}) * [List child pages]({{%relref "shortcodes/children" %}})
* [Mermaid diagram]({{%relref "shortcodes/mermaid.en.md" %}}) (flowchart, sequence, gantt) * [Mermaid diagram]({{%relref "shortcodes/mermaid" %}}) (flowchart, sequence, gantt)
* [Customizable look and feel and theme variants]({{%relref "basics/customization/_index.md"%}}) * [Customizable look and feel and theme variants]({{%relref "basics/customization"%}})
* [Buttons]({{%relref "shortcodes/button.en.md" %}}) * [Buttons]({{%relref "shortcodes/button" %}})
* [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice.en.md" %}}) * [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice" %}})
* [Expand]({{%relref "shortcodes/expand.en.md" %}}) * [Expand]({{%relref "shortcodes/expand" %}})
* [Tabs]({{%relref "shortcodes/tabs.en.md" %}}) * [Tabs]({{%relref "shortcodes/tabs" %}})
* [File inclusion]({{%relref "shortcodes/include.en.md" %}}) * [File inclusion]({{%relref "shortcodes/include" %}})
![Screenshot](https://github.com/McShelby/hugo-theme-relearn/raw/main/images/screenshot.png?width=40pc&classes=shadow) ![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 ## 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.

View file

@ -0,0 +1,6 @@
+++
chapter = true
title = "Basics"
weight = 1
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
title = "Configurrrat'n"
weight = 20
+++
{{< piratify >}}

View file

@ -5,7 +5,7 @@ weight = 20
## Global site parameters ## 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. 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 disableLanguageSwitchingButton = false
# Hide breadcrumbs in the header and only show the current page title # Hide breadcrumbs in the header and only show the current page title
disableBreadcrumb = true 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 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" 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\" }" mermaidInitialize = "{ \"theme\": \"default\" }"
# Hide Next and Previous page buttons normally displayed full height beside content # Hide Next and Previous page buttons normally displayed full height beside content
disableNextPrev = true disableNextPrev = true
@ -75,14 +75,14 @@ Relearn theme uses the last improvement available in hugo version 20+ to generat
## Mermaid ## 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: > Example:
> >
> Mermaid is globally disabled. By default it won't be loaded by any page. > 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 ## Home Button Configuration
@ -95,12 +95,12 @@ appearance, you will have to configure two parameters for the defined languages:
[Lanugages.en] [Lanugages.en]
... ...
landingPageURL = "/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" landingPageURL = "/en-pir"
landingPageName = "<i class='fas fa-home'></i> Accueil" 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: 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%)

View file

@ -0,0 +1,5 @@
+++
title = "Customizat'n"
weight = 25
+++
{{< piratify >}}

View file

@ -3,7 +3,7 @@ title = "Customization"
weight = 25 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. 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} ## 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 ### Standard variant
@ -55,7 +55,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
themeVariant = "" themeVariant = ""
``` ```
![Red variant](images/standard-variant.png?width=60pc) ![Red variant](/basics/customization/images/standard-variant.png?width=60pc)
### Red variant ### Red variant
@ -65,7 +65,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
themeVariant = "red" themeVariant = "red"
``` ```
![Red variant](images/red-variant.png?width=60pc) ![Red variant](/basics/customization/images/red-variant.png?width=60pc)
### Blue variant ### Blue variant
@ -75,7 +75,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
themeVariant = "blue" themeVariant = "blue"
``` ```
![Blue variant](images/blue-variant.png?width=60pc) ![Blue variant](/basics/customization/images/blue-variant.png?width=60pc)
### Green variant ### Green variant
@ -85,7 +85,7 @@ If you need to change this default behavior, create a new file in `layouts/parti
themeVariant = "green" themeVariant = "green"
``` ```
![Green variant](images/green-variant.png?width=60pc) ![Green variant](/basics/customization/images/green-variant.png?width=60pc)
### 'Mine variant ### 'Mine variant

View file

@ -0,0 +1,5 @@
+++
title = "Historrry"
weight = 30
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
title = "Installat'n"
weight = 15
+++
{{< piratify >}}

View file

@ -15,7 +15,7 @@ hugo new site <new_project>
## Install the theme ## 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 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 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 ```shell
hugo new --kind chapter basics/_index.md 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. 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 %}} {{% 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 %}} {{% /notice %}}

View file

@ -0,0 +1,5 @@
+++
title = "Migrrrat'n"
weight = 17
+++
{{< piratify >}}

View file

@ -3,9 +3,9 @@ title = "Migration"
weight = 17 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 ## From this theme

View file

@ -0,0 +1,6 @@
+++
disableToc = true
title = "Requirrrements"
weight = 10
+++
{{< piratify >}}

View file

@ -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. 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)

View file

@ -0,0 +1,6 @@
+++
chapter = true
title = "Rambl'n"
weight = 2
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
title = "Arrrchetypes"
weight = 10
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
title = "Multilingual an' i18n"
weight = 30
+++
{{< piratify >}}

View file

@ -3,27 +3,25 @@ title = "Multilingual and i18n"
weight = 30 weight = 30
+++ +++
**Relearn theme** is fully compatible with Hugo multilingual mode. The Relearn theme is fully compatible with Hugo multilingual mode.
It provides: 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 - Automatic menu generation from multilingual content
- In-browser language switching - In-browser language switching
![I18n menu](images/i18n-menu.gif) ![I18n menu](/cont/i18n/images/i18n-menu.gif)
## Basic configuration ## Basic configuration
After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your `config.toml` file. 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 ```toml
# English is the default language # English is the default language
defaultContentLanguage = "en" defaultContentLanguage = "en"
# Force to have /en/my-page and /fr/my-page routes, even for default language.
defaultContentLanguageInSubdir= true
[Languages] [Languages]
[Languages.en] [Languages.en]
@ -31,20 +29,20 @@ title = "Documentation for Hugo Relearn Theme"
weight = 1 weight = 1
languageName = "English" languageName = "English"
[Languages.fr] [Languages.en-pir]
title = "Documentation du thème Hugo Relearn" title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
weight = 2 weight = 2
languageName = "Français" languageName = "Arrr! Pirrrates"
``` ```
Then, for each new page, append the *id* of the language to the file. Then, for each new page, append the *id* of the language to the file.
- Single file `my-page.md` is split in two files: - Single file `my-page.md` is split in two files:
- in English: `my-page.en.md` - in English: `my-page.md`
- in French: `my-page.fr.md` - in Piratized English: `my-page.en-pir.md`
- Single file `_index.md` is split in two files: - Single file `_index.md` is split in two files:
- in English: `_index.en.md` - in English: `_index.md`
- in French: `_index.fr.md` - in Piratized English: `_index.en-pir.md`
{{% notice info %}} {{% notice info %}}
Be aware that only translated pages are displayed in menu. It's not replaced with default language content. 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 ## 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` 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 ## Disable language switching
Switching the language in the browser is a great feature, but for some reasons you may want to disable it. 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. # When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = true disableLanguageSwitchingButton = true
``` ```
![I18n menu](images/i18n-menu.gif)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -0,0 +1,5 @@
+++
title = "Ay'cons an' logos"
weight = 27
+++
{{< piratify >}}

View file

@ -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. 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: The HTML to include the heart icon is:

View file

@ -0,0 +1,5 @@
+++
title = "Marrrkdown rules"
weight = 15
+++
{{< piratify >}}

View file

@ -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: Some of the key benefits are:
1. Markdown is simple to learn, with minimal extra characters so it's also quicker to write content. 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. 3. Produces valid XHTML output.
4. Keeps the content and the visual display separate, so you cannot mess up the look of your site. 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. 5. Write in any text editor or Markdown application you like.
@ -84,7 +84,7 @@ This is a comment
## Horizontal Rules ## 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: 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. 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: 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 ### Further image formatting
The Hugo markdown parser supports additional non-standard functionality. The Hugo Markdown parser supports additional non-standard functionality.
#### Resizing image #### Resizing image

View file

@ -0,0 +1,5 @@
+++
title = "Menu extrrra shorrrtcuts"
weight = 25
+++
{{< piratify >}}

View file

@ -13,7 +13,7 @@ Example from the current website:
````toml ````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"
url = "https://github.com/McShelby/hugo-theme-relearn" url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10 weight = 10
@ -61,7 +61,7 @@ weight = 1
languageName = "English" languageName = "English"
[[Languages.en.menu.shortcuts]] [[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-github'></i> Github repo" name = "<i class='fab fa-github'></i> GitHub repo"
identifier = "ds" identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn" url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10 weight = 10
@ -82,30 +82,30 @@ name = "<i class='fas fa-bullhorn'></i> Credits"
url = "/credits" url = "/credits"
weight = 30 weight = 30
[Languages.fr] [Languages.en-pir]
title = "Documentation du thème Hugo Relearn" title = "Documentat'n fer Cap'n Hugo Relearrrn Theme"
weight = 2 weight = 2
languageName = "Français" languageName = "Arrr! Pirrrates"
[[Languages.fr.menu.shortcuts]] [[Languages.en-pir.menu.shortcuts]]
name = "<i class='fab fa-github'></i> Repo Github" name = "<i class='fab fa-github'></i> GitHub repo"
identifier = "ds" identifier = "ds"
url = "https://github.com/McShelby/hugo-theme-relearn" url = "https://github.com/McShelby/hugo-theme-relearn"
weight = 10 weight = 10
[[Languages.fr.menu.shortcuts]] [[Languages.en-pir.menu.shortcuts]]
name = "<i class='fas fa-camera'></i> Vitrine" name = "<i class='fas fa-camera'></i> Showcases"
url = "/showcase" url = "/showcase"
weight = 11 weight = 11
[[Languages.fr.menu.shortcuts]] [[Languages.en-pir.menu.shortcuts]]
name = "<i class='fas fa-bookmark'></i> Documentation Hugo" name = "<i class='fas fa-bookmark'></i> Cap'n Hugo Documentat'n"
identifier = "hugodoc" identifier = "hugodoc"
url = "https://gohugo.io/" url = "https://gohugo.io/"
weight = 20 weight = 20
[[Languages.fr.menu.shortcuts]] [[Languages.en-pir.menu.shortcuts]]
name = "<i class='fas fa-bullhorn'></i> Crédits" name = "<i class='fas fa-bullhorn'></i> Crrredits"
url = "/credits" url = "/credits"
weight = 30 weight = 30
```` ````

View file

@ -0,0 +1,5 @@
+++
title = "Planks orrrganizat'n"
weight = 5
+++
{{< piratify >}}

View file

@ -41,12 +41,12 @@ content
## Types ## 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. 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/). 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 ```markdown
+++ +++
@ -63,11 +63,11 @@ weight = 5
Discover what this Hugo theme is all about and the core-concepts behind it. 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. 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 ```toml
+++ +++
@ -86,13 +86,13 @@ Hugo provides a `new` command to create a new website.
hugo new site <new_project> 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 ## 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. 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 ```toml
+++ +++
@ -120,7 +120,7 @@ LastModifierEmail = ""
### Add icon to a menu entry ### 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 ```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 ### Ordering sibling menu/page entries
@ -146,7 +146,7 @@ weight = 5
### Using a custom title for menu entries ### 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. 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: 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 - 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. 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* 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* 2. Create an `index.html` file in the `static` folder and fill the file with *HTML content*

View file

@ -0,0 +1,5 @@
+++
title = "Code highlight'n"
weight = 16
+++
{{< piratify >}}

View file

@ -3,7 +3,7 @@ title = "Code highlighting"
weight = 16 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 ## Markdown syntax

View file

@ -0,0 +1,6 @@
+++
tags = ["documentat'n", "tutorrrial"]
title = "Tags"
weight = 40
+++
{{< piratify >}}

View file

@ -4,7 +4,7 @@ title = "Tags"
weight = 40 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 ## Configuration

View file

@ -0,0 +1,5 @@
+++
disableToc = true
title = "Crrredits"
+++
{{< piratify >}}

View file

@ -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. 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 ## 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 * [font awesome](http://fontawesome.io/) - the iconic font and CSS framework
* [jQuery](https://jquery.com) - The Write Less, Do More, JavaScript Library * [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... * [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 * [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 * [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

View file

@ -0,0 +1,6 @@
+++
chapter = true
title = "Shorrrtcodes"
weight = 3
+++
{{< piratify >}}

View file

@ -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. 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" %}} {{%children containerstyle="div" style="h2" description="true" %}}

View file

@ -0,0 +1,5 @@
+++
descrption = "Th' Attachments shorrrtcode displays a list o' files attached t' a plank"
title = "Attachments"
+++
{{< piratify >}}

View file

@ -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" 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**. The shortcurt lists files found in a **specific folder**.
Currently, it support two implementations for pages 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 > * content
> * _index.md > * _index.md

View file

@ -0,0 +1,5 @@
+++
descrption = "Nice buttons on yer plank"
title = "Button"
+++
{{< piratify >}}

View file

@ -1,5 +1,5 @@
+++ +++
description = "Nice buttons on your page." description = "Nice buttons on your page"
title = "Button" title = "Button"
+++ +++

View file

@ -0,0 +1,6 @@
+++
alwaysopen = false
descrption = "List th' child planks on a plank"
title = "Children"
+++
{{< piratify >}}

View file

@ -0,0 +1,7 @@
+++
alwaysopen = false
descrption = "This be a demo child plank"
title = "Plank 1"
weight = 10
+++
{{< piratify >}}

View file

@ -0,0 +1,7 @@
+++
alwaysopen = false
descrption = "This be a demo child plank"
title = "Plank 1-1"
+++
{{< piratify >}}

View file

@ -0,0 +1,6 @@
+++
descrption = "This be a hidden demo child plank"
hidden = true
title = "Plank 1-1-1 (hidden)"
+++
{{< piratify >}}

View file

@ -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 >}}

View file

@ -0,0 +1,6 @@
+++
descrption = "This be a hidden demo child plank"
hidden = true
title = "Plank 1-1-1-1-1 (hidden)"
+++
{{< piratify >}}

View file

@ -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 >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "This be a demo child plank"
title = "Plank 1-1-2"
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "This be a demo child plank"
title = "Plank 1-1-2-1"
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "This be a demo child plank"
title = "Plank 1-1-2-2"
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "This be a demo child plank"
title = "Plank 1-1-3"
+++
{{< piratify >}}

View file

@ -0,0 +1,6 @@
+++
alwaysopen = false
title = "Plank 2"
weight = 20
+++
{{< piratify >}}

View file

@ -0,0 +1,7 @@
+++
alwaysopen = false
descrption = "This be a demo child plank"
title = "Plank 3"
weight = 30
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "This be a plain plank test nested 'n a parrrent"
title = "Plank 3-1"
+++
{{< piratify >}}

View file

@ -0,0 +1,8 @@
+++
alwaysopen = false
descrption = "This be a hidden demo child plank"
hidden = true
title = "Plank 4 (hidden)"
weight = 40
+++
{{< piratify >}}

View file

@ -0,0 +1,6 @@
+++
descrption = "This be a plain plank test"
title = "Plank X"
weight = 1
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "Displays an expand'ble/collaps'ble sect'n o' text on yer plank"
title = "Expand"
+++
{{< piratify >}}

View file

@ -8,7 +8,7 @@ The Expand shortcode displays an expandable/collapsible section of text on your
## Usage ## Usage
````go ````go
{{%/* expand "Does this relearn theme rock?" { "true" | "false" } */%}} {{%/* expand "Does this Relearn theme rock?" { "true" | "false" } */%}}
Yes! Yes!
{{%/* /expand */%}} {{%/* /expand */%}}
```` ````

View file

@ -0,0 +1,5 @@
+++
descrption = "Displays content from other Marrrkdown files"
title = "Include"
+++
{{< piratify >}}

View file

@ -1,9 +1,9 @@
+++ +++
description = "Displays content from other markdown files" description = "Displays content from other Markdown files"
title = "Include" 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 ## Usage

View file

@ -0,0 +1,5 @@
+++
descrption = "Generrrat'n o' diagrrram an' flowcharrrt frrrom text 'n a similar manner as Marrrkdown"
title = "Merrrmaid"
+++
{{< piratify >}}

View file

@ -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" title = "Mermaid"
+++ +++
@ -7,7 +7,7 @@ title = "Mermaid"
## Usage ## Usage
Just insert your mermaid code in the `mermaid` shortcode like this: Just insert your Mermaid code in the `mermaid` shortcode like this:
````go ````go
{{</* mermaid [ align=(left|right|center|justify) ] */>}} {{</* mermaid [ align=(left|right|center|justify) ] */>}}
@ -92,7 +92,7 @@ sequenceDiagram
{{< mermaid >}} {{< mermaid >}}
gantt gantt
dateFormat YYYY-MM-DD dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid title Adding GANTT diagram functionality to Mermaid
section A section section A section
Completed task :done, des1, 2014-01-06,2014-01-08 Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d Active task :active, des2, 2014-01-09, 3d
@ -104,7 +104,7 @@ gantt
Create tests for parser :crit, active, 3d Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d Future task in critical line :crit, 5d
Create tests for renderer :2d Create tests for renderer :2d
Add to mermaid :1d Add to Mermaid :1d
{{< /mermaid >}} {{< /mermaid >}}
{{% expand "Show markup" "true" %}} {{% expand "Show markup" "true" %}}
@ -112,7 +112,7 @@ gantt
{{</* mermaid */>}} {{</* mermaid */>}}
gantt gantt
dateFormat YYYY-MM-DD dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid title Adding GANTT diagram functionality to Mermaid
section A section section A section
Completed task :done, des1, 2014-01-06,2014-01-08 Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d Active task :active, des2, 2014-01-09, 3d
@ -124,7 +124,7 @@ gantt
Create tests for parser :crit, active, 3d Create tests for parser :crit, active, 3d
Future task in critical line :crit, 5d Future task in critical line :crit, 5d
Create tests for renderer :2d Create tests for renderer :2d
Add to mermaid :1d Add to Mermaid :1d
{{</* /mermaid */>}} {{</* /mermaid */>}}
```` ````
{{% /expand %}} {{% /expand %}}
@ -199,11 +199,11 @@ stateDiagram-v2
## Configuration ## 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 ### Example

View file

@ -0,0 +1,5 @@
+++
descrption = "Disclaimerrrs t' help ye strrructurrre yer plank"
title = "Notice"
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
descrption = "Get value o' ship parrrams varrriables 'n yer plank"
title = "Ship param"
+++
{{< piratify >}}

View file

@ -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" title = "Site param"
+++ +++

View file

@ -0,0 +1,5 @@
+++
descrption = "Synchr'nize select'n o' content 'n different tabbed views"
title = "Tabbed views"
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
disableToc = true
title = "Showcase"
+++
{{< piratify >}}

View file

@ -0,0 +1,7 @@
+++
chapter = true
hidden = true
title = "This could be yers"
weight = 4
+++
{{< piratify >}}

View file

@ -0,0 +1,5 @@
+++
hidden = true
title = "Th' one an' only hidden child"
+++
{{< piratify >}}

View 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
View 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"

View file

@ -8,7 +8,7 @@
{{else}} {{else}}
<h1>Customize your own home page</h1> <h1>Customize your own home page</h1>
<p> <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> </p>
<ul> <ul>
<li><b>1. </b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li> <li><b>1. </b> Create an _index.md document in <b>content</b> folder and fill it with Markdown content</li>