Fix Learn theme addition to git
This commit is contained in:
166
themes/learn/exampleSite/content/cont/pages/_index.en.md
Normal file
166
themes/learn/exampleSite/content/cont/pages/_index.en.md
Normal file
@ -0,0 +1,166 @@
|
||||
---
|
||||
date: 2016-04-09T16:50:16+02:00
|
||||
title: Pages organization
|
||||
weight: 5
|
||||
---
|
||||
|
||||
In **Hugo**, pages are the core of your site. Once it is configured, pages are definitely the added value to your documentation site.
|
||||
|
||||
## Folders
|
||||
|
||||
Organize your site like [any other Hugo project](https://gohugo.io/content/organization/). Typically, you will have a *content* folder with all your pages.
|
||||
|
||||
content
|
||||
├── level-one
|
||||
│ ├── level-two
|
||||
│ │ ├── level-three
|
||||
│ │ │ ├── level-four
|
||||
│ │ │ │ ├── _index.md <-- /level-one/level-two/level-three/level-four
|
||||
│ │ │ │ ├── page-4-a.md <-- /level-one/level-two/level-three/level-four/page-4-a
|
||||
│ │ │ │ ├── page-4-b.md <-- /level-one/level-two/level-three/level-four/page-4-b
|
||||
│ │ │ │ └── page-4-c.md <-- /level-one/level-two/level-three/level-four/page-4-c
|
||||
│ │ │ ├── _index.md <-- /level-one/level-two/level-three
|
||||
│ │ │ ├── page-3-a.md <-- /level-one/level-two/level-three/page-3-a
|
||||
│ │ │ ├── page-3-b.md <-- /level-one/level-two/level-three/page-3-b
|
||||
│ │ │ └── page-3-c.md <-- /level-one/level-two/level-three/page-3-c
|
||||
│ │ ├── _index.md <-- /level-one/level-two
|
||||
│ │ ├── page-2-a.md <-- /level-one/level-two/page-2-a
|
||||
│ │ ├── page-2-b.md <-- /level-one/level-two/page-2-b
|
||||
│ │ └── page-2-c.md <-- /level-one/level-two/page-2-c
|
||||
│ ├── _index.md <-- /level-one
|
||||
│ ├── page-1-a.md <-- /level-one/page-1-a
|
||||
│ ├── page-1-b.md <-- /level-one/page-1-b
|
||||
│ └── page-1-c.md <-- /level-one/page-1-c
|
||||
├── _index.md <-- /
|
||||
└── page-top.md <-- /page-top
|
||||
|
||||
{{% notice note %}}
|
||||
`_index.md` is required in each folder, it’s your “folder home page”
|
||||
{{% /notice %}}
|
||||
|
||||
## Types
|
||||
|
||||
**Hugo-theme-learn** 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/).
|
||||
|
||||

|
||||
|
||||
```markdown
|
||||
+++
|
||||
title = "Basics"
|
||||
chapter = true
|
||||
weight = 5
|
||||
pre = "<b>1. </b>"
|
||||
+++
|
||||
|
||||
### Chapter 1
|
||||
|
||||
# Basics
|
||||
|
||||
Discover what this Hugo theme is all about and the core-concepts behind it.
|
||||
```
|
||||
|
||||
To tell **Hugo-theme-learn** 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.
|
||||
|
||||

