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

@ -1,4 +1,4 @@
# Anubis Theme for Hugo # Anubis Theme for Hugo [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/paypalme/mitrichius/1)
Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
@ -20,6 +20,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Robots.txt - Robots.txt
- Favorite posts - Favorite posts
- Pagination on post single page - Pagination on post single page
- Optional "Read more" link
## Installation ## Installation
@ -66,6 +67,7 @@ params:
dateFormat: "2006-01-02" dateFormat: "2006-01-02"
paginationSinglePost: true paginationSinglePost: true
style: light-without-switcher style: light-without-switcher
readMore: false
markup: markup:
goldmark: goldmark:
@ -113,7 +115,7 @@ Enabled by `paginationSinglePost` param in `params` section of config.
## Contributing ## Contributing
If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/mitrichius/hugo-theme-anubis/issues). If you find a bug or have an idea for a feature, feel free to write an [issue](https://github.com/mitrichius/hugo-theme-anubis/issues) or make a PR.
## TODO ## TODO
See [issues](https://github.com/mitrichius/hugo-theme-anubis/issues). See [issues](https://github.com/mitrichius/hugo-theme-anubis/issues).
@ -121,5 +123,5 @@ See [issues](https://github.com/mitrichius/hugo-theme-anubis/issues).
## License ## License
MIT MIT
(c) Dmitry Kolosov © Dmitry Kolosov
2020 2020

View File

@ -16,6 +16,7 @@ googleAnalytics = ""
dateFormat = "2006-01-02" dateFormat = "2006-01-02"
paginationSinglePost = true paginationSinglePost = true
style = "light-without-switcher" style = "light-without-switcher"
readMore = false
[menu] [menu]

View File

@ -9,13 +9,11 @@ aliases:
author: "Hugo Authors" author: "Hugo Authors"
menu: menu:
about: about:
identifier: about
name: About name: About
title: About title: About
url: /about url: /about
weight: 1 weight: 1
subpage: subpage:
identifier: subpage
parent: about parent: about
name: Subpage name: Subpage
title: Subpage title: Subpage

View File

@ -17,6 +17,7 @@ googleAnalytics = ""
dateFormat = "2006-01-02" dateFormat = "2006-01-02"
paginationSinglePost = true paginationSinglePost = true
style = "light-without-switcher" style = "light-without-switcher"
readMore = false
[languages.en] [languages.en]
languageName = "English" languageName = "English"

View File

@ -36,3 +36,9 @@ toAllCategories:
skipToContent: skipToContent:
other: "Zum Hauptinhalt springen" other: "Zum Hauptinhalt springen"
darkTheme:
other: "Dunkles thema"
lightTheme:
other: "Licht thema"

View File

@ -35,4 +35,10 @@ toAllCategories:
other: "to all categories" other: "to all categories"
skipToContent: skipToContent:
other: "skip to main content" other: "skip to main content"
darkTheme:
other: "dark theme"
lightTheme:
other: "light theme"

View File

@ -35,4 +35,10 @@ toAllCategories:
other: "vers toutes les catégories" other: "vers toutes les catégories"
skipToContent: skipToContent:
other: "passer au contenu principal" other: "passer au contenu principal"
darkTheme:
other: "thème sombre"
lightTheme:
other: "thème léger"

View File

@ -36,3 +36,9 @@ toAllCategories:
skipToContent: skipToContent:
other: "przejdź do głównej zawartości" other: "przejdź do głównej zawartości"
darkTheme:
other: "ciemny schemat"
lightTheme:
other: "lekki schemat"

View File

@ -35,4 +35,10 @@ toAllCategories:
other: "ко списку всех категорий" other: "ко списку всех категорий"
skipToContent: skipToContent:
other: "перейти к основному контенту" other: "перейти к основному контенту"
darkTheme:
other: "тёмная тема"
lightTheme:
other: "светлая тема"

44
i18n/tw.yaml Normal file
View File

@ -0,0 +1,44 @@
powered:
other: "提供"
theme:
other: "主題"
readMore:
other: "繼續閱讀"
toNewPosts:
other: "新文章"
toOldPosts:
other: "舊文章"
tag:
other: "標籤"
Tags:
other: "標籤"
Posts:
other: "文章"
category:
other: "類別"
Categories:
other: "類別"
toAllTags:
other: "所有標籤"
toAllCategories:
other: "所有類別"
skipToContent:
other: "跳至內容"
darkTheme:
other: "暗色主題"
lightTheme:
other: "亮色主題"

View File

@ -3,6 +3,7 @@
{{ if gt $languagesCount 1 }} {{ if gt $languagesCount 1 }}
{{ partial "languageSelect.html" . }} {{ partial "languageSelect.html" . }}
{{ end }} {{ end }}
<div class="common-footer-bottom"> <div class="common-footer-bottom">
{{ if .Site.Menus.footer }} {{ if .Site.Menus.footer }}
{{ $currentPage := . }} {{ $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>. {{ 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> </p>
</div> </div>
{{ partial "themeSwitcher.html" . }}
</div> </div>
{{ partial "themeSwitcher.html" . }}
</footer> </footer>

View File

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

View File

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

View File

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

View File

@ -343,7 +343,7 @@ article figcaption {
} }
.read-more { .read-more {
font-size: 0.85em; margin: 1em 0;
} }
.divider { .divider {
@ -442,6 +442,7 @@ ul.language-select > li, ul.footer-menu > li {
font-size: 16px; font-size: 16px;
border: none; border: none;
margin-right: 1em; margin-right: 1em;
margin-bottom: 1em;
} }
/* Media Queries */ /* Media Queries */
@ -473,7 +474,7 @@ ul.language-select > li, ul.footer-menu > li {
text-align: center; text-align: center;
} }
header nav { header nav:not(:empty){
background: var(--pagination-bg-color); background: var(--pagination-bg-color);
margin-top: 1em; margin-top: 1em;
max-width: 100%; max-width: 100%;