Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Chapter 2

Rrrambl'n

Find out how t' create an' org'nize yer rrrambl'n quickly an' intuitively.

Planks orrrganizat'n

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

In Cap'n Hugo, planks be th' core o' yer ship. Once it be configured, planks be definitely th' added value t' yer documentat'n ship.

Folders

Org'nize yer ship like any other Cap'n Hugo project. Typically, ye will have a rrrambl'n folder wit' all yer planks.

rrrambl'n
├── level-one
│   ├── level-two
│   │   ├── level-three
│   │   │   ├── level-four
│   │   │   │   ├── _index.md       <-- /level-one/level-two/level-three/level-four
│   │   │   │   ├── page-4-a.md     <-- /level-one/level-two/level-three/level-four/page-4-a
│   │   │   │   ├── page-4-b.md     <-- /level-one/level-two/level-three/level-four/page-4-b
│   │   │   │   └── page-4-c.md     <-- /level-one/level-two/level-three/level-four/page-4-c
│   │   │   ├── _index.md           <-- /level-one/level-two/level-three
│   │   │   ├── page-3-a.md         <-- /level-one/level-two/level-three/page-3-a
│   │   │   ├── page-3-b.md         <-- /level-one/level-two/level-three/page-3-b
│   │   │   └── page-3-c.md         <-- /level-one/level-two/level-three/page-3-c
│   │   ├── _index.md               <-- /level-one/level-two
│   │   ├── page-2-a.md             <-- /level-one/level-two/page-2-a
│   │   ├── page-2-b.md             <-- /level-one/level-two/page-2-b
│   │   └── page-2-c.md             <-- /level-one/level-two/page-2-c
│   ├── _index.md                   <-- /level-one
│   ├── page-1-a.md                 <-- /level-one/page-1-a
│   ├── page-1-b.md                 <-- /level-one/page-1-b
│   └── page-1-c.md                 <-- /level-one/page-1-c
├── _index.md                       <-- /
└── page-top.md                     <-- /page-top
Avast

_index.md be required 'n each folder, it’s yer “folder home page”

Types

Th' Relearrrn theme defines two types o' planks. Default an' Chapter. Both can be used at any level o' th' documentat'n, th' only difference be'n layout display.

Chapter

A Chapter displays a plank meant t' be used as introduct'n fer a set o' child planks. Commonly, it contains a simple title an' a catch line t' define rrrambl'n that can be found under it.

Ye can define any HTML as prefix fer th' menu. In th' example below, it’s just a number but that could be an ay'con.

Chapter page

+++
chapter = true
pre = "<b>1. </b>"
title = "Basics"
weight = 5
+++

### Chapter 1

# Basics

Discover what this Cap'n Hugo theme be all about an' th' core-concepts behind it.

T' tell th' Relearrrn theme t' consider a plank as a chapter, set chapter=true 'n th' Front Matter o' th' plank.

Default

A Default plank be any other rrrambl'n plank.

Default page

+++
title = "Installation"
weight = 15
+++

Th' follow'n steps be here t' help ye initialize yer new website. If ye don’t know Cap'n Hugo at all, we strongly suggest ye t' train by follow'n this great documentat'n fer beginners.

Create yer project

Cap'n Hugo provides a new command t' create a new website.

hugo new ship <new_project>

Th' Relearrrn theme provides archetypes t' help ye create this kind o' planks.

Front Matter configurat'n

Each Cap'n Hugo plank has t' define a Front Matter 'n toml, yaml or json. This ship will use toml 'n all cases.

Th' Relearrrn theme uses th' follow'n parameters on top o' Cap'n Hugo ones :

