--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Shortcodes
4 | pre: "3. "
5 | weight: 15
6 | ---
7 |
8 | Hugo uses Markdown for its simple content format. However, there are a lot of things that Markdown doesn’t support well. You could use pure HTML to expand possibilities.
9 |
10 | But this happens to be a bad idea. Everyone uses Markdown because it's pure and simple to read even non-rendered. You should avoid HTML to keep it as simple as possible.
11 |
12 | To avoid this limitations, Hugo created [shortcodes](https://gohugo.io/extras/shortcodes/). A shortcode is a simple snippet inside a page.
13 |
14 | **Hugo-theme-learn** provides multiple shortcodes on top of existing ones.
15 |
16 | {{%children style="h2" description="true" %}}
17 |
--------------------------------------------------------------------------------
/content/discuss/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Help & Discussion"
3 | weight: 100
4 | pre: " "
5 | ---
6 |
7 | We love talking about libp2p, and we'd be happy to have you in the mix.
8 |
9 | Visit our discussion forums at [discuss.libp2p.io](https://discuss.libp2p.io) to ask questions about [using libp2p](https://discuss.libp2p.io/c/users), discuss exciting [research](https://discuss.libp2p.io/c/research), and [stay up to date with important announcments](https://discuss.libp2p.io/c/news).
10 |
11 | We also often hang out on IRC, at [#libp2p on irc.freenode.org](irc://irc.freenode.org/%23libp2p). While IRC is a great place for a quick live chat, remember that discussions can get lost in a sea of messages. For long-lived discussion & support, [the discussion forums](https://discuss.libp2p.io) are the way to go.
12 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/button.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Button
3 | description : "Nice buttons on your page."
4 | ---
5 |
6 | A button is a just a clickable button with optional icon.
7 |
8 | ```
9 | {{%/* button href="https://getgrav.org/" */%}}Get Grav{{%/* /button */%}}
10 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" */%}}Get Grav with icon{{%/* /button */%}}
11 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" */%}}Get Grav with icon right{{%/* /button */%}}
12 | ```
13 |
14 | {{% button href="https://getgrav.org/" %}}Get Grav{{% /button %}}
15 | {{% button href="https://getgrav.org/" icon="fas fa-download" %}}Get Grav with icon{{% /button %}}
16 | {{% button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" %}}Get Grav with icon right{{% /button %}}
17 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/theme.toml:
--------------------------------------------------------------------------------
1 | # theme.toml template for a Hugo theme
2 | # See https://github.com/spf13/hugoThemes#themetoml for an example
3 |
4 | name = "Learn"
5 | license = "MIT"
6 | licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md"
7 | description = "Documentation theme for Hugo, based on Grav Learn theme"
8 | homepage = "https://github.com/matcornic/hugo-theme-learn/"
9 | repo = "https://github.com/matcornic/hugo-theme-learn"
10 | tags = ["documentation", "grav", "learn", "doc", "search"]
11 | features = ["documentation", "menu", "nested sections", "search", "mermaid"]
12 | min_version = 0.25
13 |
14 | [author]
15 | name = "Mathieu Cornic"
16 | homepage = "https://matcornic.github.io/"
17 |
18 | [original]
19 | name = "Grav Learn"
20 | homepage = "https://learn.getgrav.org/"
21 | repo = "https://github.com/getgrav/grav-learn"
22 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/layouts/shortcodes/ghcontributors.html:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Shortcodes
4 | pre: "3. "
5 | weight: 15
6 | ---
7 |
8 | Hugo utilise Markdown pour son format simple. Cependant, il y a beaucoup de chose que Markdown ne supporte pas bien. On pourrait utiliser du HTML pur pour améliorer les capacité du Markdown.
9 |
10 | Mais c'est probablement une mauvaise idée. Tout le monde utilise le Markdown parce que c'est pur et simple à lire même lorsqu'il est affiché en texte brut. Vous devez éviter le HTML autant que possible pour garder le contenu simple.
11 |
12 | Cependant, pour éviter les limitations, Hugo a créé les [shortcodes](https://gohugo.io/extras/shortcodes/). Un shortcode est un bout de code (*snippet*) dans une page.
13 |
14 | **Hugo-theme-learn** fournit de multiple shortcodes en plus de ceux existant.
15 |
16 | {{%children style="h2" description="true" %}}
17 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/button.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Button (Bouton)
3 | description : "De beaux boutons sur votre page."
4 | ---
5 |
6 | Le shortcode *button* est simplement un bouton cliquable avec une icône optionnelle.
7 |
8 | ```
9 | {{%/* button href="https://getgrav.org/" */%}}Téléchargez Grav{{%/* /button */%}}
10 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" */%}}Téléchargez Grav avec icône{{%/* /button */%}}
11 | {{%/* button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" */%}}Téléchargez Grav avec icône à droite{{%/* /button */%}}
12 | ```
13 |
14 | {{% button href="https://getgrav.org/" %}}Téléchargez Grav{{% /button %}}
15 | {{% button href="https://getgrav.org/" icon="fas fa-download" %}}Téléchargez Grav avec icône{{% /button %}}
16 | {{% button href="https://getgrav.org/" icon="fas fa-download" icon-position="right" %}}Téléchargez Grav avec icône à droite{{% /button %}}
17 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/layouts/partials/search.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ $assetBusting := not .Site.Params.disableAssetsBusting }}
7 |
8 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/notice.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notice
3 | description : "Disclaimers to help you structure your page"
4 | ---
5 |
6 | The notice shortcode shows 4 types of disclaimers to help you structure your page.
7 |
8 | ### Note
9 |
10 | ```
11 | {{%/* notice note */%}}
12 | A notice disclaimer
13 | {{%/* /notice */%}}
14 | ```
15 |
16 | renders as
17 |
18 | {{% notice note %}}
19 | A notice disclaimer
20 | {{% /notice %}}
21 |
22 | ### Info
23 |
24 | ```
25 | {{%/* notice info */%}}
26 | An information disclaimer
27 | {{%/* /notice */%}}
28 | ```
29 |
30 | renders as
31 |
32 | {{% notice info %}}
33 | An information disclaimer
34 | {{% /notice %}}
35 |
36 | ### Tip
37 |
38 | ```
39 | {{%/* notice tip */%}}
40 | A tip disclaimer
41 | {{%/* /notice */%}}
42 | ```
43 |
44 | renders as
45 |
46 | {{% notice tip %}}
47 | A tip disclaimer
48 | {{% /notice %}}
49 |
50 | ### Warning
51 |
52 | ```
53 | {{%/* notice warning */%}}
54 | An warning disclaimer
55 | {{%/* /notice */%}}
56 | ```
57 |
58 | renders as
59 |
60 | {{% notice warning %}}
61 | A warning disclaimer
62 | {{% /notice %}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/auto-complete.css:
--------------------------------------------------------------------------------
1 | .autocomplete-suggestions {
2 | text-align: left;
3 | cursor: default;
4 | border: 1px solid #ccc;
5 | border-top: 0;
6 | background: #fff;
7 | box-shadow: -1px 1px 3px rgba(0,0,0,.1);
8 |
9 | /* core styles should not be changed */
10 | position: absolute;
11 | display: none;
12 | z-index: 9999;
13 | max-height: 254px;
14 | overflow: hidden;
15 | overflow-y: auto;
16 | box-sizing: border-box;
17 |
18 | }
19 | .autocomplete-suggestion {
20 | position: relative;
21 | cursor: pointer;
22 | padding: 7px;
23 | line-height: 23px;
24 | white-space: nowrap;
25 | overflow: hidden;
26 | text-overflow: ellipsis;
27 | color: #333;
28 | }
29 |
30 | .autocomplete-suggestion b {
31 | font-weight: normal;
32 | color: #1f8dd6;
33 | }
34 |
35 | .autocomplete-suggestion.selected {
36 | background: #333;
37 | color: #fff;
38 | }
39 |
40 | .autocomplete-suggestion:hover {
41 | background: #444;
42 | color: #fff;
43 | }
44 |
45 | .autocomplete-suggestion > .context {
46 | font-size: 12px;
47 | }
48 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 MATHIEU CORNIC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/notice.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Notice
3 | description : "Message pour vous aider à structurer votre contenu"
4 | ---
5 |
6 | Le shortcode *Notice* permet d'afficher 4 types de message pour vous aider à structurer votre contenu.
7 |
8 | ### Note
9 |
10 | ```
11 | {{%/* notice note */%}}
12 | Une notice de type *note*
13 | {{%/* /notice */%}}
14 | ```
15 |
16 | s'affiche comme
17 |
18 | {{% notice note %}}
19 | Une notice de type *note*
20 | {{% /notice %}}
21 |
22 | ### Info
23 |
24 | ```
25 | {{%/* notice info */%}}
26 | Une notice de type *info*
27 | {{%/* /notice */%}}
28 | ```
29 |
30 | s'affiche comme
31 |
32 | {{% notice info %}}
33 | Une notice de type *info*
34 | {{% /notice %}}
35 |
36 | ### Tip
37 |
38 | ```
39 | {{%/* notice tip */%}}
40 | Une notice de type *tip*
41 | {{%/* /notice */%}}
42 | ```
43 |
44 | s'affiche comme
45 |
46 | {{% notice tip %}}
47 | Une notice de type *tip*
48 | {{% /notice %}}
49 |
50 | ### Warning
51 |
52 | ```
53 | {{%/* notice warning */%}}
54 | Une notice de type *warning*
55 | {{%/* /notice */%}}
56 | ```
57 |
58 | s'affiche comme
59 |
60 | {{% notice warning %}}
61 | Une notice de type *warning*
62 | {{% /notice %}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/layouts/shortcodes/attachments.html:
--------------------------------------------------------------------------------
1 |
2 |
6 | {{if eq .Page.File.BaseFileName "index"}}
7 | {{$.Scratch.Add "filesName" "files"}}
8 | {{else}}
9 | {{$.Scratch.Add "filesName" (printf "%s.files" .Page.File.BaseFileName)}}
10 | {{end}}
11 |
33 | {{.Inner}}
34 |
35 |
36 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Grav
4 | Copyright (c) 2016 MATHIEU CORNIC
5 | Copyright (c) 2017 Valere JEANTET
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | this software and associated documentation files (the "Software"), to deal in
9 | the Software without restriction, including without limitation the rights to
10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 | the Software, and to permit persons to whom the Software is furnished to do so,
12 | subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/layouts/partials/menu-footer.html:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/archetypes.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Archetypes
3 | weight: 10
4 | ---
5 |
6 | Using the command: `hugo new [relative new content path]`, you can start a content file with the date and title automatically set. While this is a welcome feature, active writers need more : [archetypes](https://gohugo.io/content/archetypes/).
7 |
8 | It is pre-configured skeleton pages with default front matter. Please refer to the documentation for types of page to understand the differences.
9 |
10 | ## Chapter {#archetypes-chapter}
11 |
12 | To create a Chapter page, run the following commands
13 |
14 | ```
15 | hugo new --kind chapter /_index.md
16 | ```
17 |
18 | It will create a page with predefined Front-Matter:
19 |
20 | ```markdown
21 | +++
22 | title = "{{ replace .Name "-" " " | title }}"
23 | date = {{ .Date }}
24 | weight = 5
25 | chapter = true
26 | pre = "X. "
27 | +++
28 |
29 | ### Chapter X
30 |
31 | # Some Chapter title
32 |
33 | Lorem Ipsum.
34 | ```
35 |
36 | ## Default
37 |
38 | To create a default page, run either one of the following commands
39 |
40 | ```
41 | # Either
42 | hugo new //_index.md
43 | # Or
44 | hugo new /.md
45 | ```
46 |
47 | It will create a page with predefined Front-Matter:
48 |
49 | ```markdown
50 | +++
51 | title = "{{ replace .Name "-" " " | title }}"
52 | date = {{ .Date }}
53 | weight = 5
54 | +++
55 |
56 | Lorem Ipsum.
57 | ```
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/featherlight.min.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Featherlight - ultra slim jQuery lightbox
3 | * Version 1.2.3 - http://noelboss.github.io/featherlight/
4 | *
5 | * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
6 | * MIT Licensed.
7 | **/
8 | @media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;min-width:30%;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight iframe{border:0}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:10px;margin-right:10px;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/icons.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Icons and logos
3 | weight: 27
4 | ---
5 |
6 | The Learn theme for Hugo loads the [**Font Awesome**](https://fontawesome.com) library, allowing you to easily display any icon or logo available in the Font Awesome free collection.
7 |
8 | ## Finding an icon
9 |
10 | 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.
11 |
12 | 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.
13 |
14 | The HTML to include the heart icon is:
15 |
16 | ```
17 |
18 | ```
19 |
20 | ## Including in markdown
21 |
22 | Paste the `` HTML into markup and Font Awesome will load the relevant icon.
23 |
24 | ```
25 | Built with from Grav and Hugo
26 | ```
27 |
28 | Which appears as
29 |
30 | Built with from Grav and Hugo
31 |
32 | ## Customising icons
33 |
34 | Font Awesome provides many ways to modify the icon
35 |
36 | * Change colour (by default the icon will inherit the parent colour)
37 | * Increase or decrease size
38 | * Rotate
39 | * Combine with other icons
40 |
41 | Check the full documentation on [web fonts with CSS](https://fontawesome.com/how-to-use/web-fonts-with-css) for more.
42 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/layouts/index.html:
--------------------------------------------------------------------------------
1 | {{ partial "header.html" . }}
2 |
3 | navigation
4 |
5 |
6 | {{if .Site.Home.Content }}
7 | {{.Site.Home.Content}}
8 | {{else}}
9 | {{if eq .Site.Language.Lang "fr"}}
10 |
Personaliser la page d'accueil
11 |
12 | Le site fonctionne. Ne pas oublier de personaliser cette page avec votre propre contenu. 3 manières de faire :
13 |
14 |
15 |
1. Créer un fichier _index.md dans le dossier content et le remplir de Markdown
16 |
2. Créer un fichier index.html dans le dossier static et le remplir de code HTML
17 |
3. Configurer le serveur http pour rediriger automatiquement la homepage vers la page de votre choix dans le site
18 |
19 | {{else}}
20 |
Customize your own home page
21 |
22 | The site is working. Don't forget to customize this homepage with your own. You typically have 3 choices :
23 |
24 |
25 |
1. Create an _index.md document in content folder and fill it with Markdown content
26 |
2. Create an index.html file in the static folder and fill the file with HTML content
27 |
3. Configure your server to automatically redirect home page to one your documentation page
28 |
29 | {{end}}
30 | {{ end }}
31 | {{ partial "footer.html" . }}
32 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/archetypes.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Archétypes
3 | weight: 10
4 | ---
5 |
6 | En utilisant la commande: `hugo new [chemin vers nouveau contenu]`, vous pouvez créer un nouveau fichier avec la date et le title automatiquement initialisé. Même si c'est une fonctionnalité intéressante, elle reste limitée pour les auteurs actifs qui ont besoin de mieux : les [archetypes](https://gohugo.io/content/archetypes/).
7 |
8 | Les archétypes sont des squelettes de pages préconfigurées avec un Front Matter par défaut. Merci de vous référer à la documentation pour connaitre les différents types de page.
9 |
10 | ## Chapitre {#archetypes-chapter}
11 |
12 | Pour créer un chapitre, lancez les commandes suivantes
13 |
14 | ```
15 | hugo new --kind chapter /_index.md
16 | ```
17 |
18 | Cela crééra une page avec le Front Matter suivant:
19 |
20 | ```markdown
21 | +++
22 | title = "{{ replace .Name "-" " " | title }}"
23 | date = {{ .Date }}
24 | weight = 5
25 | chapter = true
26 | pre = "X. "
27 | +++
28 |
29 | ### Chapter X
30 |
31 | # Some Chapter title
32 |
33 | Lorem Ipsum.
34 | ```
35 |
36 | ## Défaut
37 |
38 | Pour créer une page classique, lancer l'une des deux commandes suivantes
39 |
40 | ```
41 | # Soit
42 | hugo new //_index.md
43 | # Ou
44 | hugo new /.md
45 | ```
46 |
47 | Cela crééra une page avec le Front Matter suivant:
48 |
49 | ```markdown
50 | +++
51 | title = "{{ replace .Name "-" " " | title }}"
52 | date = {{ .Date }}
53 | weight = 5
54 | +++
55 |
56 | Lorem Ipsum.
57 | ```
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/credits.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Crédits
3 | disableToc: true
4 | ---
5 |
6 | ## Contributeurs
7 |
8 | Merci à eux de rendre le monde Open Source meilleur !
9 |
10 | {{% ghcontributors "https://api.github.com/repos/matcornic/hugo-theme-learn/contributors?per_page=100" %}}
11 |
12 | Et un grand merci à [@vjeantet](https://github.com/vjeantet) pour son travail sur [docdock](https://github.com/vjeantet/hugo-theme-docdock), un fork de _hugo-theme-learn_. La v2.0.0 du thème est en grande partie inspirée de son travail.
13 |
14 | ## Packages et librairies
15 | * [mermaid](https://knsv.github.io/mermaid) - géneration de diagrames et graphiques à partir de texte similaire à Markdown
16 | * [font awesome](http://fontawesome.io/) - Le framework de polices iconiques
17 | * [jQuery](https://jquery.com) - La plus connue des librairies Javascript
18 | * [lunr](https://lunrjs.com) - Lunr fournit des fonctions de recherche sans service externe
19 | * [horsey](https://bevacqua.github.io/horsey/) - Autocomplétion de composants (utiliser pour les suggestions de recherche)
20 | * [clipboard.js](https://zenorocha.github.io/clipboard.js) - Copier le texte dans le presse-papier
21 | * [highlight.js](https://highlightjs.org) - Mise en valeur de syntaxes
22 | * [modernizr](https://modernizr.com) - Une boite à outil Javascript qui permet aux développeurs d'utiliser les dernières fonctionnalités de CSS et HTML5, même sur de vieux navigateurs.
23 |
24 | ## Outils
25 |
26 | * [Netlify](https://www.netlify.com) - Déploiement continue et hébergement de cette documentation
27 | * [Hugo](https://gohugo.io/)
28 |
29 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/credits.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Credits
3 | disableToc: true
4 | ---
5 |
6 | ## Contributors
7 |
8 | Thanks to them for making Open Source Software a better place !
9 |
10 | {{% ghcontributors "https://api.github.com/repos/matcornic/hugo-theme-learn/contributors?per_page=100" %}}
11 |
12 | And a special thanks to [@vjeantet](https://github.com/vjeantet) for his work on [docdock](https://github.com/vjeantet/hugo-theme-docdock), a fork of hugo-theme-learn. v2.0.0 of this theme is inspired by his work.
13 |
14 | ## Packages and libraries
15 | * [mermaid](https://knsv.github.io/mermaid) - generation of diagram and flowchart from text in a similar manner as markdown
16 | * [font awesome](http://fontawesome.io/) - the iconic font and CSS framework
17 | * [jQuery](https://jquery.com) - The Write Less, Do More, JavaScript Library
18 | * [lunr](https://lunrjs.com) - Lunr enables you to provide a great search experience without the need for external, server-side, search services...
19 | * [horsey](https://bevacqua.github.io/horsey/) - Progressive and customizable autocomplete component
20 | * [clipboard.js](https://zenorocha.github.io/clipboard.js) - copy text to clipboard
21 | * [highlight.js](https://highlightjs.org) - Javascript syntax highlighter
22 | * [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
23 |
24 | ## Tooling
25 |
26 | * [Netlify](https://www.netlify.com) - Continuous deployement and hosting of this documentation
27 | * [Hugo](https://gohugo.io/)
28 |
29 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/hybrid.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid)
4 |
5 | */
6 |
7 | /*background color*/
8 | .hljs {
9 | display: block;
10 | overflow-x: auto;
11 | padding: 0.5em;
12 | background: #1d1f21;
13 | }
14 |
15 | /*selection color*/
16 | .hljs::selection,
17 | .hljs span::selection {
18 | background: #373b41;
19 | }
20 |
21 | .hljs::-moz-selection,
22 | .hljs span::-moz-selection {
23 | background: #373b41;
24 | }
25 |
26 | /*foreground color*/
27 | .hljs {
28 | color: #c5c8c6;
29 | }
30 |
31 | /*color: fg_yellow*/
32 | .hljs-title,
33 | .hljs-name {
34 | color: #f0c674;
35 | }
36 |
37 | /*color: fg_comment*/
38 | .hljs-comment,
39 | .hljs-meta,
40 | .hljs-meta .hljs-keyword {
41 | color: #707880;
42 | }
43 |
44 | /*color: fg_red*/
45 | .hljs-number,
46 | .hljs-symbol,
47 | .hljs-literal,
48 | .hljs-deletion,
49 | .hljs-link {
50 | color: #cc6666
51 | }
52 |
53 | /*color: fg_green*/
54 | .hljs-string,
55 | .hljs-doctag,
56 | .hljs-addition,
57 | .hljs-regexp,
58 | .hljs-selector-attr,
59 | .hljs-selector-pseudo {
60 | color: #b5bd68;
61 | }
62 |
63 | /*color: fg_purple*/
64 | .hljs-attribute,
65 | .hljs-code,
66 | .hljs-selector-id {
67 | color: #b294bb;
68 | }
69 |
70 | /*color: fg_blue*/
71 | .hljs-keyword,
72 | .hljs-selector-tag,
73 | .hljs-bullet,
74 | .hljs-tag {
75 | color: #81a2be;
76 | }
77 |
78 | /*color: fg_aqua*/
79 | .hljs-subst,
80 | .hljs-variable,
81 | .hljs-template-tag,
82 | .hljs-template-variable {
83 | color: #8abeb7;
84 | }
85 |
86 | /*color: fg_orange*/
87 | .hljs-type,
88 | .hljs-built_in,
89 | .hljs-builtin-name,
90 | .hljs-quote,
91 | .hljs-section,
92 | .hljs-selector-class {
93 | color: #de935f;
94 | }
95 |
96 | .hljs-emphasis {
97 | font-style: italic;
98 | }
99 |
100 | .hljs-strong {
101 | font-weight: bold;
102 | }
103 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/children/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Children
3 | description : List the child pages of a page
4 | ---
5 |
6 | Use the children shortcode to list the child pages of a page and the further descendants (children's children). By default, the shortcode displays links to the child pages.
7 |
8 | ## Usage
9 |
10 | | Parameter | Default | Description |
11 | |:--|:--|:--|
12 | | page | _current_ | Specify the page name (section name) to display children for |
13 | | style | "li" | Choose the style used to display descendants. It could be any HTML tag name |
14 | | showhidden | "false" | When true, child pages hidden from the menu will be displayed |
15 | | description | "false" | Allows you to include a short text under each page in the list. when no description exists for the page, children shortcode takes the first 70 words of your content. [read more info about summaries on gohugo.io](https://gohugo.io/content/summaries/) |
16 | | depth | 1 | Enter a number to specify the depth of descendants to display. For example, if the value is 2, the shortcode will display 2 levels of child pages. **Tips:** set 999 to get all descendants|
17 | | sort | none | Sort Children By
Weight - to sort on menu order
Name - to sort alphabetically on menu label
Identifier - to sort alphabetically on identifier set in frontmatter
URL - URL
|
18 |
19 | ## Demo
20 |
21 | {{%/* children */%}}
22 |
23 | {{% children %}}
24 |
25 | {{%/* children description="true" */%}}
26 |
27 | {{%children description="true" %}}
28 |
29 | {{%/* children depth="3" showhidden="true" */%}}
30 |
31 | {{% children depth="3" showhidden="true" %}}
32 |
33 | {{%/* children style="h2" depth="3" description="true" */%}}
34 |
35 | {{% children style="h2" depth="3" description="true" %}}
36 |
37 | {{%/* children style="div" depth="999" */%}}
38 |
39 | {{% children style="div" depth="999" %}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/children/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Children (Pages filles)
3 | description : Liste les pages filles de la page
4 | ---
5 |
6 | Utilisez le shortcode *children* pour lister les pages filles de la page et tous ses déscendants (pages filles de pages filles). Par défaut, le shortcode affiche des liens vers les pages filles.
7 |
8 | ## Utilisation
9 |
10 | | Paramètre | Défaut | Description |
11 | |:--|:--|:--|
12 | | page | _current_ | Spécifie le nom de la page (nom de la section) à afficher |
13 | | style | "li" | Choisi le style à utiliser pour afficher les descendants. Cela peut être n'importe quel balise HTML |
14 | | showhidden | "false" | Quand *true*, pages filles cachées dans le menu seront affichées quand même |
15 | | description | "false" | Permet d'inclure le texte de la description de la page sous chaque entré de la liste. quand aucune description existe pour la page, le shortcode prend les 70 premiers mots du contenu. [plus d'infos sur gohugo.io](https://gohugo.io/content/summaries/) |
16 | | depth | 1 | Nombre de descendants à afficher. Par exemple, si la valeur est 2, le shortcode va afficher 2 niveaux de pages filels. **Astuce:** Utilisez 999 pour avoir tous les descendants|
17 | | sort | | Tri les pages filles par
Weight - Poids
Name - Nom
Identifier - Trier alphabétiquement par identifiant configuré dans le front matter
URL - URL
|
18 |
19 | ## Démo
20 |
21 | {{%/* children */%}}
22 |
23 | {{% children %}}
24 |
25 | {{%/* children description="true" */%}}
26 |
27 | {{%children description="true" %}}
28 |
29 | {{%/* children depth="3" showhidden="true" */%}}
30 |
31 | {{% children depth="3" showhidden="true" %}}
32 |
33 | {{%/* children style="h2" depth="3" description="true" */%}}
34 |
35 | {{% children style="h2" depth="3" description="true" %}}
36 |
37 | {{%/* children style="div" depth="999" */%}}
38 |
39 | {{% children style="div" depth="999" %}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | SHELL=/bin/bash
2 | DOMAIN="docs.libp2p.io"
3 |
4 | IPFSLOCAL="http://localhost:8080/ipfs/"
5 | IPFSGATEWAY="https://ipfs.io/ipfs/"
6 | NPM=npm
7 | NPMBIN=./node_modules/.bin
8 | OUTPUTDIR=public
9 | PKGDIR=content/reference/pkg
10 | PORT=1313
11 |
12 | ifeq ($(DEBUG), true)
13 | PREPEND=
14 | APPEND=
15 | else
16 | PREPEND=@
17 | APPEND=1>/dev/null
18 | endif
19 |
20 | # Where Hugo should be installed locally
21 | HUGO_LOCAL=./bin/hugo
22 | # Path to Hugo binary to use when building the site
23 | HUGO_BINARY=$(HUGO_LOCAL)
24 | HUGO_VERSION=0.54.0
25 | PLATFORM:=$(shell uname)
26 | ifeq ('$(PLATFORM)', 'Darwin')
27 | PLATFORM=macOS
28 | endif
29 | MACH:=$(shell uname -m)
30 | ifeq ('$(MACH)', 'x86_64')
31 | MACH=64bit
32 | else
33 | MACH=32bit
34 | endif
35 | HUGO_URL="https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_$(PLATFORM)-$(MACH).tar.gz"
36 |
37 |
38 | bin/hugo:
39 | @echo "Installing Hugo to $(HUGO_LOCAL)..."
40 | $(PREPEND)mkdir -p tmp_hugo $(APPEND)
41 | $(PREPEND)curl --location "$(HUGO_URL)" | tar -xzf - -C tmp_hugo && chmod +x tmp_hugo/hugo && mv tmp_hugo/hugo $(HUGO_LOCAL) $(APPEND)
42 | $(PREPEND)rm -rf tmp_hugo $(APPEND)
43 |
44 | install: bin/hugo
45 |
46 | build: clean install
47 | $(PREPEND)$(HUGO_BINARY) && \
48 | echo "" && \
49 | echo "Site built out to ./$(OUTPUTDIR)"
50 |
51 | dev: bin/hugo
52 | $(PREPEND)( \
53 | $(HUGO_BINARY) server -w --port $(PORT) --bind 0.0.0.0 \
54 | )
55 |
56 | serve:
57 | $(PREPEND)$(HUGO_BINARY) server
58 |
59 | deploy:
60 | export hash=`ipfs add -r -Q $(OUTPUTDIR)`; \
61 | echo ""; \
62 | echo "published website:"; \
63 | echo "- $(IPFSLOCAL)$$hash"; \
64 | echo "- $(IPFSGATEWAY)$$hash"; \
65 | echo ""; \
66 | echo "next steps:"; \
67 | echo "- ipfs pin add -r /ipfs/$$hash"; \
68 | echo "- make publish-to-domain"
69 |
70 | clean:
71 | $(PREPEND)[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
72 | $(PREPEND)[ ! -d $(PKGDIR) ] || rm -rf $(PKGDIR)/*/
73 | $(PREPEND)[ ! -d build/assets ] || rm -rf build/assets/*
74 |
75 | .PHONY: build help deploy publish-to-domain clean
76 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/expand.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Expand
3 | description : "Affiche une section de texte qui se plie et se déplie"
4 | ---
5 |
6 | Le shortcode *Expand* affiche une section de texte qui se plie et se déplie.
7 | Ci-dessous un exemple.
8 |
9 | {{%expand%}}
10 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
11 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
12 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
13 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
14 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
15 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
16 | {{%/expand%}}
17 |
18 |
19 | ## Utilisation
20 |
21 |
22 | Ce shortcode prends exactement un paramètre optionel pour définir le texte à côté de l'icone. (valeur par défaut est "Déroulez-moi...")
23 |
24 | {{%/*expand "Est-ce que ce thème envoie du pâté ?" */%}}Oui !.{{%/* /expand*/%}}
25 |
26 | {{%expand "Est-ce que ce thème envoie du pâté ?" %}}Oui !{{% /expand%}}
27 |
28 | # Demo
29 |
30 | {{%/*expand*/%}}
31 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
32 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
33 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
34 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
35 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
36 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
37 | {{%/* /expand*/%}}
38 |
39 |
40 | {{%expand%}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
41 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
42 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
43 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
44 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
45 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{% /expand%}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/expand.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : Expand
3 | description : "Displays an expandable/collapsible section of text on your page"
4 | ---
5 |
6 | The Expand shortcode displays an expandable/collapsible section of text on your page.
7 | Here is an example
8 |
9 | {{%expand%}}
10 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
11 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
12 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
13 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
14 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
15 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
16 | {{%/expand%}}
17 |
18 |
19 | ## Usage
20 |
21 |
22 | this shortcode takes exactly one optional parameter to define the text that appears next to the expand/collapse icon. (default is "Expand me...")
23 |
24 | {{%/*expand "Is this learn theme rocks ?" */%}}Yes !.{{%/* /expand*/%}}
25 |
26 | {{%expand "Is this learn theme rocks ?" %}}Yes !{{% /expand%}}
27 |
28 | # Demo
29 |
30 | {{%/*expand*/%}}
31 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
32 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
33 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
34 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
35 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
36 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
37 | {{%/* /expand*/%}}
38 |
39 |
40 | {{%expand%}}Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
41 | tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
42 | quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
43 | consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
44 | cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
45 | proident, sunt in culpa qui officia deserunt mollit anim id est laborum.{{% /expand%}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/config.toml:
--------------------------------------------------------------------------------
1 | baseURL = "/"
2 | languageCode = "en-US"
3 | defaultContentLanguage = "en"
4 |
5 | title = "Hugo Learn Documentation"
6 | theme = "hugo-theme-learn"
7 | themesdir = "../.."
8 | metaDataFormat = "yaml"
9 | defaultContentLanguageInSubdir= true
10 |
11 | [params]
12 | editURL = "https://github.com/matcornic/hugo-theme-learn/edit/master/exampleSite/content/"
13 | description = "Documentation for Hugo Learn Theme"
14 | author = "Mathieu Cornic"
15 | showVisitedLinks = true
16 | disableBreadcrumb = false
17 | disableNextPrev = false
18 |
19 | [outputs]
20 | home = [ "HTML", "RSS", "JSON"]
21 |
22 | [Languages]
23 | [Languages.en]
24 | title = "Documentation for Hugo Learn Theme"
25 | weight = 1
26 | languageName = "English"
27 |
28 | [[Languages.en.menu.shortcuts]]
29 | name = " Github repo"
30 | identifier = "ds"
31 | url = "https://github.com/matcornic/hugo-theme-learn"
32 | weight = 10
33 |
34 | [[Languages.en.menu.shortcuts]]
35 | name = " Showcases"
36 | url = "showcase"
37 | weight = 11
38 |
39 | [[Languages.en.menu.shortcuts]]
40 | name = " Hugo Documentation"
41 | identifier = "hugodoc"
42 | url = "https://gohugo.io/"
43 | weight = 20
44 |
45 | [[Languages.en.menu.shortcuts]]
46 | name = " Credits"
47 | url = "/credits"
48 | weight = 30
49 |
50 | [Languages.fr]
51 | title = "Documentation du thème Hugo Learn"
52 | weight = 2
53 | languageName = "Français"
54 |
55 | [[Languages.fr.menu.shortcuts]]
56 | name = " Repo Github"
57 | identifier = "ds"
58 | url = "https://github.com/matcornic/hugo-theme-learn"
59 | weight = 10
60 |
61 | [[Languages.fr.menu.shortcuts]]
62 | name = " Vitrine"
63 | url = "/showcase"
64 | weight = 11
65 |
66 | [[Languages.fr.menu.shortcuts]]
67 | name = " Documentation Hugo"
68 | identifier = "hugodoc"
69 | url = "https://gohugo.io/"
70 | weight = 20
71 |
72 | [[Languages.fr.menu.shortcuts]]
73 | name = " Crédits"
74 | url = "/credits"
75 | weight = 30
76 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/attachments.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Attachments
3 | description : "The Attachments shortcode displays a list of files attached to a page."
4 | ---
5 |
6 | The Attachments shortcode displays a list of files attached to a page.
7 |
8 | {{% attachments /%}}
9 |
10 | ## Usage
11 |
12 | The shortcurt lists files found in a **specific folder**.
13 | Currently, it support two implementations for pages
14 |
15 | 1. If your page is a markdown file, attachements must be place in a **folder** named like your page and ending with **.files**.
16 |
17 | > * content
18 | > * _index.md
19 | > * page.files
20 | > * attachment.pdf
21 | > * page.md
22 |
23 | 2. If your page is a **folder**, attachements must be place in a nested **'files'** folder.
24 |
25 | > * content
26 | > * _index.md
27 | > * page
28 | > * index.md
29 | > * files
30 | > * attachment.pdf
31 |
32 | Be aware that if you use a multilingual website, you will need to have as many folders as languages.
33 |
34 | That's all !
35 |
36 | ### Parameters
37 |
38 | | Parameter | Default | Description |
39 | |:--|:--|:--|
40 | | title | "Attachments" | List's title |
41 | | style | "" | Choose between "orange", "grey", "blue" and "green" for nice style |
42 | | pattern | ".*" | A regular expressions, used to filter the attachments by file name.
The **pattern** parameter value must be [regular expressions](https://en.wikipedia.org/wiki/Regular_expression).
43 |
44 | For example:
45 |
46 | * To match a file suffix of 'jpg', use **.*jpg** (not *.jpg).
47 | * To match file names ending in 'jpg' or 'png', use **.*(jpg|png)**
48 |
49 | ### Examples
50 |
51 | #### List of attachments ending in pdf or mp4
52 |
53 |
54 | {{%/*attachments title="Related files" pattern=".*(pdf|mp4)"/*/%}}
55 |
56 | renders as
57 |
58 | {{%attachments title="Related files" pattern=".*(pdf|mp4)"/%}}
59 |
60 | #### Colored styled box
61 |
62 | {{%/*attachments style="orange" /*/%}}
63 |
64 | renders as
65 |
66 | {{% attachments style="orange" /%}}
67 |
68 |
69 | {{%/*attachments style="grey" /*/%}}
70 |
71 | renders as
72 |
73 | {{% attachments style="grey" /%}}
74 |
75 | {{%/*attachments style="blue" /*/%}}
76 |
77 | renders as
78 |
79 | {{% attachments style="blue" /%}}
80 |
81 | {{%/*attachments style="green" /*/%}}
82 |
83 | renders as
84 |
85 | {{% attachments style="green" /%}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Learn Theme for Hugo"
3 | ---
4 |
5 | # Hugo learn theme
6 |
7 | [Hugo-theme-learn](http://github.com/matcornic/hugo-theme-learn) is a theme for [Hugo](https://gohugo.io/), a fast and modern static website engine written in Go. Where Hugo is often used for blogs, this multilingual-ready theme is **fully designed for documentation**.
8 |
9 | This theme is a partial porting of the [Learn theme](http://learn.getgrav.org/) of [Grav](https://getgrav.org/), a modern flat-file CMS written in PHP.
10 |
11 | {{% notice tip %}}Learn theme works with a _page tree structure_ to organize content : All contents are pages, which belong to other pages. [read more about this]({{%relref "cont/pages/_index.md"%}})
12 | {{% /notice %}}
13 |
14 | ## Main features
15 |
16 | * [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}})
17 | * [Multilingual mode]({{%relref "cont/i18n/_index.md" %}})
18 | * **Unlimited menu levels**
19 | * **Automatic next/prev buttons to navigate through menu entries**
20 | * [Image resizing, shadow...]({{%relref "cont/markdown.en.md#images" %}})
21 | * [Attachments files]({{%relref "shortcodes/attachments.en.md" %}})
22 | * [List child pages]({{%relref "shortcodes/children/_index.md" %}})
23 | * [Mermaid diagram]({{%relref "shortcodes/mermaid.en.md" %}}) (flowchart, sequence, gantt)
24 | * [Customizable look and feel and themes variants]({{%relref "basics/style-customization/_index.md"%}})
25 | * [Buttons]({{%relref "shortcodes/button.en.md" %}}), [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice.en.md" %}}), [Expand]({{%relref "shortcodes/expand.en.md" %}})
26 |
27 | 
28 |
29 | ## Contribute to this documentation
30 | Feel free to update this content, just click the **Edit this page** link displayed on top right of each page, and pullrequest it
31 |
32 | {{% notice info %}}
33 | Your modification will be deployed automatically when merged.
34 | {{% /notice %}}
35 |
36 | ## Documentation website
37 | This current documentation has been statically generated with Hugo with a simple command : `hugo -t hugo-theme-learn` -- source code is [available here at GitHub](https://github.com/matcornic/hugo-theme-learn)
38 |
39 | {{% notice note %}}
40 | Automatically published and hosted thanks to [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/)
41 | {{% /notice %}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/layouts/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ partial "meta.html" . }} {{ partial "favicon.html" . }} {{ .Scratch.Add "title" "" }}{{ if eq .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
6 | {{ .Scratch.Get "title" }}
7 |
8 | {{ $assetBusting := not .Site.Params.disableAssetsBusting }}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{with .Site.Params.themeVariant}}
18 |
19 | {{end}}
20 |
35 | {{ partial "custom-header.html" . }}
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/README.md:
--------------------------------------------------------------------------------
1 | # Hugo Learn Theme
2 |
3 | This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](https://learn.getgrav.org/).
4 |
5 | Visit the [theme documentation](https://learn.netlify.com/en/) to see what is going on. It is actually built with this theme.
6 |
7 | [](https://app.wercker.com/project/byKey/233466a2be73fcea400e7dc02ef6adf9)
8 | [](https://app.fossa.io/projects/git%2Bgithub.com%2Fmatcornic%2Fhugo-theme-learn?ref=badge_shield)
9 |
10 | ## Main features
11 |
12 | - Automatic Search
13 | - Multilingual mode
14 | - Unlimited menu levels
15 | - Automatic next/prev buttons to navigate through menu entries
16 | - Image resizing, shadow…
17 | - Attachments files
18 | - List child pages
19 | - Mermaid diagram (flowchart, sequence, gantt)
20 | - Customizable look and feel and themes variants
21 | - Buttons, Tip/Note/Info/Warning boxes, Expand
22 |
23 | ## Installation
24 |
25 | Navigate to your themes folder in your Hugo site and use the following commands:
26 |
27 | ```
28 | $ cd themes
29 | $ git clone https://github.com/matcornic/hugo-theme-learn.git
30 | ```
31 |
32 | Check that your Hugo version is minimum `0.25` with `hugo version`.
33 |
34 | 
35 |
36 | ## Usage
37 |
38 | - [Visit the documentation](https://learn.netlify.com/en/)
39 |
40 | ## Download old versions (prior to 2.0.0)
41 |
42 | If you need old version for compatibility purpose, either download [theme source code from releases](https://github.com/matcornic/hugo-theme-learn/releases) or use the right git tag. For example, with `1.1.0`
43 |
44 | - Direct download way: https://github.com/matcornic/hugo-theme-learn/archive/1.1.0.zip
45 | - Git way:
46 |
47 | ```shell
48 | cd themes/hugo-theme-learn
49 | git checkout tags/1.1.0
50 | ```
51 |
52 | For both solutions, the documentation is available at https://github.com/matcornic/hugo-theme-learn/releases/download/1.1.0/hugo-learn-doc-1.1.0.zip
53 |
54 | ## Credits
55 |
56 | Many thanks to [@vjeantet](https://github.com/vjeantet/) for the fork [docdock](https://github.com/vjeantet/hugo-theme-docdock). The v2 of this theme is mainly based on his work !
57 |
58 |
59 | ## License
60 | [](https://app.fossa.io/projects/git%2Bgithub.com%2Fmatcornic%2Fhugo-theme-learn?ref=badge_large)
61 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/attachments.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Attachments (Pièces jointes)
3 | description : "The Attachments shortcode displays a list of files attached to a page."
4 | ---
5 |
6 | Le shortcode *Attachments* affiche une liste de pièces jointes d'une page.
7 |
8 | {{% attachments /%}}
9 |
10 | ## Utilisation
11 |
12 | Le shortcode affiche la liste de fichiers trouvés dans un **dossier spécifique**
13 | A l'heure actuelle, il supporte deux implémentations
14 |
15 | 1. Si votre page est un fichier Markdown, les pièces jointes doivent être placée dans un **dossier** nommé comme le nom de la page et suffixé par **.files**.
16 |
17 | > * content
18 | > * _index.md
19 | > * page.files
20 | > * attachment.pdf
21 | > * page.md
22 |
23 | 2. Si votre page est un **dossier**, les pièces jointes doivent être placées dans un dossier fils **'files'**.
24 |
25 | > * content
26 | > * _index.md
27 | > * page
28 | > * index.md
29 | > * files
30 | > * attachment.pdf
31 |
32 | Attention, si votre site est multi-langue, vous devrez avec autant de dossier qu'il y a de langues.
33 |
34 | C'est tout !
35 |
36 | ### Paramètres
37 |
38 | | Paramètre | Défaut | Description |
39 | |:--|:--|:--|
40 | | title | "Pièces jointes" | Titre de la liste |
41 | | style | "" | Choisir entre "orange", "grey", "blue" et "green" pour un style plus sympa |
42 | | pattern | ".*" | Une expression régulière, utilisée pour filtrer les pièces jointes par leur nom de fichier.
Le paramètre **pattern** doit être une [expression régulière](https://en.wikipedia.org/wiki/Regular_expression).
43 |
44 | Par exemple:
45 |
46 | * Pour trouver les fichiers avec le suffixe 'jpg', utilisez **.*jpg** (pas *.jpg).
47 | * Pour trouver les fichiers avec les suffixe 'jpg' ou 'png', utilisez **.*(jpg|png)**
48 |
49 | ### Exemples
50 |
51 | #### Lister les pièces jointes de type pdf ou mp4
52 |
53 |
54 | {{%/*attachments title="Fichiers associés" pattern=".*(pdf|mp4)"/*/%}}
55 |
56 | s'affiche comme
57 |
58 | {{%attachments title="Fichiers associés" pattern=".*(pdf|mp4)"/%}}
59 |
60 | #### Modifier le style
61 |
62 | {{%/*attachments style="orange" /*/%}}
63 |
64 | s'affiche comme
65 |
66 | {{% attachments style="orange" /%}}
67 |
68 |
69 | {{%/*attachments style="grey" /*/%}}
70 |
71 | s'affiche comme
72 |
73 | {{% attachments style="grey" /%}}
74 |
75 | {{%/*attachments style="blue" /*/%}}
76 |
77 | s'affiche comme
78 |
79 | {{% attachments style="blue" /%}}
80 |
81 | {{%/*attachments style="green" /*/%}}
82 |
83 | s'affiche comme
84 |
85 | {{% attachments style="green" /%}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Learn Theme for Hugo"
3 | ---
4 |
5 | # Thème Hugo learn
6 |
7 | [Hugo-theme-learn](http://github.com/matcornic/hugo-theme-learn) est un thème pour [Hugo](https://gohugo.io/), un générateur de site statique, rapide et modern, écrit en Go. Tandis que Hugo est souvent utilisé pour des blogs, ce thème multi-langue est **entièrement conçu pour la documentation**.
8 |
9 | Ce thème est un portage partiel du [thème Learn](http://learn.getgrav.org/) de [Grav](https://getgrav.org/), un CMS modern écrit en PHP.
10 |
11 | {{% notice tip %}}Le thème Learn fonctionne grâce à la structure de page aborescentes pour organiser le contenu: tous les contenus sont des pages qui appartiennent à d'autres pages. [Plus d'infos]({{%relref "cont/pages/_index.md"%}})
12 | {{% /notice %}}
13 |
14 | ## Fonctionnalités principales
15 |
16 | * [Recherche automatique]({{%relref "basics/configuration/_index.md#activer-recherche" %}})
17 | * [Mode multi-langue]({{%relref "cont/i18n/_index.md" %}})
18 | * **Nombre de niveau infini dans le menu**
19 | * **Boutons suivant/précédent automatiquement générés pour naviguer entre les items du menu**
20 | * [Taille d'image, ombres...]({{%relref "cont/markdown.fr.md#images" %}})
21 | * [Fichiers joints]({{%relref "shortcodes/attachments.fr.md" %}})
22 | * [Lister les pages filles]({{%relref "shortcodes/children/_index.md" %}})
23 | * [Diagrammes Mermaid]({{%relref "shortcodes/mermaid.fr.md" %}}) (flowchart, sequence, gantt)
24 | * [Style configurable and variantes de couleurs]({{%relref "basics/style-customization/_index.md"%}})
25 | * [Boutons]({{%relref "shortcodes/button.fr.md" %}}), [Messages Astuce/Note/Info/Attention]({{%relref "shortcodes/notice.fr.md" %}}), [Expand]({{%relref "shortcodes/expand.fr.md" %}})
26 |
27 | 
28 |
29 | ## Contribuer à cette documentation
30 |
31 | N'hésitez pas à mettre à jour ce contenu en cliquant sur le lien **Modifier cette page** en haut de chaque page, et créer la Pull Request associée.
32 |
33 | {{% notice info %}}
34 | Votre modification sera déployée automatiquement quand elle sera mergée.
35 | {{% /notice %}}
36 |
37 | ## Site de documentation
38 |
39 | Cette documentation statique a été générée avec Hugo avec une simple commande : `hugo -t hugo-theme-learn` -- le code source est [disponible sur Github](https://github.com/matcornic/hugo-theme-learn)
40 |
41 | {{% notice note %}}
42 | Le site est auomatiquement publié et hébergé par [Netlify](https://www.netlify.com/). Plus d'infos sur le [déploiement de site Hugo avec Netlify](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)(En anglais)
43 | {{% /notice %}}
44 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/basics/configuration/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Configuration
4 | weight: 20
5 | ---
6 |
7 | ## Global site parameters
8 |
9 | On top of [Hugo global configuration](https://gohugo.io/overview/configuration/), **Hugo-theme-learn** lets you define the following parameters in your `config.toml` (here, values are default).
10 |
11 | Note that some of these parameters are explained in details in other sections of this documentation.
12 |
13 | ```toml
14 | [params]
15 | # Prefix URL to edit current page. Will display an "Edit this page" button on top right hand corner of every page.
16 | # Useful to give opportunity to people to create merge request for your doc.
17 | # See the config.toml file from this documentation site to have an example.
18 | editURL = ""
19 | # Author of the site, will be used in meta information
20 | author = ""
21 | # Description of the site, will be used in meta information
22 | description = ""
23 | # Shows a checkmark for visited pages on the menu
24 | showVisitedLinks = false
25 | # Disable search function. It will hide search bar
26 | disableSearch = false
27 | # Javascript and CSS cache are automatically busted when new version of site is generated.
28 | # Set this to true to disable this behavior (some proxies don't handle well this optimization)
29 | disableAssetsBusting = false
30 | # Set this to true to disable copy-to-clipboard button for inline code.
31 | disableInlineCopyToClipBoard = false
32 | # A title for shortcuts in menu is set by default. Set this to true to disable it.
33 | disableShortcutsTitle = false
34 | # When using mulitlingual website, disable the switch language button.
35 | disableLanguageSwitchingButton = false
36 | # Hide breadcrumbs in the header and only show the current page title
37 | disableBreadcrumb = true
38 | # Hide Next and Previous page buttons normally displayed full height beside content
39 | disableNextPrev = true
40 | # Order sections in menu by "weight" or "title". Default to "weight"
41 | ordersectionsby = "weight"
42 | # Change default color scheme with a variant one. Can be "red", "blue", "green".
43 | themeVariant = ""
44 | ```
45 |
46 | ## Activate search
47 |
48 | If not already present, add the follow lines in the same `config.toml` file.
49 |
50 | ```toml
51 | [outputs]
52 | home = [ "HTML", "RSS", "JSON"]
53 | ```
54 |
55 | Learn theme uses the last improvement available in hugo version 20+ to generate a json index file ready to be consumed by lunr.js javascript search engine.
56 |
57 | > Hugo generate lunrjs index.json at the root of public folder.
58 | > When you build the site with `hugo server`, hugo generates it internally and of course it doesn’t show up in the filesystem
59 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/js/hugo-learn.js:
--------------------------------------------------------------------------------
1 | // Get Parameters from some url
2 | var getUrlParameter = function getUrlParameter(sPageURL) {
3 | var url = sPageURL.split('?');
4 | var obj = {};
5 | if (url.length == 2) {
6 | var sURLVariables = url[1].split('&'),
7 | sParameterName,
8 | i;
9 | for (i = 0; i < sURLVariables.length; i++) {
10 | sParameterName = sURLVariables[i].split('=');
11 | obj[sParameterName[0]] = sParameterName[1];
12 | }
13 | return obj;
14 | } else {
15 | return undefined;
16 | }
17 | };
18 |
19 | // Execute actions on images generated from Markdown pages
20 | var images = $("div#body-inner img").not(".inline");
21 | // Wrap image inside a featherlight (to get a full size view in a popup)
22 | images.wrap(function(){
23 | var image =$(this);
24 | if (!image.parent("a").length) {
25 | return "";
26 | }
27 | });
28 |
29 | // Change styles, depending on parameters set to the image
30 | images.each(function(index){
31 | var image = $(this)
32 | var o = getUrlParameter(image[0].src);
33 | if (typeof o !== "undefined") {
34 | var h = o["height"];
35 | var w = o["width"];
36 | var c = o["classes"];
37 | image.css("width", function() {
38 | if (typeof w !== "undefined") {
39 | return w;
40 | } else {
41 | return "auto";
42 | }
43 | });
44 | image.css("height", function() {
45 | if (typeof h !== "undefined") {
46 | return h;
47 | } else {
48 | return "auto";
49 | }
50 | });
51 | if (typeof c !== "undefined") {
52 | var classes = c.split(',');
53 | for (i = 0; i < classes.length; i++) {
54 | image.addClass(classes[i]);
55 | }
56 | }
57 | }
58 | });
59 |
60 | // Stick the top to the top of the screen when scrolling
61 | $(document).ready(function(){
62 | $("#top-bar").sticky({topSpacing:0, zIndex: 1000});
63 | });
64 |
65 |
66 | jQuery(document).ready(function() {
67 | // Add link button for every
68 | var text, clip = new Clipboard('.anchor');
69 | $("h1~h2,h1~h3,h1~h4,h1~h5,h1~h6").append(function(index, html){
70 | var element = $(this);
71 | var url = encodeURI(document.location.origin + document.location.pathname);
72 | var link = url + "#"+element[0].id;
73 | return " " +
74 | "" +
75 | ""
76 | ;
77 | });
78 |
79 | $(".anchor").on('mouseleave', function(e) {
80 | $(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');
81 | });
82 |
83 | clip.on('success', function(e) {
84 | e.clearSelection();
85 | $(e.trigger).attr('aria-label', 'Link copied to clipboard!').addClass('tooltipped tooltipped-s');
86 | });
87 |
88 | });
89 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/basics/configuration/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Configuration
4 | weight: 20
5 | ---
6 |
7 | ## Paramètres globaux du site
8 |
9 | En plus de la [configuration globale d'Hugo](https://gohugo.io/overview/configuration/), **Hugo-theme-learn** vous permet de définir les paramètres suivant dans votre fichier `config.toml` (ci-dessous sont affichées les valeurs par défaut).
10 |
11 | Notez que certains de ces paramètres sont expliqués en détails dans d'autres sections de cette documentation.
12 |
13 | ```toml
14 | [params]
15 | # L'URL préfixe pour éditer la page courante. Ce paramètre affichera un bouton "Modifier cette page" on haut de de chacune des pages.
16 | # Pratique pour donner les possibilité à vos utilisateurs de créer une merge request pour votre doc.
17 | # Allez voir le fichier config.toml de cette documentation pour avoir un exemple.
18 | editURL = ""
19 | # Autheur du site, est utilisé dans les informations meta
20 | author = ""
21 | # Description du site, est utilisé dans les informations meta
22 | description = ""
23 | # Affiche une icône lorsque la page a été visitée
24 | showVisitedLinks = false
25 | # Désactive la fonction de recherche. Une valeur à true cache la barre de recherche.
26 | disableSearch = false
27 | # Par défaut, le cache Javascript et CSS est automatiquement vidé lorsqu'une nouvelle version du site est générée.
28 | # Utilisez ce paramètre lorsque vous voulez désactiver ce comportement (c'est parfois incompatible avec certains proxys)
29 | disableAssetsBusting = false
30 | # Utilisez ce paramètre pour désactiver le bouton copy-to-clipboard pour le code formatté sur une ligne.
31 | disableInlineCopyToClipBoard = false
32 | # Un titre est défini par défaut lorsque vous utilisez un raccourci dans le menu. Utilisez ce paramètre pour le cacher.
33 | disableShortcutsTitle = false
34 | # Quand vous utilisez un site multi-langue, utilisez ce paramètre pour désactiver le bouton de changement de langue.
35 | disableLanguageSwitchingButton = false
36 | # Ordonne les sections dans menu par poids ("weight") ou titre ("title"). Défaut à "weight"
37 | ordersectionsby = "weight"
38 | # Utilisez ce paramètre pour modifier le schéma de couleur du site. Les valeurs par défaut sont "red", "blue", "green".
39 | themeVariant = ""
40 | ```
41 |
42 | ## Activer la recherche {#activer-recherche}
43 |
44 | Si ce n'est pas déjà présent, ajoutez les lignes suivantes dans le fichier `config.toml`.
45 |
46 | ```toml
47 | [outputs]
48 | home = [ "HTML", "RSS", "JSON"]
49 | ```
50 |
51 | Le thème *Learn* utilise les dernières amélioraions d'Hugo pour générer un fichier d'index JSON, prêt à être consommé par le moteur de recherche lunr.js.
52 |
53 | > Hugo génère lunrjs index.json à la racine du dossier `public`.
54 | > Quand vous générez le site avec `hugo server`, Hugo génère le fichier en mémoire, il n'est donc pas disponible sur le disque.
--------------------------------------------------------------------------------
/content/concepts/addressing.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Addressing
3 | weight: 6
4 | ---
5 |
6 | Flexible networks need flexible addressing systems. Since libp2p is designed to work across a wide variety of networks, we need a way to work with a lot of different addressing schemes in a consistent way.
7 |
8 | A `multiaddress` (often abbreviated `multiaddr`), is a convention for encoding multiple layers of addressing information into a single "future-proof" path structure. It [defines][spec_multiaddr] human-readable and machine-optimized encodings of common transport and overlay protocols and allows many layers of addressing to be combined and used together.
9 |
10 | For example: `/ip4/127.0.0.1/udp/1234` encodes two protocols along with their essential addressing information. The `/ip4/127.0.0.1` informs us that we want the `127.0.0.1` loopback address of the IPv4 protocol, and `/udp/1234` tells us we want to send UDP packets to port `1234`.
11 |
12 | Things get more interesting as we compose further. For example, the multiaddr `/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N` uniquely identifies my local IPFS node, using libp2p's [registered protocol id](https://github.com/multiformats/multiaddr/blob/master/protocols.csv) `/p2p/` and the [multihash](/reference/glossary/#multihash) of my IPFS node's public key.
13 |
14 | {{% notice "tip" %}}
15 | For more on peer identity and its relation to public key cryptography, see [Peer Identity](../peer-id/).
16 | {{% /notice %}}
17 |
18 | Let's say that I have the peer id `QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N` as above, and my public ip is `7.7.7.7`. I start my libp2p application and listen for connections on TCP port `4242`.
19 |
20 | Now I can start [handing out multiaddrs to all my friends](/concepts/peer-routing/), of the form `/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N`. Combining my "location multiaddr" (my IP and port) with my "identity multiaddr" (my libp2p `PeerId`), produces a new multiaddr containing both key pieces of information.
21 |
22 | Now not only do my friends know where to find me, anyone they give that address to can verify that the machine on the other side is really me, or at least, that they control the private key for my `PeerId`. They also know (by virtue of the `/p2p/` protocol id) that I'm likely to support common libp2p interactions like opening connections and negotiating what application protocols we can use to communicate. That's not bad!
23 |
24 | This can be extended to account for multiple layers of addressing and abstraction. For example, the [addresses used for circuit relay](/concepts/circuit-relay/#relay-addresses) combine transport addresses with multiple peer identities to form an address that describes a "relay circuit":
25 |
26 | ```
27 | /ip4/7.7.7.7/tcp/4242/p2p/QmRelay/p2p-circuit/p2p/QmRelayedPeer
28 | ```
29 |
30 | ### More information
31 |
32 | For more detail, see the [multiaddr spec][spec_multiaddr], which has links to many implementations.
33 |
34 |
35 | [spec_multiaddr]: https://github.com/multiformats/multiaddr
36 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/i18n/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Multilingual and i18n
4 | weight: 30
5 | ---
6 |
7 | **Learn theme** is fully compatible with Hugo multilingual mode.
8 |
9 | It provides:
10 |
11 | - Translation strings for default values (English and French). Feel free to contribute !
12 | - Automatic menu generation from multilingual content
13 | - In-browser language switching
14 |
15 | 
16 |
17 | ## Basic configuration
18 |
19 | After learning [how Hugo handle multilingual websites](https://gohugo.io/content-management/multilingual), define your languages in your `config.toml` file.
20 |
21 | For example with current French and English website.
22 |
23 | ```toml
24 | # English is the default language
25 | defaultContentLanguage = "en"
26 | # Force to have /en/my-page and /fr/my-page routes, even for default language.
27 | defaultContentLanguageInSubdir= true
28 |
29 | [Languages]
30 | [Languages.en]
31 | title = "Documentation for Hugo Learn Theme"
32 | weight = 1
33 | languageName = "English"
34 |
35 | [Languages.fr]
36 | title = "Documentation du thème Hugo Learn"
37 | weight = 2
38 | languageName = "Français"
39 | ```
40 |
41 | Then, for each new page, append the *id* of the language to the file.
42 |
43 | - Single file `my-page.md` is split in two files:
44 | - in English: `my-page.en.md`
45 | - in French: `my-page.fr.md`
46 | - Single file `_index.md` is split in two files:
47 | - in English: `_index.en.md`
48 | - in French: `_index.fr.md`
49 |
50 | {{% notice info %}}
51 | Be aware that only translated pages are displayed in menu. It's not replaced with default language content.
52 | {{% /notice %}}
53 |
54 | {{% notice tip %}}
55 | Use [slug](https://gohugo.io/content-management/multilingual/#translate-your-content) Front Matter parameter to translate urls too.
56 | {{% /notice %}}
57 |
58 | ## Overwrite translation strings
59 |
60 | 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.
61 |
62 | To override these values, create a new file in your local i18n folder `i18n/.toml` and inspire yourself from the theme `themes/hugo-theme-learn/i18n/en.toml`
63 |
64 | 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/matcornic/hugo-theme-learn/pulls) to the theme !
65 |
66 | ## Disable language switching
67 |
68 | Switching the language in the browser is a great feature, but for some reasons you may want to disable it.
69 |
70 | Just set `disableLanguageSwitchingButton=true` in your `config.toml`
71 |
72 | ```toml
73 | [params]
74 | # When using mulitlingual website, disable the switch language button.
75 | disableLanguageSwitchingButton = true
76 | ```
77 |
78 | 
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/layouts/partials/logo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/i18n/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Multi-langue et i18n
4 | weight: 30
5 | ---
6 |
7 | **Learn** est complètement compatible avec le mode multi-langue d'Hugo.
8 |
9 | Il fournit :
10 |
11 | - Des *translation strings* pour les valeurs par défaut utilisées par le thème (Anglais et Français). N'hésitez pas à contribuer !
12 | - Génération automatique du menu avec le contenu multi-langue
13 | - Modification de la langue dans le navigateur
14 |
15 | 
16 |
17 | ## Configuration simple
18 |
19 | Après avoir appris [comment Hugo gère les sites multi-langue](https://gohugo.io/content-management/multilingual), définissez vos langues dans votre fichier `config.toml`.
20 |
21 | Par exemple, pour ce site, avec du contenu en français et en anglais.
22 |
23 | ```toml
24 | # Anglais est la langue par défaut
25 | defaultContentLanguage = "en"
26 | # Force d'avoir /en/ma-page et /fr/ma-page routes, même avec la langue par défaut.
27 | defaultContentLanguageInSubdir= true
28 |
29 | [Languages]
30 | [Languages.en]
31 | title = "Documentation for Hugo Learn Theme"
32 | weight = 1
33 | languageName = "English"
34 |
35 | [Languages.fr]
36 | title = "Documentation du thème Hugo Learn"
37 | weight = 2
38 | languageName = "Français"
39 | ```
40 |
41 | Puis, pour chaque nouvelle page, ajoutez *l'id* de la langue du fichier.
42 |
43 | - Le fichier `my-page.md` est découpé en deux fichiers :
44 | - en anglais : `my-page.en.md`
45 | - en français : `my-page.fr.md`
46 | - Le fichier `_index.md` est découpé en deux fichiers :
47 | - en anglais: `_index.en.md`
48 | - en français: `_index.fr.md`
49 |
50 | {{% notice info %}}
51 | Attention, seulement les pages traduites sont affichées dans le menu. Le contenu n'est pas remplacé par les pages de la langue par défaut.
52 | {{% /notice %}}
53 |
54 | {{% notice tip %}}
55 | Utilisez le paramètre du Front Matter [slug](https://gohugo.io/content-management/multilingual/#translate-your-content) pour traduire également les URLs.
56 | {{% /notice %}}
57 |
58 | ## Surcharger les *translation strings*
59 |
60 | Les *Translations strings* sont utilisées comme valeurs par défaut dans le thème (Bouton *Modifier la page*, Element de subsitution *Recherche*, etc.). Les traductions sont disponibles en français et en anglais mais vous pouvez utiliser n'importe quelle autre langue et surcharger avec vos propres valeurs.
61 |
62 | Pour surcharger ces valeurs, créer un nouveau fichier dans votre dossier i18n local `i18n/.toml` et inspirez vous du thème `themes/hugo-theme-learn/i18n/en.toml`
63 |
64 | D'ailleurs, ces traductions pour servir à tout le monde, donc svp prenez le temps de [proposer une Pull Request](https://github.com/matcornic/hugo-theme-learn/pulls) !
65 |
66 | ## Désactiver le changement de langue
67 |
68 | Vous pouvez changer de langue directement dans le navigateur. C'est une super fonctionnalité, mais vous avez peut-être besoin de la désactiver.
69 |
70 | Pour ce faire, ajouter le paramètre `disableLanguageSwitchingButton=true` dans votre `config.toml`
71 |
72 | ```toml
73 | [params]
74 | # Quand vous utilisez un site en multi-langue, désactive le bouton de changment de langue.
75 | disableLanguageSwitchingButton = true
76 | ```
77 |
78 | 
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/js/search.js:
--------------------------------------------------------------------------------
1 | var lunrIndex, pagesIndex;
2 |
3 | function endsWith(str, suffix) {
4 | return str.indexOf(suffix, str.length - suffix.length) !== -1;
5 | }
6 |
7 | // Initialize lunrjs using our generated index file
8 | function initLunr() {
9 | if (!endsWith(baseurl,"/")){
10 | baseurl = baseurl+'/'
11 | };
12 |
13 | // First retrieve the index file
14 | $.getJSON(baseurl +"index.json")
15 | .done(function(index) {
16 | pagesIndex = index;
17 | // Set up lunrjs by declaring the fields we use
18 | // Also provide their boost level for the ranking
19 | lunrIndex = new lunr.Index
20 | lunrIndex.ref("uri");
21 | lunrIndex.field('title', {
22 | boost: 15
23 | });
24 | lunrIndex.field('tags', {
25 | boost: 10
26 | });
27 | lunrIndex.field("content", {
28 | boost: 5
29 | });
30 |
31 | // Feed lunr with each file and let lunr actually index them
32 | pagesIndex.forEach(function(page) {
33 | lunrIndex.add(page);
34 | });
35 | lunrIndex.pipeline.remove(lunrIndex.stemmer)
36 | })
37 | .fail(function(jqxhr, textStatus, error) {
38 | var err = textStatus + ", " + error;
39 | console.error("Error getting Hugo index flie:", err);
40 | });
41 | }
42 |
43 | /**
44 | * Trigger a search in lunr and transform the result
45 | *
46 | * @param {String} query
47 | * @return {Array} results
48 | */
49 | function search(query) {
50 | // Find the item in our index corresponding to the lunr one to have more info
51 | return lunrIndex.search(query).map(function(result) {
52 | return pagesIndex.filter(function(page) {
53 | return page.uri === result.ref;
54 | })[0];
55 | });
56 | }
57 |
58 | // Let's get started
59 | initLunr();
60 | $( document ).ready(function() {
61 | var searchList = new autoComplete({
62 | /* selector for the search box element */
63 | selector: $("#search-by").get(0),
64 | /* source is the callback to perform the search */
65 | source: function(term, response) {
66 | response(search(term));
67 | },
68 | /* renderItem displays individual search results */
69 | renderItem: function(item, term) {
70 | var numContextWords = 2;
71 | var text = item.content.match(
72 | "(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}" +
73 | term+"(?:\\s?(?:[\\w]+)\\s?){0,"+numContextWords+"}");
74 | item.context = text;
75 | return '
' +
80 | '» ' + item.title +
81 | '
' +
82 | (item.context || '') +'
' +
83 | '
';
84 | },
85 | /* onSelect callback fires when a search suggestion is chosen */
86 | onSelect: function(e, term, item) {
87 | location.href = item.getAttribute('data-uri');
88 | }
89 | });
90 | });
91 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/mermaid.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : "Mermaid"
3 | description : "Generation of diagram and flowchart from text in a similar manner as markdown"
4 | ---
5 |
6 | [Mermaid](https://mermaidjs.github.io/) is a library helping you to generate diagram and flowcharts from text, in a similar manner as Markdown.
7 |
8 | Just insert your mermaid code in the `mermaid` shortcode and that's it.
9 |
10 | ## Flowchart example
11 | {{*mermaid align="left"*/>}}
12 | graph LR;
13 | A[Hard edge] -->|Link text| B(Round edge)
14 | B --> C{Decision}
15 | C -->|One| D[Result one]
16 | C -->|Two| E[Result two]
17 | {{* /mermaid */>}}
18 |
19 | renders as
20 |
21 | {{}}
22 | graph LR;
23 | A[Hard edge] -->|Link text| B(Round edge)
24 | B --> C{Decision}
25 | C -->|One| D[Result one]
26 | C -->|Two| E[Result two]
27 | {{< /mermaid >}}
28 |
29 | ## Sequence example
30 |
31 | {{*mermaid*/>}}
32 | sequenceDiagram
33 | participant Alice
34 | participant Bob
35 | Alice->>John: Hello John, how are you?
36 | loop Healthcheck
37 | John->John: Fight against hypochondria
38 | end
39 | Note right of John: Rational thoughts prevail...
40 | John-->Alice: Great!
41 | John->Bob: How about you?
42 | Bob-->John: Jolly good!
43 | {{* /mermaid */>}}
44 |
45 | renders as
46 |
47 | {{}}
48 | sequenceDiagram
49 | participant Alice
50 | participant Bob
51 | Alice->>John: Hello John, how are you?
52 | loop Healthcheck
53 | John->John: Fight against hypochondria
54 | end
55 | Note right of John: Rational thoughts prevail...
56 | John-->Alice: Great!
57 | John->Bob: How about you?
58 | Bob-->John: Jolly good!
59 | {{< /mermaid >}}
60 |
61 | ## GANTT Example
62 |
63 | {{*mermaid*/>}}
64 | gantt
65 | dateFormat YYYY-MM-DD
66 | title Adding GANTT diagram functionality to mermaid
67 | section A section
68 | Completed task :done, des1, 2014-01-06,2014-01-08
69 | Active task :active, des2, 2014-01-09, 3d
70 | Future task : des3, after des2, 5d
71 | Future task2 : des4, after des3, 5d
72 | section Critical tasks
73 | Completed task in the critical line :crit, done, 2014-01-06,24h
74 | Implement parser and jison :crit, done, after des1, 2d
75 | Create tests for parser :crit, active, 3d
76 | Future task in critical line :crit, 5d
77 | Create tests for renderer :2d
78 | Add to mermaid :1d
79 | {{* /mermaid */>}}
80 |
81 |
82 | render as
83 |
84 | {{}}
85 | gantt
86 | dateFormat YYYY-MM-DD
87 | title Adding GANTT diagram functionality to mermaid
88 | section A section
89 | Completed task :done, des1, 2014-01-06,2014-01-08
90 | Active task :active, des2, 2014-01-09, 3d
91 | Future task : des3, after des2, 5d
92 | Future task2 : des4, after des3, 5d
93 | section Critical tasks
94 | Completed task in the critical line :crit, done, 2014-01-06,24h
95 | Implement parser and jison :crit, done, after des1, 2d
96 | Create tests for parser :crit, active, 3d
97 | Future task in critical line :crit, 5d
98 | Create tests for renderer :2d
99 | Add to mermaid :1d
100 | {{}}
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/shortcodes/mermaid.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title : "Mermaid"
3 | description : "Génération de diagrammes à partir de texte, dans le même style que Markdown"
4 | ---
5 |
6 | [Mermaid](https://mermaidjs.github.io/) est une bibliothèque Javascript qui permet de générer des diagrammes (séquence, état, gantt, etc.) à partir de texte, dans le même style que Markdown.
7 |
8 | Insérer votre code Mermaid dans un shortcode `mermaid` et c'est tout.
9 |
10 | ## Flowchart example
11 | {{*mermaid align="left"*/>}}
12 | graph LR;
13 | A[Bords droits] -->|Lien texte| B(Bords arondis)
14 | B --> C{Décision}
15 | C -->|Un| D[Résultat un]
16 | C -->|Deux| E[Résultat deux]
17 | {{* /mermaid */>}}
18 |
19 | renders as
20 |
21 | {{}}
22 | graph LR;
23 | A[Bords droits] -->|Lien texte| B(Bords arondis)
24 | B --> C{Décision}
25 | C -->|Un| D[Résultat un]
26 | C -->|Deux| E[Résultat deux]
27 | {{< /mermaid >}}
28 |
29 | ## Sequence example
30 |
31 | {{*mermaid*/>}}
32 | sequenceDiagram
33 | participant Alice
34 | participant Bob
35 | Alice->>John: Salut John, comment vas-tu?
36 | loop Vérification
37 | John->John: Se bat contre l'hyponcodrie.
38 | end
39 | Note right of John: Les pensées rationnelles prédominent...
40 | John-->Alice: Super!
41 | John->Bob: Et toi?
42 | Bob-->John: Au top!
43 | {{* /mermaid */>}}
44 |
45 | renders as
46 |
47 | {{}}
48 | sequenceDiagram
49 | participant Alice
50 | participant Bob
51 | Alice->>John: Salut John, comment vas-tu?
52 | loop Vérification
53 | John->John: Se bat contre l'hyponcodrie.
54 | end
55 | Note right of John: Les pensées rationnelles prédominent...
56 | John-->Alice: Super!
57 | John->Bob: Et toi?
58 | Bob-->John: Au top!
59 | {{< /mermaid >}}
60 |
61 | ## GANTT Example
62 |
63 | {{*mermaid*/>}}
64 | gantt
65 | dateFormat YYYY-MM-DD
66 | title Ajout de la fonctionnalité de GANTT à Mermaid
67 | section Une section
68 | Tâche complétée :done, des1, 2014-01-06,2014-01-08
69 | Tâche en cours :active, des2, 2014-01-09, 3d
70 | Future tâche : des3, after des2, 5d
71 | Future tâche 2 : des4, after des3, 5d
72 | section Tâches critiques
73 | Tâche complétée dans le chemin critique :crit, done, 2014-01-06,24h
74 | Implémenter le parser et jison :crit, done, after des1, 2d
75 | Créer des tests pour le parser :crit, active, 3d
76 | Future tâche dans le chemin critique :crit, 5d
77 | Créer des tests pour le renderer :2d
78 | Ajout à Mermaid :1d
79 | {{* /mermaid */>}}
80 |
81 |
82 | render as
83 |
84 | {{}}
85 | gantt
86 | dateFormat YYYY-MM-DD
87 | title Ajout de la fonctionnalité de GANTT à Mermaid
88 | section Une section
89 | Tâche complétée :done, des1, 2014-01-06,2014-01-08
90 | Tâche en cours :active, des2, 2014-01-09, 3d
91 | Future tâche : des3, after des2, 5d
92 | Future tâche 2 : des4, after des3, 5d
93 | section Tâches critiques
94 | Tâche complétée dans le chemin critique :crit, done, 2014-01-06,24h
95 | Implémenter le parser et jison :crit, done, after des1, 2d
96 | Créer des tests pour le parser :crit, active, 3d
97 | Future tâche dans le chemin critique :crit, 5d
98 | Créer des tests pour le renderer :2d
99 | Ajout à Mermaid :1d
100 | {{}}
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/menushortcuts.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Menu extra shortcuts
4 | weight: 25
5 | ---
6 |
7 | You can define additional menu entries or shortcuts in the navigation menu without any link to content.
8 |
9 | ## Basic configuration
10 |
11 | Edit the website configuration `config.toml` and add a `[[menu.shortcuts]]` entry for each link your want to add.
12 |
13 | Example from the current website:
14 |
15 | [[menu.shortcuts]]
16 | name = " Github repo"
17 | identifier = "ds"
18 | url = "https://github.com/matcornic/hugo-theme-learn"
19 | weight = 10
20 |
21 | [[menu.shortcuts]]
22 | name = " Showcases"
23 | url = "/showcase"
24 | weight = 11
25 |
26 | [[menu.shortcuts]]
27 | name = " Hugo Documentation"
28 | identifier = "hugodoc"
29 | url = "https://gohugo.io/"
30 | weight = 20
31 |
32 | [[menu.shortcuts]]
33 | name = " Credits"
34 | url = "/credits"
35 | weight = 30
36 |
37 | By default, shortcuts are preceded by a title. This title can be disabled by setting `disableShortcutsTitle=true`.
38 | However, if you want to keep the title but change its value, it can be overriden by changing your local i18n translation string configuration.
39 |
40 | For example, in your local `i18n/en.toml` file, add the following content
41 |
42 | [Shortcuts-Title]
43 | other = ""
44 |
45 | Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo i18n translation strings](https://gohugo.io/content-management/multilingual/#translation-of-strings)
46 |
47 | ## Configuration for Multilingual mode {#i18n}
48 |
49 | When using a multilingual website, you can set different menus for each language. In the `config.toml` file, prefix your menu configuration by `Languages.`.
50 |
51 |
52 | Example from the current website:
53 |
54 | [Languages]
55 | [Languages.en]
56 | title = "Documentation for Hugo Learn Theme"
57 | weight = 1
58 | languageName = "English"
59 |
60 | [[Languages.en.menu.shortcuts]]
61 | name = " Github repo"
62 | identifier = "ds"
63 | url = "https://github.com/matcornic/hugo-theme-learn"
64 | weight = 10
65 |
66 | [[Languages.en.menu.shortcuts]]
67 | name = " Showcases"
68 | url = "/showcase"
69 | weight = 11
70 |
71 | [[Languages.en.menu.shortcuts]]
72 | name = " Hugo Documentation"
73 | identifier = "hugodoc"
74 | url = "https://gohugo.io/"
75 | weight = 20
76 |
77 | [[Languages.en.menu.shortcuts]]
78 | name = " Credits"
79 | url = "/credits"
80 | weight = 30
81 |
82 | [Languages.fr]
83 | title = "Documentation du thème Hugo Learn"
84 | weight = 2
85 | languageName = "Français"
86 |
87 | [[Languages.fr.menu.shortcuts]]
88 | name = " Repo Github"
89 | identifier = "ds"
90 | url = "https://github.com/matcornic/hugo-theme-learn"
91 | weight = 10
92 |
93 | [[Languages.fr.menu.shortcuts]]
94 | name = " Vitrine"
95 | url = "/showcase"
96 | weight = 11
97 |
98 | [[Languages.fr.menu.shortcuts]]
99 | name = " Documentation Hugo"
100 | identifier = "hugodoc"
101 | url = "https://gohugo.io/"
102 | weight = 20
103 |
104 | [[Languages.fr.menu.shortcuts]]
105 | name = " Crédits"
106 | url = "/credits"
107 | weight = 30
108 |
109 | Read more about [hugo menu](https://gohugo.io/extras/menus/) and [hugo multilingual menus](https://gohugo.io/content-management/multilingual/#menus)
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/theme-blue.css:
--------------------------------------------------------------------------------
1 |
2 | :root{
3 |
4 | --MAIN-TEXT-color:#323232; /* Color of text by default */
5 | --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */
6 | --MAIN-LINK-color:#1C90F3; /* Color of links */
7 | --MAIN-LINK-HOVER-color:#167ad0; /* Color of hovered links */
8 | --MAIN-ANCHOR-color: #1C90F3; /* color of anchors on titles */
9 |
10 | --MENU-HEADER-BG-color:#1C90F3; /* Background color of menu header */
11 | --MENU-HEADER-BORDER-color:#33a1ff; /*Color of menu header border */
12 |
13 | --MENU-SEARCH-BG-color:#167ad0; /* Search field background color (by default borders + icons) */
14 | --MENU-SEARCH-BOX-color: #33a1ff; /* Override search field border color */
15 | --MENU-SEARCH-BOX-ICONS-color: #a1d2fd; /* Override search field icons color */
16 |
17 | --MENU-SECTIONS-ACTIVE-BG-color:#20272b; /* Background color of the active section and its childs */
18 | --MENU-SECTIONS-BG-color:#252c31; /* Background color of other sections */
19 | --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */
20 | --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */
21 | --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */
22 | --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */
23 |
24 | --MENU-VISITED-color: #33a1ff; /* Color of 'page visited' icons in menu */
25 | --MENU-SECTION-HR-color: #20272b; /* Color of separator in menu */
26 |
27 | }
28 |
29 | body {
30 | color: var(--MAIN-TEXT-color) !important;
31 | }
32 |
33 | textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
34 | border-color: none;
35 | box-shadow: none;
36 | }
37 |
38 | h2, h3, h4, h5 {
39 | color: var(--MAIN-TITLES-TEXT-color) !important;
40 | }
41 |
42 | a {
43 | color: var(--MAIN-LINK-color);
44 | }
45 |
46 | .anchor {
47 | color: var(--MAIN-ANCHOR-color);
48 | }
49 |
50 | a:hover {
51 | color: var(--MAIN-LINK-HOVER-color);
52 | }
53 |
54 | #sidebar ul li.visited > a .read-icon {
55 | color: var(--MENU-VISITED-color);
56 | }
57 |
58 | #body a.highlight:after {
59 | display: block;
60 | content: "";
61 | height: 1px;
62 | width: 0%;
63 | -webkit-transition: width 0.5s ease;
64 | -moz-transition: width 0.5s ease;
65 | -ms-transition: width 0.5s ease;
66 | transition: width 0.5s ease;
67 | background-color: var(--MAIN-LINK-HOVER-color);
68 | }
69 | #sidebar {
70 | background-color: var(--MENU-SECTIONS-BG-color);
71 | }
72 | #sidebar #header-wrapper {
73 | background: var(--MENU-HEADER-BG-color);
74 | color: var(--MENU-SEARCH-BOX-color);
75 | border-color: var(--MENU-HEADER-BORDER-color);
76 | }
77 | #sidebar .searchbox {
78 | border-color: var(--MENU-SEARCH-BOX-color);
79 | background: var(--MENU-SEARCH-BG-color);
80 | }
81 | #sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {
82 | background: var(--MENU-SECTIONS-ACTIVE-BG-color);
83 | }
84 | #sidebar .searchbox * {
85 | color: var(--MENU-SEARCH-BOX-ICONS-color);
86 | }
87 |
88 | #sidebar a {
89 | color: var(--MENU-SECTIONS-LINK-color);
90 | }
91 |
92 | #sidebar a:hover {
93 | color: var(--MENU-SECTIONS-LINK-HOVER-color);
94 | }
95 |
96 | #sidebar ul li.active > a {
97 | background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
98 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important;
99 | }
100 |
101 | #sidebar hr {
102 | border-color: var(--MENU-SECTION-HR-color);
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/theme-green.css:
--------------------------------------------------------------------------------
1 |
2 | :root{
3 |
4 | --MAIN-TEXT-color:#323232; /* Color of text by default */
5 | --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */
6 | --MAIN-LINK-color:#599a3e; /* Color of links */
7 | --MAIN-LINK-HOVER-color:#3f6d2c; /* Color of hovered links */
8 | --MAIN-ANCHOR-color: #599a3e; /* color of anchors on titles */
9 |
10 | --MENU-HEADER-BG-color:#74b559; /* Background color of menu header */
11 | --MENU-HEADER-BORDER-color:#9cd484; /*Color of menu header border */
12 |
13 | --MENU-SEARCH-BG-color:#599a3e; /* Search field background color (by default borders + icons) */
14 | --MENU-SEARCH-BOX-color: #84c767; /* Override search field border color */
15 | --MENU-SEARCH-BOX-ICONS-color: #c7f7c4; /* Override search field icons color */
16 |
17 | --MENU-SECTIONS-ACTIVE-BG-color:#1b211c; /* Background color of the active section and its childs */
18 | --MENU-SECTIONS-BG-color:#222723; /* Background color of other sections */
19 | --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */
20 | --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */
21 | --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */
22 | --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */
23 |
24 | --MENU-VISITED-color: #599a3e; /* Color of 'page visited' icons in menu */
25 | --MENU-SECTION-HR-color: #18211c; /* Color of separator in menu */
26 |
27 | }
28 |
29 | body {
30 | color: var(--MAIN-TEXT-color) !important;
31 | }
32 |
33 | textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
34 | border-color: none;
35 | box-shadow: none;
36 | }
37 |
38 | h2, h3, h4, h5 {
39 | color: var(--MAIN-TITLES-TEXT-color) !important;
40 | }
41 |
42 | a {
43 | color: var(--MAIN-LINK-color);
44 | }
45 |
46 | .anchor {
47 | color: var(--MAIN-ANCHOR-color);
48 | }
49 |
50 | a:hover {
51 | color: var(--MAIN-LINK-HOVER-color);
52 | }
53 |
54 | #sidebar ul li.visited > a .read-icon {
55 | color: var(--MENU-VISITED-color);
56 | }
57 |
58 | #body a.highlight:after {
59 | display: block;
60 | content: "";
61 | height: 1px;
62 | width: 0%;
63 | -webkit-transition: width 0.5s ease;
64 | -moz-transition: width 0.5s ease;
65 | -ms-transition: width 0.5s ease;
66 | transition: width 0.5s ease;
67 | background-color: var(--MAIN-LINK-HOVER-color);
68 | }
69 | #sidebar {
70 | background-color: var(--MENU-SECTIONS-BG-color);
71 | }
72 | #sidebar #header-wrapper {
73 | background: var(--MENU-HEADER-BG-color);
74 | color: var(--MENU-SEARCH-BOX-color);
75 | border-color: var(--MENU-HEADER-BORDER-color);
76 | }
77 | #sidebar .searchbox {
78 | border-color: var(--MENU-SEARCH-BOX-color);
79 | background: var(--MENU-SEARCH-BG-color);
80 | }
81 | #sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {
82 | background: var(--MENU-SECTIONS-ACTIVE-BG-color);
83 | }
84 | #sidebar .searchbox * {
85 | color: var(--MENU-SEARCH-BOX-ICONS-color);
86 | }
87 |
88 | #sidebar a {
89 | color: var(--MENU-SECTIONS-LINK-color);
90 | }
91 |
92 | #sidebar a:hover {
93 | color: var(--MENU-SECTIONS-LINK-HOVER-color);
94 | }
95 |
96 | #sidebar ul li.active > a {
97 | background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
98 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important;
99 | }
100 |
101 | #sidebar hr {
102 | border-color: var(--MENU-SECTION-HR-color);
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/css/theme-red.css:
--------------------------------------------------------------------------------
1 |
2 | :root{
3 |
4 | --MAIN-TEXT-color:#323232; /* Color of text by default */
5 | --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */
6 | --MAIN-LINK-color:#f31c1c; /* Color of links */
7 | --MAIN-LINK-HOVER-color:#d01616; /* Color of hovered links */
8 | --MAIN-ANCHOR-color: #f31c1c; /* color of anchors on titles */
9 |
10 | --MENU-HEADER-BG-color:#dc1010; /* Background color of menu header */
11 | --MENU-HEADER-BORDER-color:#e23131; /*Color of menu header border */
12 |
13 | --MENU-SEARCH-BG-color:#b90000; /* Search field background color (by default borders + icons) */
14 | --MENU-SEARCH-BOX-color: #ef2020; /* Override search field border color */
15 | --MENU-SEARCH-BOX-ICONS-color: #fda1a1; /* Override search field icons color */
16 |
17 | --MENU-SECTIONS-ACTIVE-BG-color:#2b2020; /* Background color of the active section and its childs */
18 | --MENU-SECTIONS-BG-color:#312525; /* Background color of other sections */
19 | --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */
20 | --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */
21 | --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */
22 | --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */
23 |
24 | --MENU-VISITED-color: #ff3333; /* Color of 'page visited' icons in menu */
25 | --MENU-SECTION-HR-color: #2b2020; /* Color of separator in menu */
26 |
27 | }
28 |
29 | body {
30 | color: var(--MAIN-TEXT-color) !important;
31 | }
32 |
33 | textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
34 | border-color: none;
35 | box-shadow: none;
36 | }
37 |
38 | h2, h3, h4, h5 {
39 | color: var(--MAIN-TITLES-TEXT-color) !important;
40 | }
41 |
42 | a {
43 | color: var(--MAIN-LINK-color);
44 | }
45 |
46 | .anchor {
47 | color: var(--MAIN-ANCHOR-color);
48 | }
49 |
50 | a:hover {
51 | color: var(--MAIN-LINK-HOVER-color);
52 | }
53 |
54 | #sidebar ul li.visited > a .read-icon {
55 | color: var(--MENU-VISITED-color);
56 | }
57 |
58 | #body a.highlight:after {
59 | display: block;
60 | content: "";
61 | height: 1px;
62 | width: 0%;
63 | -webkit-transition: width 0.5s ease;
64 | -moz-transition: width 0.5s ease;
65 | -ms-transition: width 0.5s ease;
66 | transition: width 0.5s ease;
67 | background-color: var(--MAIN-LINK-HOVER-color);
68 | }
69 | #sidebar {
70 | background-color: var(--MENU-SECTIONS-BG-color);
71 | }
72 | #sidebar #header-wrapper {
73 | background: var(--MENU-HEADER-BG-color);
74 | color: var(--MENU-SEARCH-BOX-color);
75 | border-color: var(--MENU-HEADER-BORDER-color);
76 | }
77 | #sidebar .searchbox {
78 | border-color: var(--MENU-SEARCH-BOX-color);
79 | background: var(--MENU-SEARCH-BG-color);
80 | }
81 | #sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {
82 | background: var(--MENU-SECTIONS-ACTIVE-BG-color);
83 | }
84 | #sidebar .searchbox * {
85 | color: var(--MENU-SEARCH-BOX-ICONS-color);
86 | }
87 |
88 | #sidebar a {
89 | color: var(--MENU-SECTIONS-LINK-color);
90 | }
91 |
92 | #sidebar a:hover {
93 | color: var(--MENU-SECTIONS-LINK-HOVER-color);
94 | }
95 |
96 | #sidebar ul li.active > a {
97 | background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
98 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important;
99 | }
100 |
101 | #sidebar hr {
102 | border-color: var(--MENU-SECTION-HR-color);
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/static/css/theme-mine.css:
--------------------------------------------------------------------------------
1 |
2 | :root{
3 |
4 | --MAIN-TEXT-color:#323232; /* Color of text by default */
5 | --MAIN-TITLES-TEXT-color: #5e5e5e; /* Color of titles h2-h3-h4-h5 */
6 | --MAIN-LINK-color:#599a3e; /* Color of links */
7 | --MAIN-LINK-HOVER-color:#3f6d2c; /* Color of hovered links */
8 | --MAIN-ANCHOR-color: #599a3e; /* color of anchors on titles */
9 |
10 | --MENU-HEADER-BG-color:#74b559; /* Background color of menu header */
11 | --MENU-HEADER-BORDER-color:#9cd484; /*Color of menu header border */
12 |
13 | --MENU-SEARCH-BG-color:#599a3e; /* Search field background color (by default borders + icons) */
14 | --MENU-SEARCH-BOX-color: #84c767; /* Override search field border color */
15 | --MENU-SEARCH-BOX-ICONS-color: #c7f7c4; /* Override search field icons color */
16 |
17 | --MENU-SECTIONS-ACTIVE-BG-color:#1b211c; /* Background color of the active section and its childs */
18 | --MENU-SECTIONS-BG-color:#222723; /* Background color of other sections */
19 | --MENU-SECTIONS-LINK-color: #ccc; /* Color of links in menu */
20 | --MENU-SECTIONS-LINK-HOVER-color: #e6e6e6; /* Color of links in menu, when hovered */
21 | --MENU-SECTION-ACTIVE-CATEGORY-color: #777; /* Color of active category text */
22 | --MENU-SECTION-ACTIVE-CATEGORY-BG-color: #fff; /* Color of background for the active category (only) */
23 |
24 | --MENU-VISITED-color: #599a3e; /* Color of 'page visited' icons in menu */
25 | --MENU-SECTION-HR-color: #18211c; /* Color of separator in menu */
26 |
27 | }
28 |
29 | body {
30 | color: var(--MAIN-TEXT-color) !important;
31 | }
32 |
33 | textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
34 | border-color: none;
35 | box-shadow: none;
36 | }
37 |
38 | h2, h3, h4, h5 {
39 | color: var(--MAIN-TITLES-TEXT-color) !important;
40 | }
41 |
42 | a {
43 | color: var(--MAIN-LINK-color);
44 | }
45 |
46 | .anchor {
47 | color: var(--MAIN-ANCHOR-color);
48 | }
49 |
50 | a:hover {
51 | color: var(--MAIN-LINK-HOVER-color);
52 | }
53 |
54 | #sidebar ul li.visited > a .read-icon {
55 | color: var(--MENU-VISITED-color);
56 | }
57 |
58 | #body a.highlight:after {
59 | display: block;
60 | content: "";
61 | height: 1px;
62 | width: 0%;
63 | -webkit-transition: width 0.5s ease;
64 | -moz-transition: width 0.5s ease;
65 | -ms-transition: width 0.5s ease;
66 | transition: width 0.5s ease;
67 | background-color: var(--MAIN-LINK-HOVER-color);
68 | }
69 | #sidebar {
70 | background-color: var(--MENU-SECTIONS-BG-color);
71 | }
72 | #sidebar #header-wrapper {
73 | background: var(--MENU-HEADER-BG-color);
74 | color: var(--MENU-SEARCH-BOX-color);
75 | border-color: var(--MENU-HEADER-BORDER-color);
76 | }
77 | #sidebar .searchbox {
78 | border-color: var(--MENU-SEARCH-BOX-color);
79 | background: var(--MENU-SEARCH-BG-color);
80 | }
81 | #sidebar ul.topics > li.parent, #sidebar ul.topics > li.active {
82 | background: var(--MENU-SECTIONS-ACTIVE-BG-color);
83 | }
84 | #sidebar .searchbox * {
85 | color: var(--MENU-SEARCH-BOX-ICONS-color);
86 | }
87 |
88 | #sidebar a {
89 | color: var(--MENU-SECTIONS-LINK-color);
90 | }
91 |
92 | #sidebar a:hover {
93 | color: var(--MENU-SECTIONS-LINK-HOVER-color);
94 | }
95 |
96 | #sidebar ul li.active > a {
97 | background: var(--MENU-SECTION-ACTIVE-CATEGORY-BG-color);
98 | color: var(--MENU-SECTION-ACTIVE-CATEGORY-color) !important;
99 | }
100 |
101 | #sidebar hr {
102 | border-color: var(--MENU-SECTION-HR-color);
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/cont/menushortcuts.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | date: 2016-04-09T16:50:16+02:00
3 | title: Raccourcis du menu
4 | weight: 25
5 | ---
6 |
7 | Vous pouvez définir des entrées ou raccourcis supplémentaires dans le menu sans avoir besoin d'être lié à un contenu du site.
8 |
9 | ## Configuration simple
10 |
11 | Editez le fichier de configuration `config.toml` et ajoutez une entrée `[[menu.shortcuts]]` pour chaque lien que vous voulez ajouter.
12 |
13 | Exemple pour ce site:
14 |
15 | [[menu.shortcuts]]
16 | name = " Github repo"
17 | identifier = "ds"
18 | url = "https://github.com/matcornic/hugo-theme-learn"
19 | weight = 10
20 |
21 | [[menu.shortcuts]]
22 | name = " Showcases"
23 | url = "/showcase"
24 | weight = 11
25 |
26 | [[menu.shortcuts]]
27 | name = " Hugo Documentation"
28 | identifier = "hugodoc"
29 | url = "https://gohugo.io/"
30 | weight = 20
31 |
32 | [[menu.shortcuts]]
33 | name = " Credits"
34 | url = "/credits"
35 | weight = 30
36 |
37 | Par défaut, les raccourcis sont précédés par un titre. Ce titre peut être désactivé en ajouter le paramètre `disableShortcutsTitle=true` dans la section `params` de votre `config.toml`.
38 | Cependant, si vous voulez garder le titre mais changer sa valeur, vous pouvez modifier votre configuration multilangue locale en changeant les *translation string*.
39 |
40 | Par exemple, dans votre fichier local `i18n/en.toml`, ajouter le contenu
41 |
42 | [Shortcuts-Title]
43 | other = ""
44 |
45 | Plus d'infos sur [les menus Hugo](https://gohugo.io/extras/menus/) et sur [les translations strings](https://gohugo.io/content-management/multilingual/#translation-of-strings)
46 |
47 | ## Configuration pour le mode multi-langue {#i18n}
48 |
49 | Quand vous utilisez un site multi-langue, vous pouvez avoir des menus différents pour chaque langage. Dans le fichier de configuration `config.toml`, préfixez votre configuration par `Languages.`.
50 |
51 |
52 | Par exemple, avec ce site :
53 |
54 | [Languages]
55 | [Languages.en]
56 | title = "Documentation for Hugo Learn Theme"
57 | weight = 1
58 | languageName = "English"
59 |
60 | [[Languages.en.menu.shortcuts]]
61 | name = " Github repo"
62 | identifier = "ds"
63 | url = "https://github.com/matcornic/hugo-theme-learn"
64 | weight = 10
65 |
66 | [[Languages.en.menu.shortcuts]]
67 | name = " Showcases"
68 | url = "/showcase"
69 | weight = 11
70 |
71 | [[Languages.en.menu.shortcuts]]
72 | name = " Hugo Documentation"
73 | identifier = "hugodoc"
74 | url = "https://gohugo.io/"
75 | weight = 20
76 |
77 | [[Languages.en.menu.shortcuts]]
78 | name = " Credits"
79 | url = "/credits"
80 | weight = 30
81 |
82 | [Languages.fr]
83 | title = "Documentation du thème Hugo Learn"
84 | weight = 2
85 | languageName = "Français"
86 |
87 | [[Languages.fr.menu.shortcuts]]
88 | name = " Repo Github"
89 | identifier = "ds"
90 | url = "https://github.com/matcornic/hugo-theme-learn"
91 | weight = 10
92 |
93 | [[Languages.fr.menu.shortcuts]]
94 | name = " Vitrine"
95 | url = "/showcase"
96 | weight = 11
97 |
98 | [[Languages.fr.menu.shortcuts]]
99 | name = " Documentation Hugo"
100 | identifier = "hugodoc"
101 | url = "https://gohugo.io/"
102 | weight = 20
103 |
104 | [[Languages.fr.menu.shortcuts]]
105 | name = " Crédits"
106 | url = "/credits"
107 | weight = 30
108 |
109 | Plus d'infos sur [les menus Hugo](https://gohugo.io/extras/menus/) et les [menus multi-langue Hugo](https://gohugo.io/content-management/multilingual/#menus)
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/basics/installation/_index.fr.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation
3 | weight: 15
4 | ---
5 |
6 | Les étapes suivantes sont là pour vous aider à initialiser votre site. Si vous ne connaissez pas du tout Hugo, il est fortement conseillé de vous entrainer en suivant ce [super tuto pour débutants](https://gohugo.io/overview/quickstart/).
7 |
8 | ## Créer votre projet
9 |
10 | Hugo fournit une commande `new` pour créer un nouveau site.
11 |
12 | ```
13 | hugo new site
14 | ```
15 |
16 | ## Installer le thème
17 |
18 | Installer le thème **Hugo-theme-learn** en suivant [cette documentation](https://gohugo.io/themes/installing/)
19 |
20 | Le repo du thème est : https://github.com/matcornic/hugo-theme-learn.git
21 |
22 | Sinon, vous pouvez [télécharger le thème sous forme d'un fichier .zip](https://github.com/matcornic/hugo-theme-learn/archive/master.zip) et extrayez le dans votre dossier de thèmes.
23 |
24 | ## Configuration simple
25 |
26 | Lorsque vous générez votre site, vous pouvez définir un thème en utilisant l'option `--theme`. Il est conseillé de modifier votre fichier de configuration `config.toml` and définir votre thème par défaut. En passant, ajoutez les prérequis à l'utilisation de la fonctionnalité de recherche.
27 |
28 | ```toml
29 | # Modifiez le thème pour qu'il soit utilisé par défaut à chaque génération de site.
30 | theme = "hugo-theme-learn"
31 |
32 | # Pour la fonctionnalité de recherche
33 | [outputs]
34 | home = [ "HTML", "RSS", "JSON"]
35 | ```
36 |
37 | ## Créer votre première page chapitre
38 |
39 | Les *chapitres* sont des pages contenant d'autre pages filles. Elles ont un affichage spécial et contiennent habituellement juste un _nom_ de chapitre, le _titre_ et un _résumé_ de la section.
40 |
41 | ```
42 | ### Chapitre 1
43 |
44 | # Démarrage
45 |
46 | Découvrez comment utiliser ce thème Hugo et apprenez en les concepts
47 | ```
48 |
49 | s'affiche comme
50 |
51 | 
52 |
53 | **Hugo-theme-learn** fournit des archétypes pour créer des squelettes pour votre site. Commencez par créer votre premier chapitre avec la commande suivante:
54 |
55 | ```
56 | hugo new --kind chapter basics/_index.md
57 | ```
58 |
59 | En ouvrant le fichier généré, vous devriez voir la propriété `chapter=true` en haut, paramètre quit définit que le page est un _chapitre_.
60 |
61 | ## Créer votre première page
62 |
63 | Puis, créez votre premier page dans le chapitre précédent. Pour ce faire, il existe deux possibilités :
64 |
65 | ```
66 | hugo new basics/first-content.md
67 | hugo new basics/second-content/_index.md
68 | ```
69 |
70 | N'hésitez pas à éditer ces fichiers en ajoutant des exemple de contenu et en remplaçant le paramètre `title` au début du fichier.
71 |
72 | ## Lancer le site localement
73 |
74 | Lancez la commande suivante :
75 |
76 | ```
77 | hugo serve
78 | ```
79 |
80 | Se rendre sur `http://localhost:1313`
81 |
82 | Vous devriez voir trois choses:
83 |
84 | 1. Vous avez un menu **Basics** à gauche, qui contient deux sous-menu avec des noms égal au paramètre `title` des fichiers précédemment générés.
85 | 2. La page d'accueil vous explique comment la modifier. Suivez les instructions.
86 | 3. Avec la commande `hugo serve`, la page se rafraichit automatiquement à chaque fois que vous sauvegardez. Super !
87 |
88 | ## Générez le site
89 |
90 | Quand votre site est prêt à être déployé, lancez la commande suivante:
91 |
92 | ```
93 | hugo
94 | ```
95 |
96 | Un dossier `public` a été généré. Il contient tout le contenu statique et les ressources nécessaires pour votre site. Votre site peut maintenant être déployé en utilisant n'importe quel serveur !
97 |
98 | {{% notice note %}}
99 | Ce site peut être automatiquement publié et hébergé avec [Netlify](https://www.netlify.com/) ([Plus d'infos](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)). Sinon, vous pouvez utiliser les [Github pages](https://gohugo.io/hosting-and-deployment/hosting-on-github/)
100 | {{% /notice %}}
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/exampleSite/content/basics/installation/_index.en.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Installation
3 | weight: 15
4 | ---
5 |
6 | The following steps are here to help you initialize your new website. If you don't know Hugo at all, we strongly suggest you learn more about it by following this [great documentation for beginners](https://gohugo.io/overview/quickstart/).
7 |
8 | ## Create your project
9 |
10 | Hugo provides a `new` command to create a new website.
11 |
12 | ```
13 | hugo new site
14 | ```
15 |
16 | ## Install the theme
17 |
18 | Install the **Hugo-theme-learn** theme by following [this documentation](https://gohugo.io/themes/installing/)
19 |
20 | This theme's repository is: https://github.com/matcornic/hugo-theme-learn.git
21 |
22 | Alternatively, you can [download the theme as .zip](https://github.com/matcornic/hugo-theme-learn/archive/master.zip) file and extract it in the `themes` directory
23 |
24 | ## Basic configuration
25 |
26 | When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (`config.toml`) and set the theme as the default. You can also add the `[outputs]` section to enable the search functionality.
27 |
28 | ```toml
29 | # Change the default theme to be use when building the site with Hugo
30 | theme = "hugo-theme-learn"
31 |
32 | # For search functionality
33 | [outputs]
34 | home = [ "HTML", "RSS", "JSON"]
35 | ```
36 |
37 | ## Create your first chapter page
38 |
39 | Chapters are pages that contain other child pages. It has a special layout style and usually just contains a _chapter name_, the _title_ and a _brief abstract_ of the section.
40 |
41 | ```
42 | ### Chapter 1
43 |
44 | # Basics
45 |
46 | Discover what this Hugo theme is all about and the core concepts behind it.
47 | ```
48 |
49 | renders as
50 |
51 | 
52 |
53 | **Hugo-theme-learn** provides archetypes to create skeletons for your website. Begin by creating your first chapter page with the following command
54 |
55 | ```
56 | hugo new --kind chapter basics/_index.md
57 | ```
58 |
59 | By opening the given file, you should see the property `chapter=true` on top, meaning this page is a _chapter_.
60 |
61 | By default all chapters and pages are created as a draft. If you want to render these pages, remove the property `draft: true` from the metadata.
62 |
63 | ## Create your first content pages
64 |
65 | Then, create content pages inside the previously created chapter. Here are two ways to create content in the chapter:
66 |
67 | ```
68 | hugo new basics/first-content.md
69 | hugo new basics/second-content/_index.md
70 | ```
71 |
72 | Feel free to edit thoses files by adding some sample content and replacing the `title` value in the beginning of the files.
73 |
74 | ## Launching the website locally
75 |
76 | Launch by using the following command:
77 |
78 | ```
79 | hugo serve
80 | ```
81 |
82 | Go to `http://localhost:1313`
83 |
84 | You should notice three things:
85 |
86 | 1. You have a left-side **Basics** menu, containing two submenus with names equal to the `title` properties in the previously created files.
87 | 2. The home page explains how to customize it by following the instructions.
88 | 3. When you run `hugo serve`, when the contents of the files change, the page automatically refreshes with the changes. Neat!
89 |
90 | ## Build the website
91 |
92 | When your site is ready to deploy, run the following command:
93 |
94 | ```
95 | hugo
96 | ```
97 |
98 | A `public` folder will be generated, containing all static content and assets for your website. It can now be deployed on any web server.
99 |
100 | {{% notice note %}}
101 | 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/)
102 | {{% /notice %}}
103 |
--------------------------------------------------------------------------------
/content/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: libp2p
3 | weight: 1
4 | ---
5 |
6 | Welcome to the libp2p documentation portal! Whether you’re just learning how to build peer-to-peer systems with libp2p, want to dive into peer-to-peer concepts and solutions, or are looking for detailed reference information, this is the place to start.
7 |
8 | ## Overview
9 |
10 | Head over to [What is libp2p?](/introduction/what-is-libp2p/) for an introduction to the basics of libp2p and an overview of the problems it addresses.
11 |
12 |
13 | ## Tutorials
14 |
15 | If you want to dive in, check out our collection of [tutorials](/tutorials/), which will help guide you through your explorations of libp2p.
16 |
17 | ## Examples
18 |
19 | If you want to get a feel for what's possible with libp2p, or just want to see some idiomatic usage, check out the [examples](/examples/). Each libp2p implementation maintains a set of working example projects that can illustrate key concepts and use cases.
20 |
21 | ## Reference
22 |
23 | ### Specifications & Planning
24 |
25 | While libp2p has several implementations, it is fundamentally a set of protocols for peer identity, discover, routing, transport and more.
26 |
27 | See the [specifications section](/reference/specs/) for details.
28 |
29 | ### Implementations
30 |
31 | At the core of libp2p is a set of [specifications](/reference/specs/), which together form the definition for what libp2p is in the abstract and what makes a "correct" libp2p implementation. Today, implementations of libp2p exist in several languages, with varying degrees of completeness. The most complete implementations are in [Go](/reference/go/) and [JavaScript](/reference/js/), with [rust](https://github.com/libp2p/rust-libp2p) maturing rapidly.
32 |
33 | In addition to the implementations above, the libp2p community is actively working on implementations in [python](https://github.com/libp2p/py-libp2p) and [the JVM via Kotlin](https://github.com/web3j/libp2p). Please check the project pages for each implementation to see its status and current state of completeness.
34 |
35 |
36 | ## Community
37 |
38 | Get in touch with other members of the libp2p community who are building tools and applications with libp2p! You can ask questions, discuss new ideas, or get support for problems at https://discuss.ipfs.io, but you can also [hop on IRC](/community/irc/) for a quick chat.
39 |
40 | See the other links in the community section for more information about meetings, events, apps people are building, and more.
41 |
42 | Information about contributing to libp2p and about other software projects in the community are also hosted here.
43 |
44 |
45 | ### Get Involved
46 |
47 | libp2p is an open-source community project. While [Protocol Labs](https://protocol.ai) is able to sponsor some of the work around it, much of the design, code, and effort is contributed by volunteers and community members like you. If you’re interested in helping improve libp2p, check the [contributing](/contributing/) guide to get started.
48 |
49 | If you are diving in to contribute new code, make sure you check both the [contribution guidelines](https://github.com/libp2p/community/blob/master/CONTRIBUTE.md) and the style guide for your language ([Go](https://github.com/ipfs/community/blob/master/CONTRIBUTING_GO.md), [JavaScript](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md)).
50 |
51 |
52 | ### Related Projects
53 |
54 | libp2p began as part of the [IPFS](https://ipfs.io) project, and is still an essential component of IPFS. As such, libp2p composes well with the abstractions and tools provided by other projects in the IPFS "family". Check their individual sites for specific information and references:
55 |
56 | - [IPFS](https://ipfs.io) is the InterPlanetary File System, which uses libp2p as its networking layer.
57 | - [Multiformats](https://multiformats.io) is a variety of *self-describing* data formats.
58 | - [IPLD](https://ipld.io) is a set of tools for describing links between content-addressed data, like IPFS files, Git commits, or Ethereum blocks.
59 | - [The Permissive License Stack](https://protocol.ai/blog/announcing-the-permissive-license-stack) is a licensing strategy for software development that embraces open-source values.
60 |
--------------------------------------------------------------------------------
/content/introduction/_index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Introduction
3 | weight: 1
4 | pre: ' '
5 | ---
6 |
7 | Welcome to the libp2p documentation portal! Whether you’re just learning how to build peer-to-peer systems with libp2p, want to dive into peer-to-peer concepts and solutions, or are looking for detailed reference information, this is the place to start.
8 |
9 | ## Overview
10 |
11 | Head over to [What is libp2p?](/introduction/what-is-libp2p/) for an introduction to the basics of libp2p and an overview of the problems it addresses.
12 |
13 |
14 | ## Tutorials
15 |
16 | If you want to dive in, check out our collection of [tutorials](/tutorials/), which will help guide you through your explorations of libp2p.
17 |
18 | ## Examples
19 |
20 | If you want to get a feel for what's possible with libp2p, or just want to see some idiomatic usage, check out the [examples](/examples/). Each libp2p implementation maintains a set of working example projects that can illustrate key concepts and use cases.
21 |
22 | ## Reference
23 |
24 | ### Specifications & Planning
25 |
26 | While libp2p has several implementations, it is fundamentally a set of protocols for peer identity, discover, routing, transport and more.
27 |
28 | See the [specifications section](/reference/specs/) for details.
29 |
30 | ### Implementations
31 |
32 | At the core of libp2p is a set of [specifications](/reference/specs/), which together form the definition for what libp2p is in the abstract and what makes a "correct" libp2p implementation. Today, implementations of libp2p exist in several languages, with varying degrees of completeness. The most complete implementations are in [Go](/reference/go/), [JavaScript](/reference/js/), and [Rust](https://github.com/libp2p/rust-libp2p).
33 |
34 | In addition to the implementations above, the libp2p community is actively working on implementations in [python](https://github.com/libp2p/py-libp2p) and [the JVM via Kotlin](https://github.com/web3j/libp2p). Please check the project pages for each implementation to see its status and current state of completeness.
35 |
36 |
37 | ## Community
38 |
39 | Get in touch with other members of the libp2p community who are building tools and applications with libp2p! You can ask questions, discuss new ideas, or get support for problems at https://discuss.ipfs.io, but you can also [hop on IRC](/community/irc/) for a quick chat.
40 |
41 | See the other links in the community section for more information about meetings, events, apps people are building, and more.
42 |
43 | Information about contributing to libp2p and about other software projects in the community are also hosted here.
44 |
45 |
46 | ### Get Involved
47 |
48 | libp2p is an open-source community project. While [Protocol Labs](https://protocol.ai) is able to sponsor some of the work around it, much of the design, code, and effort is contributed by volunteers and community members like you. If you’re interested in helping improve libp2p, check the [contributing](/contributing/) guide to get started.
49 |
50 | If you are diving in to contribute new code, make sure you check both the [contribution guidelines](https://github.com/libp2p/community/blob/master/CONTRIBUTE.md) and the style guide for your language ([Go](https://github.com/ipfs/community/blob/master/CONTRIBUTING_GO.md), [JavaScript](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md)).
51 |
52 |
53 | ### Related Projects
54 |
55 | libp2p began as part of the [IPFS](https://ipfs.io) project, and is still an essential component of IPFS. As such, libp2p composes well with the abstractions and tools provided by other projects in the IPFS "family". Check their individual sites for specific information and references:
56 |
57 | - [IPFS](https://libp2p.io) is the InterPlanetary File System, which uses libp2p as its networking layer.
58 | - [Multiformats](https://multiformats.io) is a variety of *self-describing* data formats.
59 | - [IPLD](https://ipld.io) is a set of tools for describing links between content-addressed data, like IPFS files, Git commits, or Ethereum blocks.
60 | - [The Permissive License Stack](https://protocol.ai/blog/announcing-the-permissive-license-stack) is a licensing strategy for software development that embraces open-source values.
61 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/static/js/html5shiv-printshiv.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3 | */
4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document);
5 |
--------------------------------------------------------------------------------
/themes/hugo-theme-learn/layouts/shortcodes/children.html:
--------------------------------------------------------------------------------
1 | {{ $showhidden := .Get "showhidden"}}
2 | {{ $style := .Get "style" | default "li" }}
3 | {{ $depth := .Get "depth" | default 1 }}
4 | {{ $withDescription := .Get "description" | default false }}
5 | {{ $sortTerm := .Get "sort" | default "Weight" }}
6 |
7 |
8 |