Cleanup templates

This commit is contained in:
Ondřej 2022-10-27 14:45:42 +02:00
parent 2d4d8592ac
commit d6109451e3
9 changed files with 11 additions and 107 deletions

View file

@ -47,6 +47,8 @@ languages:
name: Stav služeb
url: https://status.nolog.cz
weight: 15
params:
target: _blank
- identifier: blog
name: Blog
@ -82,6 +84,8 @@ languages:
name: Status
url: https://status.nolog.cz
weight: 12
params:
target: _blank
- identifier: blog
name: Blog

View file

@ -9,7 +9,6 @@
{{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partialCached "tracking.html" . }}
</head>
<body

View file

@ -1,10 +0,0 @@
<div class="cookieconsent layout__cookieconsent hidden">
<div class="cookieconsent__message">
{{ i18n "cookieconsent_message" }}
{{ with site.Params.privacyPolicyUrl }}<a href="{{ . }}">{{ i18n "privacy_policy" }}</a>{{ end }}
</div>
<div class="cookieconsent__actions">
<button class="button button--small button--cookieconsent button--decline" type="button" data-consent="false">{{ i18n "cookieconsent_decline" }}</button>
<button class="button button--small button--cookieconsent button--accept" type="button" data-consent="true">{{ i18n "cookieconsent_accept" }}</button>
</div>
</div>

View file

@ -15,6 +15,9 @@
{{ if $isActive }}
aria-current="page"
{{ end }}
{{ with .Params.target }}
target="{{ . }}"
{{ end }}
>{{ .Name }}</a>
</li>
{{ end }}

View file

@ -1,35 +0,0 @@
<div class="mobile-nav" dir="ltr">
<div class="mobile-nav__cover"></div>
<a href="#navigation" class="mobile-nav__toggle" aria-haspopup="true" role="button">{{ i18n "menu_mobile" }}</a>
<div class="mobile-nav__sheet">
<div class="mobile-nav__region">
{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}
</div>
<nav class="mobile-nav__main-menu">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="mobile-nav__navbar">
{{ if site.Menus.main -}}
{{ $currentPage := . -}}
{{ range site.Menus.main -}}
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a></li>
{{ end -}}
{{ else -}}
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ range site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ end -}}
</ul>
</nav>
</div>
</div>

View file

@ -10,3 +10,7 @@
{{- $js := resources.Get "main.js" | js.Build | fingerprint -}}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" defer ></script>
{{ if site.Params.plausibleSiteID -}}
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
{{ end -}}

View file

@ -1,23 +0,0 @@
<aside class="sidebar layout__second-sidebar">
<section>
<h4 class="menu"><a href="/services">Services</a></h4>
<ul class="menu">
<li><a href="https://cryptpad.cz">cryptpad.cz</a></li>
<li><a href="https://nitter.cz">nitter.cz</a></li>
<li><a href="https://pad.nolog.cz">pad.nolog.cz</a></li>
<li><a href="https://upload.nolog.cz">upload.nolog.cz</a></li>
<li><a href="https://call.nolog.cz">call.nolog.cz</a></li>
<li><a href="https://decide.nolog.cz">decide.nolog.cz</a></li>
<li><a href="https://nolog.media">nolog.media</a></li>
<li><a href="https://paste.nolog.cz">paste.nolog.cz</a></li>
<li><a href="https://wiki.nolog.cz">wiki.nolog.cz</a></li>
<li><a href="https://bridge.nolog.cz">bridge.nolog.cz</a></li>
<li><a href="https://acab.link">acab.link</a>/<a href="https://nolog.link">nolog.link</a></li>
</ul>
<hr>
<h4><a href="https://newsletter.nolog.cz/subscription/form">Newsletter</a></h4>
</section>
</aside>

View file

@ -1,15 +0,0 @@
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
<aside class="sidebar layout__second-sidebar">
{{ range site.Sections -}}
<section>
<h4 class="menu"><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></h4>
<ul class="menu">
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
</ul>
</section>
{{ end -}}
</aside>

View file

@ -1,23 +0,0 @@
{{ $opts := dict
"minify" true
"params" (dict
"cookieConsent" site.Params.cookieConsent
"piwikTrackerUrl" site.Params.piwikTrackerUrl
"piwikSiteID" site.Params.piwikSiteID
"plausibleSiteID" site.Params.plausibleSiteID
"GoogleAnalytics" site.GoogleAnalytics) -}}
{{ if and site.Params.piwikTrackerUrl site.Params.piwikSiteID -}}
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://{{ site.Params.piwikTrackerUrl }}/matomo.js"></script>
{{ end -}}
{{ if site.Params.plausibleSiteID -}}
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
{{ end -}}
{{ if site.GoogleAnalytics -}}
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
{{ template "_internal/google_analytics.html" . }}
{{ end -}}