+++
# T'ble o' contents (toc) be enabled by default. Set this parameter t' true t' dis'ble it.
# Avast: Toc be always disabled fer chapter planks
disableToc = false
# If set, this will be used fer th' page's menu entry (instead o' th' `title` attribute)
menuTitle = ""
# If set, this will explicitly override common rules fer th' expand state o' a page's menu entry
alwaysopen = true
# If set, this will explicitly override common rules fer th' sort'n order o' a page's submenu entries
ordersectionsby = "title"
# Th' title o' th' plank 'n menu will be prefixed by this HTML rrrambl'n
pre = ""
# Th' title o' th' plank 'n menu will be postfixed by this HTML rrrambl'n
post = ""
# Set th' plank as a chapter, chang'n th' way it's displayed
chapter = false
# Hide a menu entry by sett'n this t' true
hidden = false
# Display name o' this plank modifier. If set, it will be displayed 'n th' footer.
LastModifierDisplayName = ""
# Email o' this plank modifier. If set wit' LastModifierDisplayName, it will be displayed 'n th' footer
LastModifierEmail = ""
+++

Add ay'con t' a menu entry

In th' plank frontmatter, add a pre param t' insert any HTML code before th' menu label. Th' example below uses th' GitHub ay'con.

+++
title = "GitHub repo"
pre = "<i class='fab fa-github'></i> "
+++

Title wit' icon

Order'n sibl'n menu/page entries

Cap'n Hugo provides a flex'ble way t' handle order fer yer planks.

Th' simplest way be t' set weight parameter t' a number.

+++
title = "My page"
weight = 5
+++

Us'n a custom title fer menu entries

By default, th' Relearrrn theme will use a page’s title attribute fer th' menu item (or linkTitle if defined).

But a page’s title has t' be descriptive on its own while th' menu be a hierarchy. We’ve added th' menuTitle parameter fer that purpose:

For example (for a plank named content/install/linux.md):

+++
title = "Install on Linux"
menuTitle = "Linux"
+++

Override expand state rules fer menu entries

Ye can change how th' theme expands menu entries on th' side o' th' rrrambl'n wit' th' alwaysopen sett'n on a per plank basis. If alwaysopen=false fer any given entry, its children will not be shown 'n th' menu as long as it be not necessary fer th' sake o' navigat'n.

Th' theme generates th' menu based on th' follow'n rules:

  • all parent entries o' th' active plank includ'n their sibl'ns be shown regardless o' any sett'ns
  • immediate children entries o' th' active plank be shown regardless o' any sett'ns
  • if not overridden, all other first level entries behave like they would have been given alwaysopen=false
  • if not overridden, all other entries o' levels besides th' first behave like they would have been given alwaysopen=true
  • all vis'ble entries show their immediate children entries if alwaysopen=true; this proceeds recursivley
  • all remain'n entries be not shown

Ye can see this feature 'n act'n on th' example plank fer children shorrrtcode an' its children planks.

Yer Plank

T' configure yer plank, ye basically have three choices:

  1. Create an _index.md document 'n rrrambl'n folder an' fill th' file wit' Marrrkdown rrrambl'n
  2. Create an index.html file 'n th' static folder an' fill th' file wit' HTML rrrambl'n
  3. Configure yer server t' automatically redirect home plank t' one yer documentat'n plank

