mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
fix #61
This commit is contained in:
parent
a4f2e0f640
commit
9071837183
5 changed files with 25 additions and 9 deletions
|
@ -13,7 +13,7 @@ This theme is a partial porting of the [Learn theme](http://learn.getgrav.org/)
|
|||
|
||||
## Main features
|
||||
|
||||
* [Automatic Search]({{%relref "basics/configuration/_index.md" %}})
|
||||
* [Automatic Search]({{%relref "basics/configuration/_index.md#activate-search" %}})
|
||||
* [Multilingual mode]({{%relref "cont/i18n/_index.md" %}})
|
||||
* **Unlimited menu levels**
|
||||
* **Automatic next/prev buttons to navigate through menu entries**
|
||||
|
@ -21,7 +21,7 @@ This theme is a partial porting of the [Learn theme](http://learn.getgrav.org/)
|
|||
* [Attachments files]({{%relref "shortcodes/attachments.en.md" %}})
|
||||
* [List child pages]({{%relref "shortcodes/children/_index.md" %}})
|
||||
* [Mermaid diagram]({{%relref "shortcodes/mermaid.en.md" %}}) (flowchart, sequence, gantt)
|
||||
* [Customizable look and feel and themes variants]({{%relref "basics/configuration/_index.md"%}})
|
||||
* [Customizable look and feel and themes variants]({{%relref "basics/style-customization/_index.md"%}})
|
||||
* [Buttons]({{%relref "shortcodes/button.en.md" %}}), [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice.en.md" %}}), [Expand]({{%relref "shortcodes/expand.en.md" %}})
|
||||
|
||||
![Screenshot](https://github.com/matcornic/hugo-theme-learn/raw/master/images/screenshot.png?width=40pc&classes=shadow)
|
||||
|
|
|
@ -11,9 +11,9 @@ Ce thème est un portage partiel du [thème Learn](http://learn.getgrav.org/) de
|
|||
{{% 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"%}})
|
||||
{{% /notice %}}
|
||||
|
||||
## Fonctionnalité principales
|
||||
## Fonctionnalités principales
|
||||
|
||||
* [Recherche automatique]({{%relref "basics/configuration/_index.md" %}})
|
||||
* [Recherche automatique]({{%relref "basics/configuration/_index.md#activer-recherche" %}})
|
||||
* [Mode multi-langue]({{%relref "cont/i18n/_index.md" %}})
|
||||
* **Nombre de niveau infini dans le menu**
|
||||
* **Boutons suivant/précédent automatiquement générés pour naviguer entre les items du menu**
|
||||
|
@ -21,7 +21,7 @@ Ce thème est un portage partiel du [thème Learn](http://learn.getgrav.org/) de
|
|||
* [Fichiers joints]({{%relref "shortcodes/attachments.fr.md" %}})
|
||||
* [Lister les pages filles]({{%relref "shortcodes/children/_index.md" %}})
|
||||
* [Diagrammes Mermaid]({{%relref "shortcodes/mermaid.fr.md" %}}) (flowchart, sequence, gantt)
|
||||
* [Style configurable and variantes de couleurs]({{%relref "basics/configuration/_index.md"%}})
|
||||
* [Style configurable and variantes de couleurs]({{%relref "basics/style-customization/_index.md"%}})
|
||||
* [Boutons]({{%relref "shortcodes/button.fr.md" %}}), [Messages Astuce/Note/Info/Attention]({{%relref "shortcodes/notice.fr.md" %}}), [Expand]({{%relref "shortcodes/expand.fr.md" %}})
|
||||
|
||||
![Screenshot](https://github.com/matcornic/hugo-theme-learn/raw/master/images/screenshot.png?width=40pc&classes=shadow)
|
||||
|
|
|
@ -39,7 +39,7 @@ Notez que certains de ces paramètres sont expliqués en détails dans d'autres
|
|||
themeVariant = ""
|
||||
```
|
||||
|
||||
## Activer la recherche
|
||||
## Activer la recherche {#activer-recherche}
|
||||
|
||||
Si ce n'est pas déjà présent, ajoutez les lignes suivantes dans le fichier `config.toml`.
|
||||
|
||||
|
|
14
layouts/shortcodes/ref.html
Normal file
14
layouts/shortcodes/ref.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{- if in (.Get 0) "/_index.md" -}}
|
||||
{{- $paths := (split (.Get 0) "_index.md") -}}
|
||||
{{- $pagepath := index $paths 0 -}}
|
||||
{{- $anchor := index $paths 1 -}}
|
||||
{{- with .Site.GetPage "section" (trim $pagepath "/") -}}
|
||||
{{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- with .Site.GetPage "section" (.Get 0) }}
|
||||
{{- .URL -}}
|
||||
{{- else -}}
|
||||
{{- .Get 0 | relref .Page -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,7 +1,9 @@
|
|||
{{- if in (.Get 0) "/_index.md" -}}
|
||||
{{- $path := (trim (.Get 0) "_index.md") -}}
|
||||
{{- with .Site.GetPage "section" (trim $path "/") -}}
|
||||
{{- .URL -}}
|
||||
{{- $paths := (split (.Get 0) "_index.md") -}}
|
||||
{{- $pagepath := index $paths 0 -}}
|
||||
{{- $anchor := index $paths 1 -}}
|
||||
{{- with .Site.GetPage "section" (trim $pagepath "/") -}}
|
||||
{{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- with .Site.GetPage "section" (.Get 0) }}
|
||||
|
|
Loading…
Reference in a new issue