Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hugo Learn theme to latest #4

Draft
wants to merge 1 commit into
base: devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/themes/hugo-theme-learn/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true

[*.js]
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions src/themes/hugo-theme-learn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
public/
exampleSite/public
25 changes: 25 additions & 0 deletions src/themes/hugo-theme-learn/.grenrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
dataSource: "prs"
prefix: "v"
onlyMilestones: false
changelogFilename: "CHANGELOG.md"
includeMessages: "all"
ignoreIssuesWith:
- "support"
ignoreLabels:
- "duplicate"
- "invalid"
- "wontfix"
groupBy:
New features:
- "feature"
Bug Fixes:
- "bug"
Enhancements:
- "enhancement"
Internationalisation:
- "i18n"
Theme Meta:
- "meta"
Uncategorised:
- "closed"
52 changes: 48 additions & 4 deletions src/themes/hugo-theme-learn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,62 @@
# Changelog

## v2.5.0 (01/06/2020)

#### New features

- [**feature**] Allow custom css files to be loaded by configuration [#376](https://github.com/matcornic/hugo-theme-learn/pull/376)
- [**feature**] Added flag to turn off image featherlight [#333](https://github.com/matcornic/hugo-theme-learn/pull/333)

#### Bug Fixes

- [**bug**] fix null pointer when no params on image url [#383](https://github.com/matcornic/hugo-theme-learn/pull/383)
- [**bug**] can't give argument to non-function not .Params.hidden [#403](https://github.com/matcornic/hugo-theme-learn/pull/403)
- [**bug**] Fix .File.UniqueID on zero object warning [#372](https://github.com/matcornic/hugo-theme-learn/pull/372)
- [**bug**] fix select option color in Chrome [#345](https://github.com/matcornic/hugo-theme-learn/pull/345)
- [**bug**] remove unneeded spaces from HTML [#320](https://github.com/matcornic/hugo-theme-learn/pull/320)
- [**bug**] Avoid displaying hidden sections in menu [#354](https://github.com/matcornic/hugo-theme-learn/pull/354)

#### Enhancements

- [**enhancement**] Updated theme installation documentation link. [#390](https://github.com/matcornic/hugo-theme-learn/pull/390)
- [**enhancement**] [ImgBot] Optimize images [#366](https://github.com/matcornic/hugo-theme-learn/pull/366)
- [**enhancement**] fix extra spaces in the description [#339](https://github.com/matcornic/hugo-theme-learn/pull/339)
- [**enhancement**] change to minified 'autocomplete.js' for improved performance [#321](https://github.com/matcornic/hugo-theme-learn/pull/321)

#### Internationalisation

- [**i18n**] Fix: typos [#343](https://github.com/matcornic/hugo-theme-learn/pull/343)
- [**i18n**] Fix: typo [#342](https://github.com/matcornic/hugo-theme-learn/pull/342)
- [**i18n**] Incorrect english in notice documentation [#336](https://github.com/matcornic/hugo-theme-learn/pull/336)
- [**i18n**] Add Chinese language for this theme [#349](https://github.com/matcornic/hugo-theme-learn/pull/349)
- [**i18n**] Add jp and zh cn [#335](https://github.com/matcornic/hugo-theme-learn/pull/335)
- [**i18n**] Added Russian translation [#332](https://github.com/matcornic/hugo-theme-learn/pull/332)

#### Theme Meta

- [**meta**] Fix various linting warnings [#405](https://github.com/matcornic/hugo-theme-learn/pull/405)
- [**meta**] Netlify build on 0.66.0 [#377](https://github.com/matcornic/hugo-theme-learn/pull/377)
- [**meta**] add inteliver documentation showcase [#331](https://github.com/matcornic/hugo-theme-learn/pull/331)

---

## v2.4.0 (04/09/2019)

#### Bug Fixes

- [**bug**] correct GitHub capitalization [#293](https://github.com/matcornic/hugo-theme-learn/pull/293)
- [**bug**] fix 'locate' typo [#285](https://github.com/matcornic/hugo-theme-learn/pull/285)
- [**bug**] Remove reference to the unused horsey CSS [#284](https://github.com/matcornic/hugo-theme-learn/pull/284)
- [**bug**] Fix invalid HTML in 404 template. [#271](https://github.com/matcornic/hugo-theme-learn/pull/271)
- [**bug**] fix 'locate' typo [#285](https://github.com/matcornic/hugo-theme-learn/pull/285)

#### Enhancements

- [**enhancement**] Delete html5shiv-printshiv.min.js [#319](https://github.com/matcornic/hugo-theme-learn/pull/319)
- [**enhancement**] remove html5shiv [#315](https://github.com/matcornic/hugo-theme-learn/pull/315)
- [**enhancement**] Fix deprecated .Hugo, .UniqueID and .URL references [#303](https://github.com/matcornic/hugo-theme-learn/pull/303)
- [**enhancement**] remove unneeded type="text/css" [#297](https://github.com/matcornic/hugo-theme-learn/pull/297)
- [**enhancement**] Fix type lines 364 and 369 [#304](https://github.com/matcornic/hugo-theme-learn/pull/304)
- [**enhancement**] remove unneeded type="text/css" [#298](https://github.com/matcornic/hugo-theme-learn/pull/298)
- [**enhancement**] remove unneeded type="text/css" [#297](https://github.com/matcornic/hugo-theme-learn/pull/297)
- [**enhancement**] HTTPS links in footer [#295](https://github.com/matcornic/hugo-theme-learn/pull/295)
- [**enhancement**] remove unneeded type="text/css" [#292](https://github.com/matcornic/hugo-theme-learn/pull/292)
- [**enhancement**] Make shortcodes & example site compatible with Hugo v0.55 [#281](https://github.com/matcornic/hugo-theme-learn/pull/281)
Expand All @@ -25,6 +65,10 @@

- [**i18n**] Added German and Arabic translation [#312](https://github.com/matcornic/hugo-theme-learn/pull/312)

#### Theme Meta

- [**meta**] Added Tshark.dev as example site [#318](https://github.com/matcornic/hugo-theme-learn/pull/318)

---

## v2.3.0 (16/04/2019)
Expand Down Expand Up @@ -160,16 +204,17 @@

#### Uncategorised

- [**closed**] Fix anchor scrolling that hides behind top nav bar [#46](https://github.com/matcornic/hugo-theme-learn/pull/46)
- [**closed**] feat: Change the default code color [#43](https://github.com/matcornic/hugo-theme-learn/pull/43)
- [**closed**] Use index pages + automatic navigation arrows [#36](https://github.com/matcornic/hugo-theme-learn/pull/36)
- [**closed**] Fix anchor scrolling that hides behind top nav bar [#46](https://github.com/matcornic/hugo-theme-learn/pull/46)

---

## v1.0.0 (25/03/2017)

#### Uncategorised

- [**closed**] Search [#18](https://github.com/matcornic/hugo-theme-learn/pull/18)
- [**closed**] Extracted menu footer content to separate partial file [#35](https://github.com/matcornic/hugo-theme-learn/pull/35)
- [**closed**] feat: style Hugo figure shortcode [#33](https://github.com/matcornic/hugo-theme-learn/pull/33)
- [**closed**] Fix URL for 'Edit this page' on Windows [#27](https://github.com/matcornic/hugo-theme-learn/pull/27)
Expand All @@ -179,4 +224,3 @@
- [**closed**] Menu generation using Content file instead directories [#5](https://github.com/matcornic/hugo-theme-learn/pull/5)
- [**closed**] Add Checkmark On visited Links [#4](https://github.com/matcornic/hugo-theme-learn/pull/4)
- [**closed**] doc: Add theme installation instructions [#1](https://github.com/matcornic/hugo-theme-learn/pull/1)
- [**closed**] Search [#18](https://github.com/matcornic/hugo-theme-learn/pull/18)
10 changes: 10 additions & 0 deletions src/themes/hugo-theme-learn/exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ defaultContentLanguageInSubdir= true
showVisitedLinks = true
disableBreadcrumb = false
disableNextPrev = false
disableLandingPageButton = true
disableMermaid = false
customMermaidURL = "https://unpkg.com/[email protected]/dist/mermaid.min.js"
titleSeparator = "::"

[outputs]
home = [ "HTML", "RSS", "JSON"]
Expand All @@ -24,6 +28,8 @@ home = [ "HTML", "RSS", "JSON"]
title = "Documentation for Hugo Learn Theme"
weight = 1
languageName = "English"
landingPageURL = "/en"
landingPageName = "<i class='fas fa-home'></i> Home"

[[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub repo"
Expand Down Expand Up @@ -51,6 +57,8 @@ weight = 30
title = "Documentation du thème Hugo Learn"
weight = 2
languageName = "Français"
landingPageURL = "/fr"
landingPageName = "<i class='fas fa-home'></i> Accueil"

[[Languages.fr.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> Repo GitHub"
Expand Down Expand Up @@ -78,6 +86,8 @@ weight = 30
title = "Hugo 主题的 Learn 文档"
weight = 3
languageName = "简体中文"
landingPageURL = "/zh"
landingPageName = "<i class='fas fa-home'></i> 家"

[[Languages.zh.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub 仓库"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Note that some of these parameters are explained in details in other sections of

```toml
[params]
# Prefix URL to edit current page. Will display an "Edit this page" button on top right hand corner of every page.
# Prefix URL to edit current page. Will display an "Edit this page" button on top right hand corner of every page.
# Useful to give opportunity to people to create merge request for your doc.
# See the config.toml file from this documentation site to have an example.
editURL = ""
Expand All @@ -24,23 +24,34 @@ Note that some of these parameters are explained in details in other sections of
showVisitedLinks = false
# Disable search function. It will hide search bar
disableSearch = false
# Javascript and CSS cache are automatically busted when new version of site is generated.
# Javascript and CSS cache are automatically busted when new version of site is generated.
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
disableAssetsBusting = false
# Set this to true to disable copy-to-clipboard button for inline code.
disableInlineCopyToClipBoard = false
# A title for shortcuts in menu is set by default. Set this to true to disable it.
# A title for shortcuts in menu is set by default. Set this to true to disable it.
disableShortcutsTitle = false
# If set to false, a Home button will appear below the search bar on the menu.
# It is redirecting to the landing page of the current language if specified. (Default is "/")
disableLandingPageButton = true
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = false
# Hide breadcrumbs in the header and only show the current page title
disableBreadcrumb = true
# If set to true, prevents Hugo from including the mermaid module if not needed (will reduce load times and traffic)
disableMermaid = false
# Specifies the remote location of the mermaid js
customMermaidURL = "https://unpkg.com/[email protected]/dist/mermaid.min.js"
# Hide Next and Previous page buttons normally displayed full height beside content
disableNextPrev = true
# Order sections in menu by "weight" or "title". Default to "weight"
ordersectionsby = "weight"
# Change default color scheme with a variant one. Can be "red", "blue", "green".
themeVariant = ""
# Provide a list of custom css files to load relative from the `static/` folder in the site root.
custom_css = ["css/foo.css", "css/bar.css"]
# Change the title separator. Default to "::".
titleSeparator = "-"
```

## Activate search
Expand All @@ -54,5 +65,48 @@ home = [ "HTML", "RSS", "JSON"]

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.

> Hugo generate lunrjs index.json at the root of public folder.
> Hugo generate lunrjs index.json at the root of public folder.
> When you build the site with `hugo server`, hugo generates it internally and of course it doesn’t show up in the filesystem

## Mermaid

The mermaid configuration parameters can also be set on a specific page. In this case, the global parameter would be overwritten by the local one.

> Example:
>
> Mermaid is globally disabled. By default it won't be loaded by any page.
> On page "Architecture" you need a class diagram. You can set the mermaid parameters locally to only load mermaid on this page (not on the others).

You also can disable mermaid for specific pages while globally enabled.

## Home Button Configuration

If the `disableLandingPage` option is set to `false`, an Home button will appear
on the left menu. It is an alternative for clicking on the logo. To edit the
appearance, you will have to configure two parameters for the defined languages:

```toml
[Lanugages]
[Lanugages.en]
...
landingPageURL = "/en"
landingPageName = "<i class='fas fa-home'></i> Redirect to Home"
...
[Lanugages.fr]
...
landingPageURL = "/fr"
landingPageName = "<i class='fas fa-home'></i> Accueil"
...
```

If those params are not configured for a specific language, they will get their
default values:

```toml
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
```

The home button is going to looks like this:

![Default Home Button](/en/basics/configuration/images/home_button_defaults.jpg?width=100%)
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,28 @@ Notez que certains de ces paramètres sont expliqués en détails dans d'autres
showVisitedLinks = false
# Désactive la fonction de recherche. Une valeur à true cache la barre de recherche.
disableSearch = false
# Par défaut, le cache Javascript et CSS est automatiquement vidé lorsqu'une nouvelle version du site est générée.
# Par défaut, le cache Javascript et CSS est automatiquement vidé lorsqu'une nouvelle version du site est générée.
# Utilisez ce paramètre lorsque vous voulez désactiver ce comportement (c'est parfois incompatible avec certains proxys)
disableAssetsBusting = false
# Utilisez ce paramètre pour désactiver le bouton copy-to-clipboard pour le code formatté sur une ligne.
disableInlineCopyToClipBoard = false
# Un titre est défini par défaut lorsque vous utilisez un raccourci dans le menu. Utilisez ce paramètre pour le cacher.
# Un titre est défini par défaut lorsque vous utilisez un raccourci dans le menu. Utilisez ce paramètre pour le cacher.
disableShortcutsTitle = false
# S'il est réglé sur faux, un bouton Accueil apparaîtra sous la barre de recherche dans le menu.
# Il redirige vers la page d'accueil de la langue actuelle si cela est spécifié. (La valeur par défaut est "/")
disableLandingPageButton = true
# Si défini à true, empêche Hugo d'inclure le module "mermaid" s'il n'est pas nécessaire (réduira les temps de chargement et le trafic)
disableMermaid = false
# Spécifie l'emplacement distant du mermaid js
customMermaidURL = "https://unpkg.com/[email protected]/dist/mermaid.min.js"
# Quand vous utilisez un site multi-langue, utilisez ce paramètre pour désactiver le bouton de changement de langue.
disableLanguageSwitchingButton = false
# Ordonne les sections dans menu par poids ("weight") ou titre ("title"). Défaut à "weight"
ordersectionsby = "weight"
# Utilisez ce paramètre pour modifier le schéma de couleur du site. Les valeurs par défaut sont "red", "blue", "green".
themeVariant = ""
# Fournissez une liste de fichiers css personnalisés à charger par rapport depuis le dossier `static/` à la racine du site.
custom_css = ["css/foo.css", "css/bar.css"]
```

## Activer la recherche {#activer-recherche}
Expand All @@ -50,5 +59,52 @@ home = [ "HTML", "RSS", "JSON"]

Le thème *Learn* utilise les dernières améliorations d'Hugo pour générer un fichier d'index JSON, prêt à être consommé par le moteur de recherche lunr.js.

> Hugo génère lunrjs index.json à la racine du dossier `public`.
> Hugo génère lunrjs index.json à la racine du dossier `public`.
> 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.

## Mermaid

Les paramètres de configuration du mermaid peuvent également être définis sur une page spécifique. Dans ce cas, le paramètre global sera écrasé par le paramètre local.

> Exemple:
>
> Mermaid est globalement handicapé. Par défaut, elle ne sera chargée par aucune page.
> À la page "Architecture", vous avez besoin d'un diagramme de classe. Vous pouvez régler les paramètres de mermaid localement pour ne charger que la sirène sur cette page (pas sur les autres).

Vous pouvez également désactiver mermaid pour des pages spécifiques tout en l'activant globalement.
<<<<<<< HEAD

## Configuration du bouton Accueil

Si l'option `disableLandingPage` est définie sur `false`, un bouton
"Accueil" apparaîtra dans le menu de gauche. C'est une alternative pour cliquer
sur le logo. Pour modifier le vous devrez configurer deux paramètres pour les
langues définies :

```toml
[Lanugages]
[Lanugages.en]
...
landingPageURL = "/en"
landingPageName = "<i class='fas fa-home'></i> Redirect to Home"
...
[Lanugages.fr]
...
landingPageURL = "/fr"
landingPageName = "<i class='fas fa-home'></i> Accueil"
...
```

Si ces paramètres ne sont pas configurés pour une langue spécifique, ils
obtiendront leur valeurs par défaut:

```toml
landingPageURL = "/"
landingPageName = "<i class='fas fa-home'></i> Home"
```

Le bouton d'accueil va ressembler à ceci:

![Default Home Button](/en/basics/configuration/images/home_button_defaults.jpg?width=100%)
=======
>>>>>>> 023fe7ef2b4c45fe66ac932d9e25d09f30b74a4e
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hugo new site <new_project>

## Install the theme

Install the **Hugo-theme-learn** theme by following [this documentation](https://gohugo.io/themes/installing/)
Install the **Hugo-theme-learn** theme by following [this documentation](https://gohugo.io/getting-started/quick-start/#step-3-add-a-theme)

This theme's repository is: https://github.com/matcornic/hugo-theme-learn.git

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Archetypes
weight: 10
---

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

It is pre-configured skeleton pages with default front matter. Please refer to the documentation for types of page to understand the differences.

Expand Down Expand Up @@ -54,4 +54,4 @@ weight = 5
+++

Lorem Ipsum.
```
```
Loading