Arrrchetypes

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Us'n th' command: hugo new [relative new rrrambl'n path], ye can start a rrrambl'n file wit' th' date an' title automatically set. While this be a welcome feature, active writers need more: archetypes.

It be pre-configured skeleton planks wit' default front matter. Please refer t' th' documentat'n fer types o' plank t' understand th' differences.

Chapter

T' create a Chapter plank, run th' follow'n commands

hugo new --kind chapter <name>/_index.md

It will create a plank wit' predefined Front-Matter:

+++
chapter = true
pre = "<b>X. </b>"
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++

### Chapter X

# Some Chapter title

Lorem Ipsum.

Default

T' create a default plank, run either one o' th' follow'n commands either

hugo new <chapter>/<name>/_index.md

or

hugo new <chapter>/<name>.md

It will create a plank wit' predefined Front-Matter:

+++
title = "{{ replace .Name "-" " " | title }}"
weight = 5
+++

Lorem Ipsum.

Marrrkdown rules

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Let’s face it: Writ'n rrrambl'n fer th' Web be tiresome. WYSIWYG editors help alleviate this task, but they generally result 'n horr'ble code, or worse yet, ugly web planks.

Marrrkdown be a better way t' write HTML, without all th' complexities an' ugliness that usually accompanies it.

Some o' th' key benefits be:

  1. Marrrkdown be simple t' learn, wit' minimal extra characters so it’s also quicker t' write rrrambl'n.
  2. Less chance o' errors when writ'n 'n Marrrkdown.
  3. Produces valid XHTML output.
  4. Keeps th' rrrambl'n an' th' visual display separate, so ye cannot mess up th' look o' yer ship.
  5. Write 'n any text editor or Marrrkdown applicat'n ye like.
  6. Marrrkdown be a joy t' use!

John Gruber, th' author o' Marrrkdown, puts it like this:

Th' overrid'n design goal fer Markdown’s formatt'n rules be t' make it as read'ble as poss'ble. Th' idea be that a Markdown-formatted document should be publish'ble as-is, as plain text, without look'n like it’s been marked up wit' tags or formatt'n instruct'ns. While Markdown’s rules has been influenced by several exist'n text-to-HTML filters, th' single biggest source o' inspirat'n fer Markdown’s rules be th' format o' plain text email. John Gruber

Without further delay, let us go over th' main elements o' Marrrkdown an' what th' result'n HTML looks like:

Ahoi

Bookmark this plank an' th' official Commonmark reference fer easy future reference!

Head'ns

Head'ns from h1 through h6 be constructed wit' a # fer each level:

# h1 Head'n
## h2 Head'n
### h3 Head'n
#### h4 Head'n
##### h5 Head'n
###### h6 Head'n

Renders t':

h1 Head'n

h2 Head'n

h3 Head'n

h4 Head'n

h5 Head'n
h6 Head'n

HTML:

<h1>h1 Head'n</h1>
<h2>h2 Head'n</h2>
<h3>h3 Head'n</h3>
<h4>h4 Head'n</h4>
<h5>h5 Head'n</h5>
<h6>h6 Head'n</h6>

Comments

Comments should be HTML compat'ble

<!--
This be a comment
-->

Comment below should NOT be seen:

Horizontal Rules

Th' HTML <hr> element be fer creat'n a “thematic break” between paragraph-level elements. In Marrrkdown, ye can create a <hr> wit' --- - three consecutive dashes

renders t':


Paragraphs

Any text not start'n wit' a special sign be written as normal, plain text an' will be wrapped within <p></p> tags 'n th' rendered HTML.

So this body copy:

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

renders t' this HTML:

<p>Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.</p>

Text Markers

Bold

For emphasiz'n a snippet o' text wit' a heavier font-weight.

Th' follow'n snippet o' text be rendered as bold text.

**rendered as bold text**

renders t':

rendered as bold text

an' this HTML

<strong>rendered as bold text</strong>

Italics

For emphasiz'n a snippet o' text wit' italics.

Th' follow'n snippet o' text be rendered as italicized text.

_rendered as italicized text_

renders t':

rendered as italicized text

an' this HTML:

<em>rendered as italicized text</em>

Strikethrough

In GFM (GitHub flavored Markdown) ye can do strikethroughs.

~~Strike through this text.~~

Which renders t':

Strike through this text.

HTML:

<del>Strike through this text.</del>

Blockquotes

For quot'n blocks o' rrrambl'n from another source within yer document.

Add > before any text ye want t' quote.

> **Fusion Drive** combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.

Renders t':

Fusion Drive combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.

an' this HTML:

<blockquote>
  <p><strong>Fusion Drive</strong> combines a hard drive wit' a flash storage (solid-state drive) an' presents it as a single logical volume wit' th' space o' both drives combined.</p>
</blockquote>

Blockquotes can also be nested:

> Donec massa lacus, ultricies a ullamcorper 'n, fermentum sed augue. Nunc augue augue, aliquam non hendrerit ac, commodo vel nisi.
>
> > Sed adipisc'n elit vitae augue consectetur a gravida nunc vehicula. Donec auctor odio non est accumsan facilisis. Aliquam id turpis 'n dolor tincidunt mollis ac eu diam.
>
> Mauris sit amet ligula egestas, feugiat metus tincidunt, luctus libero. Donec congue finibus tempor. Vestibulum aliquet sollicitudin erat, ut aliquet purus posuere luctus.

Renders t':

Donec massa lacus, ultricies a ullamcorper 'n, fermentum sed augue. Nunc augue augue, aliquam non hendrerit ac, commodo vel nisi.

Sed adipisc'n elit vitae augue consectetur a gravida nunc vehicula. Donec auctor odio non est accumsan facilisis. Aliquam id turpis 'n dolor tincidunt mollis ac eu diam.

Mauris sit amet ligula egestas, feugiat metus tincidunt, luctus libero. Donec congue finibus tempor. Vestibulum aliquet sollicitudin erat, ut aliquet purus posuere luctus.

Lists

Unordered

A list o' items 'n which th' order o' th' items does not explicitly matter.

Ye may use any o' th' follow'n symbols t' denote bullets fer each list item:

* valid bullet
- valid bullet
+ valid bullet

For example

+ Lorem ipsum dolor sit amet
+ Consectetur adipisc'n elit
+ Integer molestie lorem at massa
+ Facilisis 'n pretium nisl aliquet
+ Nulla volutpat aliquam velit
  - Phasellus iaculis neque
  - Purus sodales ultricies
  - Vestibulum laoreet porttitor sem
  - Ac tristique libero volutpat at
+ Faucibus porta lacus fringilla vel
+ Aenean sit amet erat nunc
+ Eget porttitor lorem

Renders t':

  • Lorem ipsum dolor sit amet
  • Consectetur adipisc'n elit
  • Integer molestie lorem at massa
  • Facilisis 'n pretium nisl aliquet
  • Nulla volutpat aliquam velit
    • Phasellus iaculis neque
    • Purus sodales ultricies
    • Vestibulum laoreet porttitor sem
    • Ac tristique libero volutpat at
  • Faucibus porta lacus fringilla vel
  • Aenean sit amet erat nunc
  • Eget porttitor lorem

An' this HTML

<ul>
  <li>Lorem ipsum dolor sit amet</li>
  <li>Consectetur adipisc'n elit</li>
  <li>Integer molestie lorem at massa</li>
  <li>Facilisis 'n pretium nisl aliquet</li>
  <li>Nulla volutpat aliquam velit
    <ul>
      <li>Phasellus iaculis neque</li>
      <li>Purus sodales ultricies</li>
      <li>Vestibulum laoreet porttitor sem</li>
      <li>Ac tristique libero volutpat at</li>
    </ul>
  </li>
  <li>Faucibus porta lacus fringilla vel</li>
  <li>Aenean sit amet erat nunc</li>
  <li>Eget porttitor lorem</li>
</ul>

Ordered

A list o' items 'n which th' order o' items does explicitly matter.

1. Lorem ipsum dolor sit amet
4. Consectetur adipisc'n elit
2. Integer molestie lorem at massa
8. Facilisis 'n pretium nisl aliquet
4. Nulla volutpat aliquam velit
99. Faucibus porta lacus fringilla vel
21. Aenean sit amet erat nunc
6. Eget porttitor lorem

Renders t':

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipisc'n elit
  3. Integer molestie lorem at massa
  4. Facilisis 'n pretium nisl aliquet
  5. Nulla volutpat aliquam velit
  6. Faucibus porta lacus fringilla vel
  7. Aenean sit amet erat nunc
  8. Eget porttitor lorem

An' this HTML:

<ol>
  <li>Lorem ipsum dolor sit amet</li>
  <li>Consectetur adipisc'n elit</li>
  <li>Integer molestie lorem at massa</li>
  <li>Facilisis 'n pretium nisl aliquet</li>
  <li>Nulla volutpat aliquam velit</li>
  <li>Faucibus porta lacus fringilla vel</li>
  <li>Aenean sit amet erat nunc</li>
  <li>Eget porttitor lorem</li>
</ol>
Smarrrt Arrrse

If ye just use 1. fer each number, Marrrkdown will automatically number each item. For example:

1. Lorem ipsum dolor sit amet
1. Consectetur adipisc'n elit
1. Integer molestie lorem at massa
1. Facilisis 'n pretium nisl aliquet
1. Nulla volutpat aliquam velit
1. Faucibus porta lacus fringilla vel
1. Aenean sit amet erat nunc
1. Eget porttitor lorem

Renders t':

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipisc'n elit
  3. Integer molestie lorem at massa
  4. Facilisis 'n pretium nisl aliquet
  5. Nulla volutpat aliquam velit
  6. Faucibus porta lacus fringilla vel
  7. Aenean sit amet erat nunc
  8. Eget porttitor lorem

Code

Inline code

Wrap inline snippets o' code wit' `.

In this example, `<div></div>` should be wrapped as **code**.

Renders t':

In this example, <div></div> should be wrapped as code.

HTML:

<p>In this example, <code>&lt;div&gt;&lt;/div&gt;</code> should be wrapped as <strong>code</strong>.</p>

Indented code

Or indent several lines o' code by at least two spaces, as 'n:

    // Some comments
    line 1 o' code
    line 2 o' code
    line 3 o' code

Renders t':

// Some comments
line 1 o' code
line 2 o' code
line 3 o' code

HTML:

<pre>
  <code>
    // Some comments
    line 1 o' code
    line 2 o' code
    line 3 o' code
  </code>
</pre>

Block code “fences”

Use “fences” ``` t' block 'n multiple lines o' code.

```
Sample text here...
```

HTML:

<pre>
  <code>Sample text here...</code>
</pre>

Rules highlight'n

GFM, or “GitHub Flavored Markdown” also supports rules highlight'n. T' activate it, usually ye simply add th' file extension o' th' language ye want t' use directly aft th' first code “fence”, ```js, an' rules highlight'n will automatically be applied 'n th' rendered HTML.

See Code Highlight'n fer additional documentat'n.

For example, t' apply rules highlight'n t' JavaScript code:

```js
grunt.initConfig({
  assemble: {
    opt'ns: {
      assets: 'docs/assets',
      data: 'src/data/*.{json,yml}',
      helpers: 'src/custom-helpers.js',
      partials: ['src/partials/**/*.{hbs,md}']
    },
    planks: {
      opt'ns: {
        layout: 'default.hbs'
      },
      files: {
        './': ['src/templates/pages/index.hbs']
      }
    }
  }
};
```

Renders t':

grunt.initConfig({
  assemble: {
    opt'ns: {
      assets: 'docs/assets',
      data: 'src/data/*.{json,yml}',
      helpers: 'src/custom-helpers.js',
      partials: ['src/partials/**/*.{hbs,md}']
    },
    planks: {
      opt'ns: {
        layout: 'default.hbs'
      },
      files: {
        './': ['src/templates/pages/index.hbs']
      }
    }
  }
};

