Merge branch 'master' of https://github.com/Mitrichius/hugo-theme-anubis into add-isso-feed

This commit is contained in:
Jan Fader 2022-05-22 11:40:56 +02:00
commit f8c6877c16
No known key found for this signature in database
GPG Key ID: 1A6BDEFB0E27FA44
52 changed files with 790 additions and 162 deletions

View File

@ -16,11 +16,12 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/).
- Mobile support - Mobile support
- Social icons - Social icons
- Google Analytics - Google Analytics
- Disqus - Comment systems: Disqus, ISSO, Utteranc.es, GraphComment
- ISSO
- Utteranc.es
- RSS feeds - RSS feeds
- Related posts (Read Next section)
- Deploy via Netlify (config included in example site)
- Hiding posts from the RSS feed - Hiding posts from the RSS feed
- Hidden posts (available only by link)
- Translations (en, ru, fr, pl) - Translations (en, ru, fr, pl)
- Custom CSS/JS - Custom CSS/JS
- Multilingual mode - Multilingual mode
@ -80,8 +81,11 @@ params:
dateFormat: "2006-01-02" dateFormat: "2006-01-02"
paginationSinglePost: true paginationSinglePost: true
style: light-without-switcher style: light-without-switcher
readMore: false readMore: false # show read more button
readNextPosts: 5 # show 5 related posts, 0 by default
disableSummary: false disableSummary: false
copyCodeButton: true # true by default
rssAsSocialIcon: true
# utteranc.es support # utteranc.es support
utterancesRepo: "" # mandatory utterancesRepo: "" # mandatory
utterancesTheme: "" # optional utterancesTheme: "" # optional
@ -101,6 +105,7 @@ params:
avatar: true # optional avatar: true # optional
avatar-bg: "#f0f0f0" # optional avatar-bg: "#f0f0f0" # optional
feed: false # optional feed: false # optional
graphcommentId: ""
webmentions: webmentions:
url: https://yourdomain.com/webemntions/receive url: https://yourdomain.com/webemntions/receive
login: hugo-theme-anubis login: hugo-theme-anubis
@ -131,9 +136,9 @@ Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your
### Dark Mode ### Dark Mode
Customize via `style` param in `params` section of config. Customize via `style` param in `params` section of config.
Options: Options:
- `light-without-switcher` - light theme, without switcher, JS-free (by default) - `light-without-switcher` - light theme, without switcher (by default)
- `dark-without-switcher` - dark theme, without switcher, JS-free - `dark-without-switcher` - dark theme, without switcher
- `auto-without-switcher` - theme based on user system settings, without switcher, JS-free - `auto-without-switcher` - theme based on user system settings, without switcher
- `light` - light theme by default, can be switched by user to dark theme and back. Theme settings are saved for user - `light` - light theme by default, can be switched by user to dark theme and back. Theme settings are saved for user
- `dark` - dark theme by default, can be switched by user to light theme and back. Theme settings are saved for user - `dark` - dark theme by default, can be switched by user to light theme and back. Theme settings are saved for user
- `auto` - theme based on user system settings by default, can be switched by user to dark/light theme. Theme settings are saved for user (by default in example sites) - `auto` - theme based on user system settings by default, can be switched by user to dark/light theme. Theme settings are saved for user (by default in example sites)
@ -202,15 +207,25 @@ Only works for production environment.
### Multilingual mode ### Multilingual mode
Check config/example usage in [exampleSiteMultilingual](https://github.com/Mitrichius/hugo-theme-anubis/tree/master/exampleSiteMultilingual) directory and documentation on [Hugo site](https://gohugo.io/content-management/multilingual/). Check config/example usage in [exampleSiteMultilingual](https://github.com/Mitrichius/hugo-theme-anubis/tree/master/exampleSiteMultilingual) directory and documentation on [Hugo site](https://gohugo.io/content-management/multilingual/).
### RSS
RSS is available by site url + /index.xml. Also available for specific language, section, taxonomy.
`rssAsSocialIcon` parameter enables rss sosial icon with link to site current language RSS.
### Robots.txt ### Robots.txt
Based on environment. Based on environment.
For production — allow all, for other — disallow all. For production — allow all, for other — disallow all.
### Favorite posts ### Favorite posts
To mark posts as favorite just add `favorite: true` in post's front matter. It adds a "★" icon nearby post's title. Add `favorite: true` to post front matter. It adds a "★" icon nearby post's title.
### Related posts (Read Next section)
Based on `readNextPosts` config parameter. Check [this article](https://gohugo.io/content-management/related/#configure-related-content) for configuration details.
### Hiding posts from RSS ### Hiding posts from RSS
To hide a post from the RSS feed, just add `disable_feed: true` to its front matter. Add `disable_feed: true` to post front matter.
### Make post available only by link
Add `hidden: true` to post front matter. Post also is not available in RSS feed.
### Pagination on post single page ### Pagination on post single page
Enabled by `paginationSinglePost` param in `params` section of config. Enabled by `paginationSinglePost` param in `params` section of config.
@ -219,6 +234,9 @@ Enabled by `paginationSinglePost` param in `params` section of config.
To provide webmention support you can **either** specify your webmention.io username with `login: webmentionusername` **or** specify a link to your custom webmention endpoint with `url: https://yourdomain.com/webemntions/receive`. To provide webmention support you can **either** specify your webmention.io username with `login: webmentionusername` **or** specify a link to your custom webmention endpoint with `url: https://yourdomain.com/webemntions/receive`.
If you use webmention.io you can also enable pingback with `pingback: true` If you use webmention.io you can also enable pingback with `pingback: true`
### Disabling comments per-page basis
Add `disableComments: true` to post front matter.
## 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) or make a PR. 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.

View File

@ -12,8 +12,8 @@
--nav-bg-color: #242424; --nav-bg-color: #242424;
--nav-link-color: #b6b6b6; --nav-link-color: #b6b6b6;
--pre-color: #333; --pre-color: #f8f8f2;
--pre-bg-color: #f1f1f1; --pre-bg-color: #272822;
--bq-color: #ccc; --bq-color: #ccc;
--hr-color: #333; --hr-color: #333;
@ -25,3 +25,6 @@
--switcher-color: #333; --switcher-color: #333;
--switcher-bg-color: #fff; --switcher-bg-color: #fff;
--svg-color: #ccc;
--svg-state-color:#ff5858;

View File

@ -13,8 +13,8 @@
--nav-bg-color: #fafafa; --nav-bg-color: #fafafa;
--nav-link-color: #696969; --nav-link-color: #696969;
--pre-color: #333; --pre-color: #f8f8f2;
--pre-bg-color: #f1f1f1; --pre-bg-color: #272822;
--bq-color: #ccc; --bq-color: #ccc;
--hr-color: #ccc; --hr-color: #ccc;
@ -26,4 +26,7 @@
--switcher-color: #fff; --switcher-color: #fff;
--switcher-bg-color: #333; --switcher-bg-color: #333;
--svg-color: #333;
--svg-state-color: #a31d1d;
} }