|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Installation"
|
||||
weight = 15
|
||||
+++
|
||||
```
|
||||
|
||||
The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you to train by following this [great documentation for beginners](https://gohugo.io/overview/quickstart/).
|
||||
|
||||
## Create your project
|
||||
|
||||
Hugo provides a `new` command to create a new website.
|
||||
|
||||
```
|
||||
hugo new site <new_project>
|
||||
```
|
||||
|
||||
**Hugo-theme-learn** provides [archetypes]({{< relref "cont/archetypes.en.md" >}}) 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 *yaml*, *toml* or *json*.
|
||||
|
||||
**Hugo-theme-learn** uses the following parameters on top of Hugo ones :
|
||||
|
||||
```toml
|
||||
+++
|
||||
# Table of content (toc) is enabled by default. Set this parameter to true to disable it.
|
||||
# Note: Toc is always disabled for chapter pages
|
||||
disableToc = "false"
|
||||
# If set, this will be used for the page's menu entry (instead of the `title` attribute)
|
||||
menuTitle = ""
|
||||
# The title of the page in menu will be prefixed by this HTML content
|
||||
pre = ""
|
||||
# The title of the page in menu will be postfixed by this HTML content
|
||||
post = ""
|
||||
# Set the page as a chapter, changing the way it's displayed
|
||||
chapter = false
|
||||
# Hide a menu entry by setting this to true
|
||||
hidden = false
|
||||
# Display name of this page modifier. If set, it will be displayed in the footer.
|
||||
LastModifierDisplayName = ""
|
||||
# Email of this page modifier. If set with LastModifierDisplayName, it will be displayed in the footer
|
||||
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.
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Github repo"
|
||||
pre = "<i class='fab fa-github'></i> "
|
||||
+++
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Ordering sibling menu/page entries
|
||||
|
||||
Hugo provides a [flexible way](https://gohugo.io/content/ordering/) to handle order for your pages.
|
||||
|
||||
The simplest way is to set `weight` parameter to a number.
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "My page"
|
||||
weight = 5
|
||||
+++
|
||||
```
|
||||
|
||||
### Using a custom title for menu entries
|
||||
|
||||
By default, **Hugo-theme-learn** 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:
|
||||
|
||||
For example (for a page named `content/install/linux.md`):
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Install on Linux"
|
||||
menuTitle = "Linux"
|
||||
+++
|
||||
```
|
||||
|
||||
## Homepage
|
||||
|
||||
To configure your home 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*
|
||||
3. Configure your server to automatically redirect home page to one your documentation page
|
146
themes/learn/exampleSite/content/cont/pages/_index.fr.md
Normal file
146
themes/learn/exampleSite/content/cont/pages/_index.fr.md
Normal file
@ -0,0 +1,146 @@
|
||||
---
|
||||
date: 2016-04-09T16:50:16+02:00
|
||||
title: Organisation des pages
|
||||
weight: 5
|
||||
---
|
||||
|
||||
Dans **Hugo**, les pages sont le cœur de votre site. Une fois configurées, les pages sont la valeur ajoutée de votre site de documentation.
|
||||
|
||||
## Dossiers
|
||||
|
||||
Organisez votre site comme n'importe quel autre [projet Hugo](https://gohugo.io/content/organization/). Typiquement, vous allez avoir un dossier *content* avec vos pages.
|
||||
|
||||
content
|
||||
├── niveau-un
|
||||
│ ├── niveau-deux
|
||||
│ │ ├── niveau-trois
|
||||
│ │ │ ├── niveau-quatre
|
||||
│ │ │ │ ├── _index.md <-- /niveau-un/niveau-deux/niveau-trois/niveau-quatre
|
||||
│ │ │ │ ├── page-4-a.md <-- /niveau-un/niveau-deux/niveau-trois/niveau-quatre/page-4-a
|
||||
│ │ │ │ ├── page-4-b.md <-- /niveau-un/niveau-deux/niveau-trois/niveau-quatre/page-4-b
|
||||
│ │ │ │ └── page-4-c.md <-- /niveau-un/niveau-deux/niveau-trois/niveau-quatre/page-4-c
|
||||
│ │ │ ├── _index.md <-- /niveau-un/niveau-deux/niveau-trois
|
||||
│ │ │ ├── page-3-a.md <-- /niveau-un/niveau-deux/niveau-trois/page-3-a
|
||||
│ │ │ ├── page-3-b.md <-- /niveau-un/niveau-deux/niveau-trois/page-3-b
|
||||
│ │ │ └── page-3-c.md <-- /niveau-un/niveau-deux/niveau-trois/page-3-c
|
||||
│ │ ├── _index.md <-- /niveau-un/niveau-deux
|
||||
│ │ ├── page-2-a.md <-- /niveau-un/niveau-deux/page-2-a
|
||||
│ │ ├── page-2-b.md <-- /niveau-un/niveau-deux/page-2-b
|
||||
│ │ └── page-2-c.md <-- /niveau-un/niveau-deux/page-2-c
|
||||
│ ├── _index.md <-- /niveau-un
|
||||
│ ├── page-1-a.md <-- /niveau-un/page-1-a
|
||||
│ ├── page-1-b.md <-- /niveau-un/page-1-b
|
||||
│ └── page-1-c.md <-- /niveau-un/page-1-c
|
||||
├── _index.md <-- /
|
||||
└── premiere-page.md <-- /premiere-page
|
||||
|
||||
{{% notice note %}}
|
||||
Le fichier `_index.md` est obligatoire dans chaque dossier, c'est en quelque sorte votre page d'accueil pour le dossier.
|
||||
{{% /notice %}}
|
||||
|
||||
## Types
|
||||
|
||||
**Hugo-theme-learn** définit deux types de pages. *Défaut* et *Chapitre*. Les deux sont utilisables à n'importe quel niveau du site, la seule différence est dans l'affichage.
|
||||
|
||||
Un **Chapitre** affiche une page vouée à être une introduction pour un ensemble de pages filles. Habituellement, il va seulement contenir un titre et un résumé de la section.
|
||||
Vous pouvez définir n'importe quel contenu HTML comme préfixe de l'entrée du menu. Dans l'exemple ci-dessous, c'est juste un nombre mais vous pourriez utiliser une [icône](https://fortawesome.github.io/Font-Awesome/).
|
||||
|
||||

|
||||
|
||||
```markdown
|
||||
+++
|
||||
title = "Démarrage"
|
||||
weight = 5
|
||||
pre = "<b>1. </b>"
|
||||
chapter = true
|
||||
+++
|
||||
|
||||
### Chapitre 1
|
||||
|
||||
# Démarrage
|
||||
|
||||
Découvrez comment utiliser ce thème Hugo et apprenez en les concepts
|
||||
```
|
||||
|
||||
Pour dire à **Hugo-theme-learn** de considérer la page comme un chapitre, configure `chapter=true` dans le Front Matter de la page.
|
||||
|
||||
Une page **Défaut** est n'importe quelle autre page.
|
||||
|
||||

|
||||
|
||||
+++
|
||||
title = "Installation"
|
||||
weight = 15
|
||||
+++
|
||||
|
||||
The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you to train by following this [great documentation for beginners](https://gohugo.io/overview/quickstart/).
|
||||
|
||||
## Create your project
|
||||
|
||||
Hugo provides a `new` command to create a new website.
|
||||
|
||||
```
|
||||
hugo new site <new_project>
|
||||
```
|
||||
|
||||
**Hugo-theme-learn** fournit des [archétypes]({{< relref "cont/archetypes.fr.md" >}}) pour vous aider à créer ce type de pages.
|
||||
|
||||
## Configuration des Front Matter
|
||||
|
||||
Chaque page Hugo doit définir un [Front Matter](https://gohugo.io/content/front-matter/) dans le format *yaml*, *toml* ou *json*.
|
||||
|
||||
**Hugo-theme-learn** utilise les paramètres suivant en plus de ceux définis par Hugo:
|
||||
|
||||
```toml
|
||||
+++
|
||||
# Le Sommaire (table of content = toc) est activé par défaut. Modifier ce paramètre à true pour le désactiver.
|
||||
# Note: Le sommaire est toujours désactivé pour les chapitres
|
||||
disableToc = "false"
|
||||
# Le titre de la page dans le menu sera préfixé par ce contentu HTML
|
||||
pre = ""
|
||||
# Le titre de la page dans le menu sera suffixé par ce contentu HTML
|
||||
post = ""
|
||||
# Modifier le type de la page pour changer l'affichage
|
||||
chapter = false
|
||||
# Cache la page du menu
|
||||
hidden = false
|
||||
# Nom de la personne qui a modifié la page. Quand configuré, sera affiché dans le pied de page.
|
||||
LastModifierDisplayName = ""
|
||||
# Email de la personne qui a modifié la page. Quand configuré, sera affiché dans le pied de page.
|
||||
LastModifierEmail = ""
|
||||
+++
|
||||
```
|
||||
|
||||
### Ajouter une icône à une entrée du menu
|
||||
|
||||
Dans le Front Matter, ajouter un paramètre `pre` pour insérer du code HTML qui s'affichera avant le label du menu. L'exemple ci-dessous utilise l'icône de Github.
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Repo Github"
|
||||
pre = "<i class='fab fa-github'></i> "
|
||||
+++
|
||||
```
|
||||
|
||||

|
||||
|
||||
### Ordonner les entrées dans le menu
|
||||
|
||||
Hugo permet de modifier facilement [l'ordre des menu](https://gohugo.io/content/ordering/).
|
||||
|
||||
La manière la plus simple est de configurer le paramètre `weight` avec un nombre.
|
||||
|
||||
```toml
|
||||
+++
|
||||
title = "Ma page"
|
||||
weight = 5
|
||||
+++
|
||||
```
|
||||
|
||||
## Page d'accueil
|
||||
|
||||
Pour configurer votre page d'accueil, vous avez trois choix:
|
||||
|
||||
1. Créer une page `_index.md` dans le dossier `content` et remplissez le fichier avec du *contenu Markdown*
|
||||
2. Créer une page `index.html` dans le dossier `static` et remplissez le fichier avec du *contenu HTML*
|
||||
3. Configurez votre serveur pour automatiquement rediriger la page d'accueil vers l'une de vos pages.
|
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 152 KiB |
Binary file not shown.
After Width: | Height: | Size: 196 KiB |
Reference in New Issue
Block a user