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

github.com/gohugoio/hugoThemesSite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex <onedrawingperday@gmail.com>2020-01-02 19:55:29 +0300
committerAlex <onedrawingperday@gmail.com>2020-01-02 19:55:29 +0300
commit4cfd90dddccf4e23962d8d201b4be577ad6d726c (patch)
treeb45d9a626231fbf3381bbbcf2477a9f0bccc97f6
parent22691c426316c46fa269a644b3087026448e593b (diff)
Add support for disabling the HomePage button
This is meant for themes that violate content guidelines
-rw-r--r--config.toml2
-rw-r--r--layouts/partials/theme-buttons.html9
2 files changed, 10 insertions, 1 deletions
diff --git a/config.toml b/config.toml
index 323ad04..cd51daa 100644
--- a/config.toml
+++ b/config.toml
@@ -73,6 +73,8 @@ anchor = "smart"
github_repo = "https://github.com/spf13/hugothemes"
gitter = "https://gitter.im/spf13/hugo"
forum = "https://discourse.gohugo.io/"
+#This array is meant for disabling the Homepage button of a theme.
+#noHomePage = [""]
# GLOBAL = IF ANYTHING CHANGES BELOW UPDATE MAIN, DOCS, THEMES
diff --git a/layouts/partials/theme-buttons.html b/layouts/partials/theme-buttons.html
index f0fdd98..efc4c5d 100644
--- a/layouts/partials/theme-buttons.html
+++ b/layouts/partials/theme-buttons.html
@@ -7,10 +7,17 @@
{{ with .Params.demo }}
<a class="{{ $buttonClasses }}" href="{{ . }}"><i class="fa fa-road"></i> Demo</a>
{{ end }}
-
+ {{ $noHomePage := . }}
+ {{ with .Site.Params.noHomePage }}
+ {{ range . }}
+ {{ $noHomePage = . }}
+ {{ end }}
+ {{ end }}
+ {{ if not (in .Permalink $noHomePage) }}
{{ with .Params.homepage}}
<a class="{{ $buttonClasses }}" href="{{.}}"><i class="fa fa-home"></i> Homepage</a>
{{ end }}
+ {{ end }}
</div>