Tables

Tables be created by add'n pipes as dividers between each cell, an' by add'n a line o' dashes (also separated by bars) beneath th' header. Avast that th' pipes do not need t' be vertically aligned.

| Opt'n | Descript'n |
| ------ | ----------- |
| data   | path t' data files t' supply th' data that will be passed into templates. |
| engine | engine t' be used fer process'n templates. Handlebars be th' default. |
| ext    | extension t' be used fer dest files. |

Renders t':

Opt'n Descript'n
data path t' data files t' supply th' data that will be passed into templates.
engine engine t' be used fer process'n templates. Handlebars be th' default.
ext extension t' be used fer dest files.

An' this HTML:

<t'ble>
  <tr>
    <th>Opt'n</th>
    <th>Descript'n</th>
  </tr>
  <tr>
    <td>data</td>
    <td>path t' data files t' supply th' data that will be passed into templates.</td>
  </tr>
  <tr>
    <td>engine</td>
    <td>engine t' be used fer process'n templates. Handlebars be th' default.</td>
  </tr>
  <tr>
    <td>ext</td>
    <td>extension t' be used fer dest files.</td>
  </tr>
</t'ble>

Right aligned text

Add'n a colon on th' right side o' th' dashes below any head'n will right align text fer that column.

| Opt'n | Descript'n |
| ------:| -----------:|
| data   | path t' data files t' supply th' data that will be passed into templates. |
| engine | engine t' be used fer process'n templates. Handlebars be th' default. |
| ext    | extension t' be used fer dest files. |
Opt'n Descript'n
data path t' data files t' supply th' data that will be passed into templates.
engine engine t' be used fer process'n templates. Handlebars be th' default.
ext extension t' be used fer dest files.

