Merge branch 'master' into master

This commit is contained in:
Dmitry Kolosov 2020-09-07 21:09:26 +03:00 committed by GitHub
commit d40b63815f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 105 additions and 25 deletions

View file

@ -3,6 +3,7 @@
{{ if gt $languagesCount 1 }}
{{ partial "languageSelect.html" . }}
{{ end }}
<div class="common-footer-bottom">
{{ if .Site.Menus.footer }}
{{ $currentPage := . }}
@ -17,6 +18,7 @@
{{ i18n "powered" | humanize }} <a target="_blank" rel="noopener noreferrer" href="https://gohugo.io/">Hugo</a>, {{ i18n "theme" }} <a target="_blank" rel="noopener noreferrer" href="https://github.com/mitrichius/hugo-theme-anubis">Anubis</a>.
</p>
</div>
{{ partial "themeSwitcher.html" . }}
</div>
{{ partial "themeSwitcher.html" . }}
</footer>

View file

@ -1,9 +1,13 @@
<h1 class="site-title">
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
</h1>
<nav>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</nav>
{{ if .Site.Menus.main }}
<nav>
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</nav>
{{ else }}
<nav></nav>
{{ end }}

View file

@ -6,11 +6,11 @@
<div class="content post-summary">
{{ .Summary | safeHTML }}
</div>
<!-- {{ if .Truncated }}
{{ if and (.Truncated) (.Site.Params.readMore) }}
<div class="read-more">
<a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
</div>
{{ end }} -->
{{ end }}
{{ partial "postInfo.html" . }}
</article>

View file

@ -5,7 +5,7 @@
{{ if not (in (slice "light-without-switcher" "dark-without-switcher" "auto-without-switcher") $style) }}
<button class="theme-switcher">
Dark theme
{{ i18n "darkTheme" | humanize }}
</button>
<script>
@ -36,8 +36,6 @@
switchButton.addEventListener('click', switchTheme, false)
})
function detectCurrentScheme() {
if (localStorage.getItem(STORAGE_KEY)) {
return localStorage.getItem(STORAGE_KEY)
@ -55,9 +53,8 @@
}
function changeButtonText()
{
console.log(currentTheme)
switchButton.textContent = currentTheme == 'dark' ? 'Light theme' : 'Dark theme'
{
switchButton.textContent = currentTheme == 'dark' ? {{ i18n "lightTheme" | humanize }} : {{ i18n "darkTheme" | humanize }}
}
function switchTheme(e) {