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/).
@ -20,6 +20,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Robots.txt
- Favorite posts
- Pagination on post single page
- Optional "Read more" link
## Installation
@ -66,6 +67,7 @@ params:
dateFormat: "2006-01-02"
paginationSinglePost: true
style: light-without-switcher
readMore: false
markup:
goldmark:
@ -113,7 +115,7 @@ Enabled by `paginationSinglePost` param in `params` section of config.
## 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
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
MIT
(c) Dmitry Kolosov
© Dmitry Kolosov
2020

View File

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

View File

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

View File

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

View File

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

View File

@ -36,3 +36,9 @@ toAllCategories:
skipToContent:
other: "skip to main content"
darkTheme:
other: "dark theme"
lightTheme:
other: "light theme"

View File

@ -36,3 +36,9 @@ toAllCategories:
skipToContent:
other: "passer au contenu principal"
darkTheme:
other: "thème sombre"
lightTheme:
other: "thème léger"

View File

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

View File

@ -36,3 +36,9 @@ toAllCategories:
skipToContent:
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 }}
{{ 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>
</div>
{{ partial "themeSwitcher.html" . }}
</div>
</footer>

View File

@ -1,9 +1,13 @@
<h1 class="site-title">
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
</h1>
{{ 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)
@ -56,8 +54,7 @@
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) {

View File

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