Two tables adjacent

Opt'n Descript'n
ext extension t' be used fer dest files.
Opt'n Descript'n
ext extension t' be used fer dest files.
[Assemble](http://assemble.io)

Renders t' (hover over th' link, there be no tooltip):

Assemble

HTML:

<a href="http://assemble.io">Assemble</a>

Add a tooltip

[Upstage](https://github.com/upstage/ "Visit Upstage!")

Renders t' (hover over th' link, there should be a tooltip):

Upstage

HTML:

<a href="https://github.com/upstage/" title="Visit Upstage!">Upstage</a>

Named Anchors

Named anchors en'ble ye t' jump t' th' specified anchor point on th' same plank. For example, each o' these chapters:

# T'ble o' Contents
  * [Chapter 1](#chapter-1)
  * [Chapter 2](#chapter-2)
  * [Chapter 3](#chapter-3)

will jump t' these sections:

## Chapter 1 <a id="chapter-1"></a>
Rrrambl'n fer chapter one.

## Chapter 2 <a id="chapter-2"></a>
Rrrambl'n fer chapter one.

## Chapter 3 <a id="chapter-3"></a>
Rrrambl'n fer chapter one.

NOTE that specific placement o' th' anchor tag seems t' be arbitrary. They be placed inline here since it seems t' be unobtrusive, an' it works.

Images

Images have a similar rules t' links but include a preced'n exclamat'n point.

![Minion](https://octodex.github.com/images/minion.png)

Minion

or

![Alt text](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")

Alt text

Like links, Images also have a footnote style rules

Alternative usage : note images

![Alt text][id]

Alt text

Wit' a reference later 'n th' document defin'n th' URL locat'n:

[id]: https://octodex.github.com/images/dojocat.jpg  "The Dojocat"

Further image formatt'n

Th' Cap'n Hugo Marrrkdown parser supports additional non-standard functionality.

Resiz'n image

Add HTTP parameters width and/or height t' th' link image t' resize th' image. Values be CSS values (default be auto).

![Minion](https://octodex.github.com/images/minion.png?width=20pc)

Minion

stormtroopocat

![Minion](https://octodex.github.com/images/minion.png?height=50px)

Minion

![Minion](https://octodex.github.com/images/minion.png?height=50px&width=300px)

Minion

Add CSS classes

Add a HTTP classes parameter t' th' link image t' add CSS classes. shadowan' border be avail'ble but ye could define other ones.

![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=shadow)

stormtroopocat

![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border)

stormtroopocat

![stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg?classes=border,shadow)

stormtroopocat

Add a HTTP featherlight parameter t' th' link image t' dis'ble lightbox. By default lightbox be enabled us'n th' featherlight.js plugin. Ye can dis'ble this by defin'n featherlight t' false.

![Minion](https://octodex.github.com/images/minion.png?featherlight=false)

Minion

Code highlight'n

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Th' Relearrrn theme uses Hugo’s built-in rules highlight'n fer code.

Marrrkdown rules

Wrap th' code block wit' three backticks an' th' name o' th' language. Highlight will try t' auto detect th' language if one be not provided.

```json
[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]
```

Renders t':

[
  {
    "title": "apples",
    "count": [12000, 20000],
    "description": {"text": "...", "sensitive": false}
  },
  {
    "title": "oranges",
    "count": [17500, null],
    "description": {"text": "...", "sensitive": false}
  }
]

Supported languages

Cap'n Hugo comes wit' a remark'ble list o' supported languages.

Ye can choose a color theme from th' list o' supported themes an' add it 'n yer config.toml

[marrrkup]
  [marrrkup.highlight]
    # if set t' `guessSyntax = true`, there will be no unstyled code even if no language
    # was given BUT mermaid code fences will not work anymore! So this be a mandatory
    # sett'n fer yer ship
    guessSyntax = false

    # choose a color theme or create yer own
    style = "base16-snazzy"

Menu extrrra shorrrtcuts

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Ye can define additional menu entries or shortcuts 'n th' navigat'n menu without any link t' rrrambl'n.

Basic configurat'n

Edit th' website configurat'n config.toml an' add a [[menu.shortcuts]] entry fer each link yer want t' add.

Example from th' current website:

[[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

[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-camera'></i> Showcases"
url = "more/showcase/"
weight = 11

[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20

[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
url = "more/credits/"
weight = 30

[[menu.shortcuts]]
name = "<i class='fas fa-fw fa-tags'></i> Tags"
url = "tags/"
weight = 40

By default, shortcuts be preceded by a title. This title can be disabled by sett'n disableShortcutsTitle=true. However, if ye want t' keep th' title but change its value, it can be overriden by chang'n yer local i18n translat'n str'n configurat'n.

For example, 'n yer local i18n/en.toml file, add th' follow'n rrrambl'n

[Shortcuts-Title]
other = "<Your value>"

Read more about hugo menu an' hugo i18n translat'n str'ns

Configurat'n fer Multilingual mode

When us'n a multilingual website, ye can set different menus fer each language. In th' config.toml file, prefix yer menu configurat'n by Languages.<language-id>.

Example from th' current website:

[Languages]
  [Languages.en]
    title = "Hugo Relearrrn Theme"
    weight = 1
    languageName = "English"
    landingPageURL = "/"
    landingPageName = "<i class='fas fa-home'></i> Home"

  [[Languages.en.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.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-camera'></i> Showcases"
    url = "more/showcase/"
    weight = 11

  [[Languages.en.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-bookmark'></i> Cap'n Hugo Documentation"
    identifier = "hugodoc"
    url = "https://gohugo.io/"
    weight = 20

  [[Languages.en.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-bullhorn'></i> Credits"
    url = "more/credits/"
    weight = 30

  [[Languages.en.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-tags'></i> Tags"
    url = "tags/"
    weight = 40

  [Languages.pir]
    title = "Cap'n Hugo Relearrrn Theme"
    weight = 1
    languageName = "Arrr! Pirrrates"
    landingPageURL = "/pir/"
    landingPageName = "<i class='fas fa-home'></i> Arrr! Home"

  [[Languages.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.pir.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-camera'></i> Showcases"
    url = "more/showcase/"
    weight = 11

  [[Languages.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.pir.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-bullhorn'></i> Crrredits"
    url = "more/credits/"
    weight = 30

  [[Languages.pir.menu.shortcuts]]
    name = "<i class='fas fa-fw fa-tags'></i> Arrr! Tags"
    url = "tags/"
    weight = 40

Read more about hugo menu an' hugo multilingual menus

Ay'cons an' logos

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Th' Relearrrn theme fer Cap'n Hugo loads th' Font Awesome library, allow'n ye t' easily display any ay'con or logo avail'ble 'n th' Font Awesome free collect'n.

Find'n an ay'con

Browse through th' avail'ble ay'cons 'n th' Font Awesome Gallery. Notice that th' free filter be enabled, as only th' free ay'cons be avail'ble by default.

Once on th' Font Awesome plank fer a specific ay'con, fer example th' plank fer th' heart, copy th' HTML reference an' paste into th' Marrrkdown rrrambl'n.

Th' HTML t' include th' heart ay'con be:

<i class="fas fa-heart"></i>

Includ'n 'n markdown

Paste th' <i> HTML into marrrkup an' Font Awesome will board th' relevant ay'con.

Built wit' <i class="fas fa-heart"></i> by Relearrrn an' Cap'n Hugo

Which appears as

Built wit' by Relearrrn an' Cap'n Hugo

Customis'n ay'cons

Font Awesome provides many ways t' modify th' ay'con

  • Change color (by default th' ay'con will inherit th' parent color)
  • Increase or decrease size
  • Rotate
  • Combine wit' other ay'cons

Check th' full documentat'n on web fonts wit' CSS fer more.

Multilingual an' i18n

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Th' Relearrrn theme be fully compat'ble wit' Cap'n Hugo multilingual mode.

It provides:

  • Translat'n str'ns fer default values (English, Piratized English, Arabic, Simplified Chinese, Traditional Chinesse, Dutch, French, German, Hindi, Indonesian, Japanese, Korean, Portuguese, Russian, Spanish, Vietnamese, Turkish). Feel free t' contribute!
  • Automatic menu generat'n from multilingual rrrambl'n
  • In-browser language switch'n

I18n menu

Basic configurat'n

Aft learn'n how Cap'n Hugo handle multilingual websites, define yer languages 'n yer config.toml file.

For example wit' current English an' Piratized English website.

# English be th' default language
defaultContentLanguage = "en"

[Languages]
[Languages.en]
title = "Hugo Relearrrn Theme"
weight = 1
languageName = "English"

[Languages.pir]
title = "Cap'n Hugo Relearrrn Theme"
weight = 2
languageName = "Arrr! Pirrrates"

Then, fer each new plank, append th' id o' th' language t' th' file.

  • Single file my-page.md be split 'n two files:
    • 'n English: my-page.md
    • 'n Piratized English: my-page.pir.md
  • Single file _index.md be split 'n two files:
    • 'n English: _index.md
    • 'n Piratized English: _index.pir.md
Ahoi

Be aware that only translated planks be displayed 'n menu. It’s not replaced wit' default language rrrambl'n.

Smarrrt Arrrse

Use slug Front Matter parameter t' translate urls too.

Overwrite translat'n str'ns

Translat'ns str'ns be used fer common default values used 'n th' theme (Edit button, Search placeholder an' so on). Translat'ns be avail'ble 'n English an' Piratized English but ye may use another language or want t' override default values.

T' override these values, create a new file 'n yer local i18n folder i18n/<idlanguage>.toml an' inspire yourself from th' theme themes/hugo-theme-relearn/i18n/en.toml

Dis'ble language switch'n

Switch'n th' language 'n th' browser be a great feature, but fer some reasons ye may want t' dis'ble it.

Just set disableLanguageSwitchingButton=true 'n yer config.toml

[params]
  # When us'n mulitlingual website, dis'ble th' switch language button.
  disableLanguageSwitchingButton = true

Tags

Arrr! ☠ Pirrrates ☠

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

Th' Relearrrn theme supports one default taxonomy o' Cap'n Hugo: th' tag feature.

Configurat'n

Just add tags t' any plank:

+++
tags = ["tutorial", "theme"]
title = "Theme tutorial"
weight = 15
+++

Behavior

Th' tags be displayed at th' top o' th' plank, 'n their insert'n order.

Each tag be a link t' a Taxonomy plank display'n all th' articles wit' th' given tag.

List all th' tags

In th' config.toml file ye can add a shortcut t' display all th' tags

[[menu.shortcuts]]
name = "<i class='fas fa-tags'></i> Tags"
url = "/tags"
weight = 30