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

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfourtyone11 <asleeppiano@outlook.com>2020-04-22 10:56:27 +0300
committerfourtyone11 <asleeppiano@outlook.com>2020-04-22 10:56:27 +0300
commitd2f7d015182420138d0eda4f6ae5819d67cceeff (patch)
tree461a1ad08daf40be65cab01ffed2e8875dc41cdd
parent8541b1746c505c59fe5ab6ce46bff873bc5a5915 (diff)
cssonly fix
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/_default/baseof.html8
-rw-r--r--layouts/partials/header.html22
-rw-r--r--layouts/partials/mobile-header-nav.html2
4 files changed, 18 insertions, 16 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index acf432a..292abc9 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -13,7 +13,7 @@ favicon = ""
[params]
description = "simple hugo theme"
featured = true
- cssonly = true
+ cssonly = false
facebook = ""
twitter = ""
instagram = ""
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 881bf2e..3dea98d 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -7,8 +7,12 @@
{{- block "main" . }}{{- end }}
</div>
{{- block "footer" . }}{{- end}}
- {{ if not (isset .Site.Params "cssonly") }}
- {{ partial "script.html" . }}
+ {{ with .Site.Params.cssonly}}
+ {{if eq . false}}
+ {{ partial "script.html" . }}
+ {{end}}
+ {{ else }}
+ {{ partial "script.html" }}
{{end}}
</body>
</html>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 0d8a448..a932c46 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -34,26 +34,24 @@
{{ end }}
{{ end }}
</ul>
- <button class="header-nav-list__nav-btn {{ if isset .Site.Params "cssonly"}} css-only {{ end }}">navigation</button>
+ <button class="header-nav-list__nav-btn {{ with .Site.Params.cssonly}} {{ if eq . true }} css-only {{ end }} {{end}}">navigation</button>
{{partial "navigation" .}}
</nav>
- {{if isset .Site.Params "cssonly"}}
- <a href="#mobile-header-nav" class="mb-header__menu-btn">
- <span class="mb-header__menu-btn-line"></span>
- <span class="mb-header__menu-btn-line"></span>
- <span class="mb-header__menu-btn-line"></span>
- </a>
+ {{with .Site.Params.cssonly}}
+ {{ if eq . true }}
+ <a href="#mobile-header-nav" class="mb-header__menu-btn">
+ <span class="mb-header__menu-btn-line"></span>
+ <span class="mb-header__menu-btn-line"></span>
+ <span class="mb-header__menu-btn-line"></span>
+ </a>
+ {{end}}
{{else}}
- <button class="{{ if isset .Site.Params "cssonly"}} css-only {{ end }} mb-header__menu-btn ">
+ <button class="mb-header__menu-btn">
<span class="mb-header__menu-btn-line"></span>
<span class="mb-header__menu-btn-line"></span>
<span class="mb-header__menu-btn-line"></span>
</button>
{{end}}
</div>
- {{if isset .Site.Params "cssonly"}}
{{partial "mobile-header-nav" .}}
- {{else}}
- {{partial "mobile-popup" .}}
- {{end}}
</header>
diff --git a/layouts/partials/mobile-header-nav.html b/layouts/partials/mobile-header-nav.html
index 9e0d0b1..a04a0a4 100644
--- a/layouts/partials/mobile-header-nav.html
+++ b/layouts/partials/mobile-header-nav.html
@@ -1,5 +1,5 @@
<nav id="mobile-header-nav" class="mb-header-nav">
- {{ $cssonly := isset .Site.Params "cssonly" }}
+ {{ $cssonly := .Site.Params.cssonly }}
{{ if $cssonly }}
<a href="#" class="mb-header-nav__close-btn">
<svg