diff options
author | Olivier DOSSMANN <git@dossmann.net> | 2019-08-17 19:50:40 +0300 |
---|---|---|
committer | Olivier DOSSMANN <git@dossmann.net> | 2019-08-17 19:50:40 +0300 |
commit | e925bcdaba5017c526351e113ab0b8140e6fe2f3 (patch) | |
tree | 026dd5c3bd6dc81f66420abe2113f4e9d8b77647 | |
parent | efd806d3356f3daaa905670a5641e54f1faa9100 (diff) |
Fix #3 - Adapt Adam & Eve theme to Hugo v0.57:
* change example config.toml to disable some kinds of pages
* homepage: add posts list
* new params: `NoHomepagePostList` to disable this list if possible
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | exampleSite/config.toml | 1 | ||||
-rw-r--r-- | layouts/index.html | 11 | ||||
-rw-r--r-- | theme.toml | 2 |
4 files changed, 24 insertions, 2 deletions
@@ -127,7 +127,17 @@ Pay attention to read this **entire page** before applying what you read! By default a menu is displayed on Homepage. You can disable it. Use `nohomebar` in **config.toml** like this: ```ini -[params] nohomebar = true +[params] + nohomebar = true +``` + +### Homepage posts list + +By default a list of post from `post` directory is shown on Homepage. You can disable it. Use `NoHomepagePostList` in **config.toml** like this: + +```ini +[params] + NoHomepagePostList = true ``` ## Contributing diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ebbd1d8..5443043 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,6 +1,7 @@ baseURL = "https://example.org" theme = "hugo_theme_adam_eve" DefaultContentLanguage = "en" +disableKinds = ["taxonomy", "taxonomyTerm", "section"] [Languages] [Languages.fr] diff --git a/layouts/index.html b/layouts/index.html index dd392f7..283990f 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -17,6 +17,17 @@ </header> <main> {{ .Content }} + {{ $pages := where .Site.RegularPages "Type" "post" }} + {{ if isset .Site.Params "nohomepagepostlist" }} + <!-- No homepage post list --> + {{ else if ne (len $pages) 0 }} + <h1>Posts</h1> + <ul> + {{ range $pages.ByTitle }} + <li><a href="{{ .Permalink }}">{{ .Name }}</a></li> + {{ end }} + </ul> + {{ end }} </main> <footer> <hr /> @@ -8,7 +8,7 @@ description = "A simple wiki in its original formal state" homepage = "https://github.com/blankoworld/hugo_theme_adam_eve" tags = ['minimal', 'wiki-like', 'documentation'] features = ['wiki-like', 'responsive', 'minimal', 'shortcode', 'clean', 'boxes', 'i18n'] -min_version = "0.43" +min_version = "0.57" [author] name = "Olivier DOSSMANN" |