Make sure lang switch is only on muli-lang sites + optional ensure all pages are translated

This commit is contained in:
worktop 2024-02-12 11:30:23 -05:00
parent 8b7d450a12
commit 9207d66049
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,6 @@
<footer>
<hr/>
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a><br/>
<a href="/contact">[ Contact ]</a> <a href="/donate">[ Donate ]</a> <a href="/donate">[ RSS ]</a> <br/>
<a href="/{{ .Language.LanguageCode }}">{{ .Site.Title }}</a><br/>
</footer>
<script>

View File

@ -24,6 +24,10 @@
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ end }}
{{ if gt (len .Site.Languages) 1 }}
{{ if and (gt (len .Site.Languages) (len .AllTranslations)) .Site.Params.allTranslated }}
{{ errorf "Error: %s is missing atleast 1 translation" .RelPermalink }}
{{ end }}
<div class="lang-switch" >
<input class="lang-btn" type="checkbox" id="lang-btn" />
<label class="lang-switch" for="lang-btn">
@ -37,6 +41,7 @@
{{ end }}
</div>
</div>
{{ end }}
</div>
</div>
</header>