Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matcornic/hugo-theme-learn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Taylor <matthew@m-taylor.co.uk>2020-03-09 18:50:24 +0300
committerMatthew Taylor <matalo33@users.noreply.github.com>2020-04-14 13:12:06 +0300
commitd4abb3c9a103bdd14e82184f76463a02755ee070 (patch)
tree3140780aac5b56d7c8f777dfdd6146228c6675a1 /exampleSite
parenteb0f29ee4442261015ff773b8bb82afc40c5ceae (diff)
Allow custom css files to be loaded by configuration
Previously adding custom css files would require the end user to copy the header or footer partial into their overrides. They would then need to maintain that partial into the future. This config allows a user to provide a list of custom css files to load into the theme, meaning they do not need to clone the partial. ``` [params] custom_css = ["css/foo.css", "css/bar.css"] ``` Inspiration taken from https://discourse.gohugo.io/t/how-to-override-css-classes-with-hugo/3033/4
Diffstat (limited to 'exampleSite')
-rw-r--r--exampleSite/content/basics/configuration/_index.en.md10
-rw-r--r--exampleSite/content/basics/configuration/_index.fr.md8
2 files changed, 11 insertions, 7 deletions
diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md
index e56f84b..cdf6075 100644
--- a/exampleSite/content/basics/configuration/_index.en.md
+++ b/exampleSite/content/basics/configuration/_index.en.md
@@ -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 = ""
@@ -24,12 +24,12 @@ 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
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = false
@@ -41,6 +41,8 @@ Note that some of these parameters are explained in details in other sections of
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"]
```
## Activate search
@@ -54,5 +56,5 @@ 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
diff --git a/exampleSite/content/basics/configuration/_index.fr.md b/exampleSite/content/basics/configuration/_index.fr.md
index 6914d99..fb1a4e8 100644
--- a/exampleSite/content/basics/configuration/_index.fr.md
+++ b/exampleSite/content/basics/configuration/_index.fr.md
@@ -24,12 +24,12 @@ 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
# Quand vous utilisez un site multi-langue, utilisez ce paramètre pour désactiver le bouton de changement de langue.
disableLanguageSwitchingButton = false
@@ -37,6 +37,8 @@ Notez que certains de ces paramètres sont expliqués en détails dans d'autres
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}
@@ -50,5 +52,5 @@ 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.