View File

@ -341,7 +341,6 @@ article:not(:last-of-type) {
padding-bottom: 2em; padding-bottom: 2em;
} }
article header h1 { article header h1 {
font-size: 1.35em; font-size: 1.35em;
line-height: 1.1em; line-height: 1.1em;
@ -356,6 +355,87 @@ article header h1 a {
text-decoration: none; text-decoration: none;
} }
.post h1,
.post h2,
.post h3,
.post h4,
.post h5,
.post h6 {
position: relative;
}
.post h1 a,
.post h2 a,
.post h3 a,
.post h4 a,
.post h5 a,
.post h6 a {
opacity: 0;
position: absolute;
left: -1.2rem;
}
.post h1:hover a,
.post h2:hover a,
.post h3:hover a,
.post h4:hover a,
.post h5:hover a,
.post h6:hover a {
opacity: 1;
border-bottom: none;
}
.post h1 a:hover,
.post h1 a:focus,
.post h1 a:active,
.post h2 a:hover,
.post h2 a:focus,
.post h2 a:active,
.post h3 a:hover,
.post h3 a:focus,
.post h3 a:active,
.post h4 a:hover,
.post h4 a:focus,
.post h4 a:active,
.post h5 a:hover,
.post h5 a:focus,
.post h5 a:active,
.post h6 a:hover,
.post h6 a:focus,
.post h6 a:active {
border-bottom: none;
}
.post h1 svg,
.post h2 svg,
.post h3 svg,
.post h4 svg,
.post h5 svg,
.post h6 svg {
stroke: var(--svg-color);
}
.post h1 svg:hover,
.post h1 svg:focus,
.post h1 svg:active,
.post h2 svg:hover,
.post h2 svg:focus,
.post h2 svg:active,
.post h3 svg:hover,
.post h3 svg:focus,
.post h3 svg:active,
.post h4 svg:hover,
.post h4 svg:focus,
.post h4 svg:active,
.post h5 svg:hover,
.post h5 svg:focus,
.post h5 svg:active,
.post h6 svg:hover,
.post h6 svg:focus,
.post h6 svg:active {
stroke: var(--svg-state-color);
}
.post-info { .post-info {
color: var(--post-info-color); color: var(--post-info-color);
font-size: 0.75em; font-size: 0.75em;
@ -476,6 +556,16 @@ article figcaption {
color: var(--link-state-color); color: var(--link-state-color);
} }
.read-next-title {
margin-bottom: 0;
}
.read-next-posts {
margin-top: 5px;
list-style-type:"- ";
padding-inline-start: 20px;
}
/* Other pages */ /* Other pages */
.terms { .terms {
list-style-type: none; list-style-type: none;
@ -560,6 +650,47 @@ ul.language-select > li, ul.footer-menu > li {
display: none; display: none;
} }
/* Copy code */
.highlight {
position: relative;
}
.highlight pre {
padding-right: 75px;
}
.highlight:hover .highlight-copy-btn {
display: inline-block;
border: 1px solid var(--bg-color);
}
.highlight-copy-btn {
display: none;
position: absolute;
top: 7px;
right: 7px;
border: 0;
border-radius: 4px;
padding: 1px;
font-size: 0.7em;
line-height: 1.8;
color: #fff;
background-color: #777;
min-width: 25px;
text-align: center;
border-radius: 5px;
}
.highlight-copy-btn:hover {
transition-duration: .1s;
background-color: #666;
border: 1px solid var(--bq-color) !important;
}
.highlight-copy-btn,
.highlight-copy-btn svg {
vertical-align: middle;
margin: 8px;
}
/* Media Queries */ /* Media Queries */
@media (max-width: 840px) { @media (max-width: 840px) {

1
assets/images/link.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" ?><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg>

After

Width:  |  Height:  |  Size: 432 B

64
assets/js/copy-code.js Normal file
View File

@ -0,0 +1,64 @@
/*
This file has been taken from following blogpost with some modifications:
https://koki-nakamura22.github.io/blog/2019/10/03/hugo-adding-copy-button/
Many thanks to Koki Nakamura!
*/
document.addEventListener("DOMContentLoaded", function(event) {
'use strict';
if(!document.queryCommandSupported('copy')) {
return;
}
let svgCopyCode = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 25 25"><path d="M18 6v-6h-18v18h6v6h18v-18h-6zm-12 10h-4v-14h14v4h-10v10zm16 6h-14v-14h14v14z"/></svg>';
let svgSuccessCode = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 25 25"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z"/></svg>';
let svgFailCode = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 25 25"><path d="M23.954 21.03l-9.184-9.095 9.092-9.174-2.832-2.807-9.09 9.179-9.176-9.088-2.81 2.81 9.186 9.105-9.095 9.184 2.81 2.81 9.112-9.192 9.18 9.1z"/></svg>';
function changeIcon(el, innerHtml) {
el.innerHTML = innerHtml;
setTimeout(() => {
el.innerHTML = svgCopyCode;
}, 1000);
}
function selectText(node) {
let selection = window.getSelection();
let range = document.createRange();
if (node.childElementCount === 2) {
// Skip the title.
range.selectNodeContents(node.children[1]);
} else {
range.selectNodeContents(node);
}
selection.removeAllRanges();
selection.addRange(range);
return selection;
}
function addCopyButton(containerEl) {
let copyBtn = document.createElement("button");
copyBtn.className = "highlight-copy-btn";
copyBtn.innerHTML = svgCopyCode;
let codeEl = containerEl.firstElementChild;
copyBtn.addEventListener('click', () => {
try {
let selection = selectText(codeEl);
document.execCommand('copy');
selection.removeAllRanges();
changeIcon(copyBtn, svgSuccessCode)
} catch(e) {
console && console.log(e);
changeIcon(copyBtn, svgFailCode)
}
});
containerEl.appendChild(copyBtn);
}
// Add copy button to code blocks
let highlightBlocks = document.getElementsByClassName('highlight');
Array.prototype.forEach.call(highlightBlocks, addCopyButton);
}, false);

View File

@ -17,6 +17,12 @@ dateFormat = "2006-01-02"
paginationSinglePost = true paginationSinglePost = true
style = "auto" style = "auto"
readMore = false readMore = false
readNextPosts = 2
copyCodeButton = true
rssAsSocialIcon = true
# Graphcomment support
graphcommentId = ""
# utteranc.es support # utteranc.es support
utterancesRepo = "" # mandatory utterancesRepo = "" # mandatory
@ -57,4 +63,4 @@ category = "categories"
tag = "tags" tag = "tags"
[markup.goldmark.renderer] [markup.goldmark.renderer]
unsafe = true unsafe = true

View File

@ -1,23 +1,24 @@
--- ---
title: "Subpage" title: "About subpage"
description: "Just a subpage of about" description: "About subpage"
date: "2019-02-28" date: "2019-02-28"
author: "Hugo Authors" author: "Hugo Authors"
slug: /about/subpage slug: /about/subpage
menu: menu:
about: about:
identifier: about identifier: about-subpage-s
name: About parent: about
title: About name: About Subpage
url: /about title: About Subpage
url: /about/subpage/
weight: 1 weight: 1
subpage: subpage:
identifier: subpage identifier: about-subpage2-s
parent: about parent: about
name: Subpage name: Second About subpage
title: Subpage title: Second About subpage
url: /about/subpage/ url: /about/subpage2/
weight: 10 weight: 10
--- ---
Just a subpage of About. About subpage

View File

@ -0,0 +1,24 @@
---
title: "Second About subpage"
description: "Second About subpage"
date: "2019-02-28"
author: "Hugo Authors"
slug: /about/subpage2
menu:
about:
identifier: about-subpage-s2
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage:
identifier: about-subpage2-s2
parent: about
name: Second About subpage
title: Second About subpage
url: /about/subpage2/
weight: 10
---
Second About subpage

View File

@ -2,22 +2,22 @@
title: "About" title: "About"
description: "Hugo, the worlds fastest framework for building websites" description: "Hugo, the worlds fastest framework for building websites"
date: "2019-02-28" date: "2019-02-28"
aliases: aliases: ["about-us","about-hugo","contact"]
- "about-us"
- "about-hugo"
- "contact"
author: "Hugo Authors" author: "Hugo Authors"
menu: menu:
about: about:
name: About identifier: about-subpage
title: About parent: about
url: /about name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1 weight: 1
subpage: subpage:
identifier: about-subpage2
parent: about parent: about
name: Subpage name: Second About subpage
title: Subpage title: Second About subpage
url: /about/subpage url: /about/subpage2/
weight: 10 weight: 10
--- ---

View File

@ -0,0 +1,12 @@
+++
author = "Dmitry Kolosov"
title = "Hidden Post"
date = "2021-12-24"
description = "Post available only by link"
tags = [
"privacy"
]
hidden = true
+++
This is hidden post

8
exampleSite/netlify.toml Normal file
View File

@ -0,0 +1,8 @@
[build]
publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.92.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

View File

@ -18,6 +18,12 @@ dateFormat = "2006-01-02"
paginationSinglePost = true paginationSinglePost = true
style = "auto" style = "auto"
readMore = false readMore = false
readNextPosts = 2
copyCodeButton = true
rssAsSocialIcon = true
# Graphcomment support
graphcommentId = ""
# utteranc.es support # utteranc.es support
utterancesRepo = "" # mandatory utterancesRepo = "" # mandatory
@ -80,4 +86,4 @@ category = "categories"
tag = "tags" tag = "tags"
[markup.goldmark.renderer] [markup.goldmark.renderer]
unsafe = true unsafe = true

View File

@ -0,0 +1,24 @@
---
title: "About Subpage"
description: "About Subpage"
date: "2019-02-28"
author: "Hugo Authors"
slug: /about/subpage
menu:
subpage:
identifier: about-subpage-s
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2-s
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
About subpage

View File

@ -0,0 +1,24 @@
---
title: "About Subpage"
description: "About Subpage"
date: "2019-02-28"
author: "Hugo Authors"
slug: /about/subpage
menu:
subpage:
identifier: about-subpage-s
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2-s
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
About subpage

View File

@ -0,0 +1,24 @@
---
title: "Second About Subpage"
description: "Second About Subpage"
date: "2019-02-28"
author: "Hugo Authors"
slug: /about/subpage2
menu:
subpage:
identifier: about-subpage-s2
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2-s2
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
Second About subpage

View File

@ -0,0 +1,24 @@
---
title: "Second About Subpage"
description: "Second About Subpage"
date: "2019-02-28"
author: "Hugo Authors"
slug: /about/subpage2
menu:
subpage:
identifier: about-subpage-s2
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2-s2
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
Second About subpage

View File

@ -1,10 +1,25 @@
+++ ---
title = "About" title: "About"
description = "Hugo, the worlds fastest framework for building websites" description: "Hugo, the worlds fastest framework for building websites"
date = "2019-02-28" date: "2019-02-28"
aliases = ["about-us","about-hugo","contact"] aliases: ["about-us","about-hugo","contact"]
author = "Hugo Authors" author: "Hugo Authors"
+++ menu:
subpage:
identifier: about-subpage
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.

View File

@ -1,10 +1,25 @@
+++ ---
title = "About" title: "About"
description = "Hugo, the worlds fastest framework for building websites" description: "Hugo, the worlds fastest framework for building websites"
date = "2019-02-28" date: "2019-02-28"
aliases = ["about-us","about-hugo","contact"] aliases: ["about-us","about-hugo","contact"]
author = "Hugo Authors" author: "Hugo Authors"
+++ menu:
subpage:
identifier: about-subpage
parent: about
name: About Subpage
title: About Subpage
url: /about/subpage/
weight: 1
subpage2:
identifier: about-subpage2
parent: about
name: Second About Subpage
title: Second About Subpage
url: /about/subpage2/
weight: 10
---
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows. Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.

View File

@ -0,0 +1,12 @@
+++
author = "Dmitry Kolosov"
title = "Hidden Post"
date = "2021-12-24"
description = "Post available only by link"
tags = [
"privacy"
]
hidden = true
+++
This is hidden post

View File

@ -0,0 +1,12 @@
+++
author = "Dmitry Kolosov"
title = "Hidden Post"
date = "2021-12-24"
description = "Post available only by link"
tags = [
"privacy"
]
hidden = true
+++
This is hidden post

View File

@ -0,0 +1,8 @@
[build]
publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.92.0"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/Mitrichius/hugo-theme-anubis
go 1.18

View File

@ -42,3 +42,6 @@ darkTheme:
lightTheme: lightTheme:
other: "Helles Theme" other: "Helles Theme"
readNext:
other: "Weiter lesen"

View File

@ -1,11 +1,11 @@
powered: powered:
other: "powered by" other: "Powered by"
theme: theme:
other: "theme" other: "theme"
readMore: readMore:
other: "read more" other: "Read more"
toNewPosts: toNewPosts:
other: "to new posts" other: "to new posts"
@ -35,10 +35,13 @@ toAllCategories:
other: "to all categories" other: "to all categories"
skipToContent: skipToContent:
other: "skip to main content" other: "Skip to main content"
darkTheme: darkTheme:
other: "dark theme" other: "Dark theme"
lightTheme: lightTheme:
other: "light theme" other: "Light theme"
readNext:
other: "Read next"

View File

@ -1,11 +1,11 @@
powered: powered:
other: "propulsé par" other: "Propulsé par"
theme: theme:
other: "thème" other: "thème"
readMore: readMore:
other: "lire la suite" other: "Lire la suite"
toNewPosts: toNewPosts:
other: "articles + récents" other: "articles + récents"
@ -35,10 +35,13 @@ toAllCategories:
other: "vers toutes les catégories" other: "vers toutes les catégories"
skipToContent: skipToContent:
other: "aller au contenu" other: "Aller au contenu"
darkTheme: darkTheme:
other: "thème sombre" other: "Thème sombre"
lightTheme: lightTheme:
other: "thème clair" other: "Thème clair"
readNext:
other: "Lire la suite"

View File

@ -1,14 +1,14 @@
powered: powered:
other: "zasilany przez" other: "Zasilany przez"
theme: theme:
other: "motyw" other: "motyw"
readMore: readMore:
other: "czytaj dalej" other: "Czytaj dalej"
toNewPosts: toNewPosts:
other: "poprzedia strona" other: "poprzednia strona"
toOldPosts: toOldPosts:
other: "następna strona" other: "następna strona"
@ -35,10 +35,13 @@ toAllCategories:
other: "wszystkie kategorie" other: "wszystkie kategorie"
skipToContent: skipToContent:
other: "przejdź do głównej zawartości" other: "Przejdź do głównej zawartości"
darkTheme: darkTheme:
other: "ciemny schemat" other: "Ciemny schemat"
lightTheme: lightTheme:
other: "lekki schemat" other: "Jasny schemat"
readNext:
other: "Czytaj dalej"

47
i18n/pt.yaml Normal file
View File

@ -0,0 +1,47 @@
powered:
other: "Criado com"
theme:
other: "tema"
readMore:
other: "Ler mais"
toNewPosts:
other: "novos posts"
toOldPosts:
other: "posts anteriores"
tag:
other: "tag"
Tags:
other: "Tags"
Posts:
other: "Posts"
category:
other: "categoria"
Categories:
other: "Categorias"
toAllTags:
other: "ver todas as tags"
toAllCategories:
other: "ver todas as categorias"
skipToContent:
other: "Pular para o conteúdo principal"
darkTheme:
other: "Tema Escuro"
lightTheme:
other: "Tema Claro"
readNext:
other: "Leia a seguir"

View File

@ -1,11 +1,11 @@
powered: powered:
other: "движок" other: "Движок"
theme: theme:
other: "тема" other: "тема"
readMore: readMore:
other: "читать дальше" other: "Читать дальше"
toNewPosts: toNewPosts:
other: "к новым записям" other: "к новым записям"
@ -35,10 +35,13 @@ toAllCategories:
other: "ко списку всех категорий" other: "ко списку всех категорий"
skipToContent: skipToContent:
other: "перейти к основному контенту" other: "Перейти к основному контенту"
darkTheme: darkTheme:
other: "тёмная тема" other: "Тёмная тема"
lightTheme: lightTheme:
other: "светлая тема" other: "Светлая тема"
readNext:
other: "Читать далее"

View File

@ -42,3 +42,6 @@ darkTheme:
lightTheme: lightTheme:
other: "亮色主題" other: "亮色主題"
readNext:
other: "閱讀下一篇"

View File

@ -41,4 +41,7 @@ darkTheme:
other: "暗色主题" other: "暗色主题"
lightTheme: lightTheme:
other: "亮色主题" other: "亮色主题"
readNext:
other: "继续阅读"

8
layouts/404.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "main"}}
<main id="main">
<div>
<h1 id="title"><a href="{{ .Site.BaseURL | relLangURL }}">Go Home</a></h1>
Sorry, this Page is not available.
</div>
</main>
{{ end }}

View File

@ -0,0 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>{{ .Text | safeHTML }}
<span>
<a href="#{{ .Anchor }}">
<svg viewBox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg>
</a>
</span>
</h{{ .Level }}>

View File

@ -10,7 +10,7 @@
{{ end }} {{ end }}
</head> </head>
<body> <body>
<a class="skip-main" href="#main">{{ i18n "skipToContent" | humanize }}</a> <a class="skip-main" href="#main">{{ i18n "skipToContent" }}</a>
<div class="container"> <div class="container">
<header class="common-header"> <header class="common-header">
{{ block "header" . }} {{ block "header" . }}

View File

@ -5,11 +5,11 @@
<div class="articles h-feed"> <div class="articles h-feed">
<h1 class="post-title">{{ i18n .Title }}</h1> <h1 class="post-title">{{ i18n .Title }}</h1>
{{ $pages := where .Pages "Type" "in" site.Params.mainSections }} {{ $pages := where (where .Pages "Type" "in" site.Params.mainSections) "Params.hidden" "!=" true}}
{{ range $pages }} {{ range $pages }}
<div class="post-short-list h-entry"> <div class="post-short-list h-entry">
<div class="post-header"> <div class="post-header">
<header> <header>
<h2 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2> <h2 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2>
{{ partial "post-language-switcher.html" . }} {{ partial "post-language-switcher.html" . }}
</header> </header>

View File

@ -1,6 +1,6 @@
{{- $pctx := . -}} {{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}} {{- $pages := where (where $pctx.RegularPages ".Params.disable_feed" "!=" true) "Params.hidden" "!=" true -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}} {{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}} {{- $pages = $pages | first $limit -}}

View File

@ -2,7 +2,7 @@
{{ if .Menus }} {{ if .Menus }}
<nav class="post-navigation"> <nav class="post-navigation">
{{ range .Menus }} {{ range .Menus }}
<a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> <a href="{{ .ConfiguredURL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }} {{ end }}
</nav> </nav>
{{ end }} {{ end }}
@ -21,20 +21,23 @@
{{ partial "post-info.html" . }} {{ partial "post-info.html" . }}
</article> </article>
{{ if gt .Site.Params.readNextPosts 0 }}
{{ $related := .Site.RegularPages.Related . | first .Site.Params.readNextPosts }}
{{ with $related }}
<h3 class="read-next-title">{{ i18n "readNext" }}</h3>
<ul class="read-next-posts">
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} {{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }}
{{ partial "post-pagination.html" . }} {{ partial "post-pagination.html" . }}
{{ end }} {{ end }}
{{ if .Site.DisqusShortname }} {{ if not .Params.disableComments }}
{{ partial "disqus.html" . }} {{ partial "comments.html" . }}
{{ end }} {{ end }}
{{ if .Site.Params.UtterancesRepo }}
{{ partial "utterances.html" . }}
{{ end }}
{{ if .Site.Params.isso.enabled }}
{{ partial "isso.html" . }}
{{ end }}
{{ end }} {{ end }}

View File

@ -3,7 +3,8 @@
<div class="post-info"> <div class="post-info">
<a href="{{ (print .Data.Plural "/") | relLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a> <a href="{{ (print .Data.Plural "/") | relLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a>
</div> </div>
{{ range .Paginator.Pages }} {{ $pages := where .Pages "Params.hidden" "!=" true }}
{{ range (.Paginate $pages).Pages }}
{{ partial "post-summary.html" . }} {{ partial "post-summary.html" . }}
{{ end }} {{ end }}
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}

View File

@ -4,15 +4,15 @@
</div> </div>
<h1>{{ i18n .Title }}</h1> <h1>{{ i18n .Title }}</h1>
<ul class="terms"> <ul class="terms">
{{ range $key, $value := .Data.Terms }} {{ range .Data.Terms }}
<li> {{ $postsNum := len (where .Pages "Params.hidden" "!=" true) }}
<a href="{{ (print $.Data.Plural "/" (lower $key)) | absLangURL }}"> {{ if gt $postsNum 0 }}
{{ $key }} <li>
</a> <a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a>
({{ len $value }}) ({{ $postsNum }})
</li> </li>
{{ end}}
{{ end }} {{ end }}
</ul> </ul>

View File

@ -4,7 +4,7 @@
</div> </div>
<div class="articles h-feed"> <div class="articles h-feed">
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} {{ $pages := where (where site.RegularPages "Type" "in" site.Params.mainSections) "Params.hidden" "!=" true }}
{{ range (.Paginate $pages).Pages }} {{ range (.Paginate $pages).Pages }}
{{ partial "post-summary.html" . }} {{ partial "post-summary.html" . }}
{{ end }} {{ end }}

View File

@ -0,0 +1,15 @@
{{ if .Site.DisqusShortname }}
{{ partial "disqus.html" . }}
{{ end }}
{{ if .Site.Params.UtterancesRepo }}
{{ partial "utterances.html" . }}
{{ end }}
{{ if .Site.Params.isso.enabled }}
{{ partial "isso.html" . }}
{{ end }}
{{ if .Site.Params.graphcommentId }}
{{ partial "graphcomment.html" . }}
{{ end }}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"/></svg>

After

Width:  |  Height:  |  Size: 903 B

View File

@ -15,7 +15,7 @@
{{ end }} {{ end }}
<div class="copyright"> <div class="copyright">
<p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}<br> <p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}<br>
{{ 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>.<br> {{ i18n "powered" }} <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>.<br>
{{ partial "footer-extra.html" . }} {{ partial "footer-extra.html" . }}
</p> </p>
</div> </div>

View File

@ -0,0 +1,32 @@
<div id="graphcomment"></div>
<script type="text/javascript">
/* - - - CONFIGURATION VARIABLES - - - */
var __semio__params = {
graphcommentId: "{{ .Site.Params.graphcommentId }}", // obviously you need to create your own ID on graphcomment.com
behaviour: {
// HIGHLY RECOMMENDED
// uid: "...", // uniq identifer for the comments thread on your page (ex: your page id)
},
// configure your variables here
}
/* - - - DON'T EDIT BELOW THIS LINE - - - */
function __semio__onload() {
__semio__gc_graphlogin(__semio__params)
}
(function() {
var gc = document.createElement('script'); gc.type = 'text/javascript'; gc.async = true;
gc.onload = __semio__onload; gc.defer = true; gc.src = 'https://integration.graphcomment.com/gc_graphlogin.js?' + Date.now();
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gc);
})();
</script>

View File

@ -7,13 +7,42 @@
{{ partial "title.html" . }} {{ partial "title.html" . }}
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"> <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}">
{{ with .Keywords }}
<meta name="keywords" content="{{ range $i, $e := . }}{{ if $i }},{{ end }}{{ $e }}{{ end }}">
{{ end }}
{{ if and (.IsPage) (eq .Params.hidden true)}}
<meta name="robots" content="noindex" />
{{ end }}
{{ with .OutputFormats.Get "rss" -}} {{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}} {{ end -}}
{{ partial "favicons.html" . }} {{ partial "favicons.html" . }}
<style>
body {
visibility: hidden;
opacity: 0;
}
</style>
<noscript>
<style>
body {
visibility: visible;
opacity: 1;
}
</style>
</noscript>
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }} {{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
{{ if .Site.Params.copyCodeButton | default true }}
{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/copy-code.js") }}
{{ end }}
{{ range .Site.Params.customJS -}} {{ range .Site.Params.customJS -}}
{{ partial "resource.html" (dict "context" $ "type" "js" "filename" . ) }} {{ partial "resource.html" (dict "context" $ "type" "js" "filename" . ) }}
{{- end }} {{- end }}

View File

@ -1,7 +1,5 @@
<div class="header-top"> <div class="header-top">
<h1 class="site-title"> {{ partial "site-title.html" . }}
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
</h1>
{{ partial "social.html" . }} {{ partial "social.html" . }}
</div> </div>
{{ if .Site.Menus.main }} {{ if .Site.Menus.main }}

View File

@ -15,15 +15,17 @@
<div class="post-taxonomies"> <div class="post-taxonomies">
{{ if .Params.categories }} {{ if .Params.categories }}
<ul class="post-categories"> <ul class="post-categories">
{{ range .Params.categories }} {{ range $cat_name := .Params.categories }}
<li><a href="{{ "categories/" | absLangURL }}{{ . | urlize }}">{{ . }}</a></li> {{ $cat := ($.Site.GetPage (printf "/categories/%s" $cat_name)) }}
<li><a href="{{ $cat.Permalink }}">{{ $cat.Title | default $cat_name }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}
{{ if .Params.tags }} {{ if .Params.tags }}
<ul class="post-tags"> <ul class="post-tags">
{{ range .Params.tags }} {{ range $tag_name := .Params.tags }}
<li><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">#{{ . }}</a></li> {{ $tag := ($.Site.GetPage (printf "/tags/%s" $tag_name)) }}
<li><a href="{{ $tag.Permalink }}">#{{ $tag.Title | default $tag_name }}</a></li>
{{ end }} {{ end }}
</ul> </ul>
{{ end }} {{ end }}

View File

@ -13,7 +13,7 @@
{{ end }} {{ end }}
{{ if and (.Truncated) (.Site.Params.readMore) }} {{ if and (.Truncated) (.Site.Params.readMore) }}
<div class="read-more"> <div class="read-more">
<a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a> <a class="u-url" href="{{ .RelPermalink }}">{{ i18n "readMore" }}</a>
</div> </div>
{{ end }} {{ end }}

View File

@ -0,0 +1,3 @@
<h1 class="site-title">
<a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a>
</h1>

View File

@ -23,4 +23,15 @@
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul>
{{ if .Site.Params.rssAsSocialIcon }}
{{ with .Site.Home.OutputFormats.Get "rss" -}}
<li>
<a {{ printf "href=%q" .Permalink | safeHTMLAttr }} title="RSS" rel="me">
{{ partial "font-awesome.html" (dict "iconName" "rss" "custom" false) }}
</a>
</li>
{{ end -}}
{{ end }}
</ul>

View File

@ -5,69 +5,81 @@
{{ 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">
{{ i18n "darkTheme" | humanize }} {{ i18n "darkTheme" }}
</button> </button>
{{ end }}
<script> <script>
const STORAGE_KEY = 'user-color-scheme' const STORAGE_KEY = 'user-color-scheme'
const defaultTheme = {{ $style }} const defaultTheme = {{ $style }}
let currentTheme let currentTheme
let switchButton let switchButton
let autoDefinedScheme = window.matchMedia('(prefers-color-scheme: dark)') let autoDefinedScheme = window.matchMedia('(prefers-color-scheme: dark)')
const autoChangeScheme = e => { const autoChangeScheme = e => {
currentTheme = e.matches ? 'dark' : 'light' currentTheme = e.matches ? 'dark' : 'light'
document.documentElement.setAttribute('data-theme', currentTheme) document.documentElement.setAttribute('data-theme', currentTheme)
changeButtonText() changeButtonText()
}
document.addEventListener('DOMContentLoaded', function() {
switchButton = document.querySelector('.theme-switcher')
currentTheme = detectCurrentScheme()
if (currentTheme == 'dark') {
document.documentElement.setAttribute('data-theme', 'dark')
}
if (currentTheme == 'auto') {
autoChangeScheme(autoDefinedScheme);
autoDefinedScheme.addListener(autoChangeScheme);
} }
document.addEventListener('DOMContentLoaded', function() { if (switchButton) {
switchButton = document.querySelector('.theme-switcher')
currentTheme = detectCurrentScheme()
if (currentTheme == 'dark') {
document.documentElement.setAttribute('data-theme', 'dark')
}
if (currentTheme == 'auto') {
autoChangeScheme(autoDefinedScheme);
autoDefinedScheme.addListener(autoChangeScheme);
}
changeButtonText() changeButtonText()
switchButton.addEventListener('click', switchTheme, false) switchButton.addEventListener('click', switchTheme, false)
}) }
showContent()
})
function detectCurrentScheme() { function detectCurrentScheme() {
if (localStorage.getItem(STORAGE_KEY)) { if (localStorage.getItem(STORAGE_KEY)) {
return localStorage.getItem(STORAGE_KEY) return localStorage.getItem(STORAGE_KEY)
} }
if (defaultTheme) { if (defaultTheme) {
return defaultTheme return defaultTheme
} }
if (!window.matchMedia) { if (!window.matchMedia) {
return 'light'
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark'
}
return 'light' return 'light'
}
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark'
} }
return 'light'
}
function changeButtonText() function changeButtonText()
{ {
switchButton.textContent = currentTheme == 'dark' ? {{ i18n "lightTheme" | humanize }} : {{ i18n "darkTheme" | humanize }} if (switchButton) {
switchButton.textContent = currentTheme == 'dark' ? {{ i18n "lightTheme" }} : {{ i18n "darkTheme" }}
} }
}
function switchTheme(e) { function switchTheme(e) {
if (currentTheme == 'dark') { if (currentTheme == 'dark') {
localStorage.setItem(STORAGE_KEY, 'light') localStorage.setItem(STORAGE_KEY, 'light')
document.documentElement.setAttribute('data-theme', 'light') document.documentElement.setAttribute('data-theme', 'light')
currentTheme = 'light' currentTheme = 'light'
} else { } else {
localStorage.setItem(STORAGE_KEY, 'dark') localStorage.setItem(STORAGE_KEY, 'dark')
document.documentElement.setAttribute('data-theme', 'dark') document.documentElement.setAttribute('data-theme', 'dark')
currentTheme = 'dark' currentTheme = 'dark'
}
changeButtonText()
} }
</script> changeButtonText()
{{ end }} }
function showContent() {
document.body.style.visibility = 'visible';
document.body.style.opacity = 1;
}
</script>

View File

@ -3,7 +3,7 @@ publish = "exampleSiteMultilingual/public"
command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --baseURL $URL" command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --baseURL $URL"
[build.environment] [build.environment]
HUGO_VERSION = "0.91.0" HUGO_VERSION = "0.92.0"
HUGO_THEME = "repo" HUGO_THEME = "repo"
[context.deploy-preview] [context.deploy-preview]
@ -12,4 +12,4 @@ command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --buildFuture -
[[headers]] [[headers]]
for = "/*" for = "/*"
[headers.values] [headers.values]
Access-Control-Allow-Origin = "*" Access-Control-Allow-Origin = "*"