diff --git a/blog/themes/anubis.sh b/blog/themes/anubis.sh new file mode 100644 index 0000000..94609a7 --- /dev/null +++ b/blog/themes/anubis.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +sed -i 's/href="{{ (print /href="\/{{ (print /' ./anubis/layouts/_default/terms.html +sed -i 's/href="{{ "categories/href="{{ "\/categories/' ./anubis/layouts/partials/post-info.html +sed -i 's/href="{{ "tags/href="{{ "\/tags/' ./anubis/layouts/partials/post-info.html diff --git a/blog/themes/anubis/README.md b/blog/themes/anubis/README.md index b5aa30d..763cf99 100644 --- a/blog/themes/anubis/README.md +++ b/blog/themes/anubis/README.md @@ -1,7 +1,9 @@ -# 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 Theme for Hugo [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) [![Netlify Status](https://api.netlify.com/api/v1/badges/7d9ea909-ad7e-4e47-b7c9-eefb7522d8c6/deploy-status)](https://app.netlify.com/sites/hugo-theme-anubis/deploys) [![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/). +[Demo](https://hugo-theme-anubis.netlify.app/) + ![Anubis Screenshot](https://raw.githubusercontent.com/mitrichius/hugo-theme-anubis/master/images/screenshot.png) ## Features @@ -119,7 +121,7 @@ Options: - `auto-without-switcher` - theme based on user system settings, without switcher, JS-free - `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 -- `auto` - theme based on user system settings by default, can be switched by user to dark/light theme. 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) ### Social icons #### Predefined icons @@ -167,9 +169,7 @@ Icon should be "static/fa-icons/google.svg" If you want font awesome icons, download "Font Awesome For Desktop" and open svg directory. ### Google Analytics -Only works for production environment. You either build your site with variable like -`HUGO_ENV=production hugo --minify` -or just put `env: production` to `params` section of config. +Only works for production environment. ### 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/). diff --git a/blog/themes/anubis/assets/css/main.css b/blog/themes/anubis/assets/css/main.css index 6400a64..fddb583 100644 --- a/blog/themes/anubis/assets/css/main.css +++ b/blog/themes/anubis/assets/css/main.css @@ -143,8 +143,6 @@ th, td { /* Code */ pre { - color: var(--pre-color); - background-color: var(--pre-bg-color); padding: 1em; max-width: 100%; overflow: auto; @@ -153,6 +151,8 @@ pre { code, pre, kbd { + color: var(--pre-color); + background-color: var(--pre-bg-color); font-family: monospace; font-size: 0.90em; line-height: 154%; @@ -298,6 +298,10 @@ main h1 { color: var(--link-state-color); } +.post-short-list .post-title { + display: inline; +} + .post-title.favorite::after { content: "☆"; display: inline-block; diff --git a/blog/themes/anubis/exampleSite/config.toml b/blog/themes/anubis/exampleSite/config.toml index 6090459..4ff657b 100644 --- a/blog/themes/anubis/exampleSite/config.toml +++ b/blog/themes/anubis/exampleSite/config.toml @@ -15,7 +15,7 @@ author = "Dmitry Kolosov" description = "Anubis is a simple minimalist theme for Hugo blog engine." dateFormat = "2006-01-02" paginationSinglePost = true -style = "light-without-switcher" +style = "auto" readMore = false # utteranc.es support diff --git a/blog/themes/anubis/exampleSite/content/post/rich-content.md b/blog/themes/anubis/exampleSite/content/post/rich-content.md index 407c539..71a36e1 100644 --- a/blog/themes/anubis/exampleSite/content/post/rich-content.md +++ b/blog/themes/anubis/exampleSite/content/post/rich-content.md @@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme ## Twitter Simple Shortcode -{{< twitter_simple 1085870671291310081 >}} +{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
diff --git a/blog/themes/anubis/exampleSiteMultilingual/config.toml b/blog/themes/anubis/exampleSiteMultilingual/config.toml index d4955b7..388fcc0 100644 --- a/blog/themes/anubis/exampleSiteMultilingual/config.toml +++ b/blog/themes/anubis/exampleSiteMultilingual/config.toml @@ -16,7 +16,7 @@ author = "Dmitry Kolosov" description = "Anubis is a simple minimalist theme for Hugo blog engine." dateFormat = "2006-01-02" paginationSinglePost = true -style = "light-without-switcher" +style = "auto" readMore = false # utteranc.es support diff --git a/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.md b/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.md index 407c539..71a36e1 100644 --- a/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.md +++ b/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.md @@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme ## Twitter Simple Shortcode -{{< twitter_simple 1085870671291310081 >}} +{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
diff --git a/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.pl.md b/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.pl.md index 407c539..71a36e1 100644 --- a/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.pl.md +++ b/blog/themes/anubis/exampleSiteMultilingual/content/post/rich-content.pl.md @@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme ## Twitter Simple Shortcode -{{< twitter_simple 1085870671291310081 >}} +{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
diff --git a/blog/themes/anubis/layouts/_default/single.html b/blog/themes/anubis/layouts/_default/single.html index 0123dc9..94a711e 100644 --- a/blog/themes/anubis/layouts/_default/single.html +++ b/blog/themes/anubis/layouts/_default/single.html @@ -6,7 +6,7 @@ {{ end }} {{ end }} - +

{{ trim .Title " " }}

@@ -24,11 +24,11 @@ {{ end }} {{ if .Site.DisqusShortname }} - {{ template "_internal/disqus.html" . }} + {{ partial "disqus.html" . }} {{ end }} {{ if .Site.Params.UtterancesRepo }} {{ partial "utterances.html" . }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/blog/themes/anubis/layouts/_default/taxonomy.html b/blog/themes/anubis/layouts/_default/taxonomy.html index 8780272..c31cfb9 100644 --- a/blog/themes/anubis/layouts/_default/taxonomy.html +++ b/blog/themes/anubis/layouts/_default/taxonomy.html @@ -1,7 +1,7 @@ {{ define "main" }}

{{ i18n .Data.Singular | humanize }}: {{ .Title }}

{{ range .Paginator.Pages }} {{ partial "post-summary.html" . }} diff --git a/blog/themes/anubis/layouts/_default/terms.html b/blog/themes/anubis/layouts/_default/terms.html index f595c38..ee63099 100644 --- a/blog/themes/anubis/layouts/_default/terms.html +++ b/blog/themes/anubis/layouts/_default/terms.html @@ -16,4 +16,4 @@ {{ end }} -{{ end }} +{{ end }} \ No newline at end of file diff --git a/blog/themes/anubis/layouts/partials/disqus.html b/blog/themes/anubis/layouts/partials/disqus.html new file mode 100644 index 0000000..0b59e05 --- /dev/null +++ b/blog/themes/anubis/layouts/partials/disqus.html @@ -0,0 +1 @@ +{{ template "_internal/disqus.html" . }} diff --git a/blog/themes/anubis/static/fa-icons/email.svg b/blog/themes/anubis/layouts/partials/fa-icons/email.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/email.svg rename to blog/themes/anubis/layouts/partials/fa-icons/email.svg diff --git a/blog/themes/anubis/static/fa-icons/facebook.svg b/blog/themes/anubis/layouts/partials/fa-icons/facebook.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/facebook.svg rename to blog/themes/anubis/layouts/partials/fa-icons/facebook.svg diff --git a/blog/themes/anubis/static/fa-icons/github.svg b/blog/themes/anubis/layouts/partials/fa-icons/github.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/github.svg rename to blog/themes/anubis/layouts/partials/fa-icons/github.svg diff --git a/blog/themes/anubis/static/fa-icons/instagram.svg b/blog/themes/anubis/layouts/partials/fa-icons/instagram.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/instagram.svg rename to blog/themes/anubis/layouts/partials/fa-icons/instagram.svg diff --git a/blog/themes/anubis/static/fa-icons/linkedin.svg b/blog/themes/anubis/layouts/partials/fa-icons/linkedin.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/linkedin.svg rename to blog/themes/anubis/layouts/partials/fa-icons/linkedin.svg diff --git a/blog/themes/anubis/static/fa-icons/patreon.svg b/blog/themes/anubis/layouts/partials/fa-icons/patreon.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/patreon.svg rename to blog/themes/anubis/layouts/partials/fa-icons/patreon.svg diff --git a/blog/themes/anubis/static/fa-icons/reddit.svg b/blog/themes/anubis/layouts/partials/fa-icons/reddit.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/reddit.svg rename to blog/themes/anubis/layouts/partials/fa-icons/reddit.svg diff --git a/blog/themes/anubis/static/fa-icons/snapchat.svg b/blog/themes/anubis/layouts/partials/fa-icons/snapchat.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/snapchat.svg rename to blog/themes/anubis/layouts/partials/fa-icons/snapchat.svg diff --git a/blog/themes/anubis/static/fa-icons/soundcloud.svg b/blog/themes/anubis/layouts/partials/fa-icons/soundcloud.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/soundcloud.svg rename to blog/themes/anubis/layouts/partials/fa-icons/soundcloud.svg diff --git a/blog/themes/anubis/static/fa-icons/spotify.svg b/blog/themes/anubis/layouts/partials/fa-icons/spotify.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/spotify.svg rename to blog/themes/anubis/layouts/partials/fa-icons/spotify.svg diff --git a/blog/themes/anubis/static/fa-icons/telegram.svg b/blog/themes/anubis/layouts/partials/fa-icons/telegram.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/telegram.svg rename to blog/themes/anubis/layouts/partials/fa-icons/telegram.svg diff --git a/blog/themes/anubis/static/fa-icons/twitch.svg b/blog/themes/anubis/layouts/partials/fa-icons/twitch.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/twitch.svg rename to blog/themes/anubis/layouts/partials/fa-icons/twitch.svg diff --git a/blog/themes/anubis/static/fa-icons/twitter.svg b/blog/themes/anubis/layouts/partials/fa-icons/twitter.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/twitter.svg rename to blog/themes/anubis/layouts/partials/fa-icons/twitter.svg diff --git a/blog/themes/anubis/static/fa-icons/vk.svg b/blog/themes/anubis/layouts/partials/fa-icons/vk.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/vk.svg rename to blog/themes/anubis/layouts/partials/fa-icons/vk.svg diff --git a/blog/themes/anubis/static/fa-icons/youtube.svg b/blog/themes/anubis/layouts/partials/fa-icons/youtube.svg similarity index 100% rename from blog/themes/anubis/static/fa-icons/youtube.svg rename to blog/themes/anubis/layouts/partials/fa-icons/youtube.svg diff --git a/blog/themes/anubis/layouts/partials/favicons.html b/blog/themes/anubis/layouts/partials/favicons.html new file mode 100644 index 0000000..bb271a1 --- /dev/null +++ b/blog/themes/anubis/layouts/partials/favicons.html @@ -0,0 +1,2 @@ + + diff --git a/blog/themes/anubis/layouts/partials/font-awesome.html b/blog/themes/anubis/layouts/partials/font-awesome.html index f1db829..646aa22 100644 --- a/blog/themes/anubis/layouts/partials/font-awesome.html +++ b/blog/themes/anubis/layouts/partials/font-awesome.html @@ -1,15 +1,15 @@ - + {{ $dict := newScratch }} -{{ if (eq .custom true) }} - {{ $dict.Set "filename" (print "static/fa-icons/" .iconName ".svg") }} +{{ if (eq .custom true) }} + {{ $dict.Set "svg" (readFile (print "static/fa-icons/" .iconName ".svg")) }} {{ else }} - {{ $dict.Set "filename" (print "themes/anubis/static/fa-icons/" .iconName ".svg") }} + {{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }} {{ end }} {{- $path:=" diff --git a/blog/themes/anubis/layouts/partials/head.html b/blog/themes/anubis/layouts/partials/head.html index 5aaa6cd..6fd87a9 100644 --- a/blog/themes/anubis/layouts/partials/head.html +++ b/blog/themes/anubis/layouts/partials/head.html @@ -4,16 +4,14 @@ -{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }} - +{{ partial "title.html" . }} + {{ with .OutputFormats.Get "rss" -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - - - +{{ partial "favicons.html" . }} {{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }} {{ range .Site.Params.customJS -}} @@ -41,7 +39,7 @@ --> -{{ if and (.Site.GoogleAnalytics) (or (eq (getenv "HUGO_ENV") "production") (eq .Site.Params.env "production")) }} +{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }} {{ template "_internal/google_analytics.html" . }} {{ end }} diff --git a/blog/themes/anubis/layouts/partials/language-switcher.html b/blog/themes/anubis/layouts/partials/language-switcher.html index 7e2e848..df9c6ef 100644 --- a/blog/themes/anubis/layouts/partials/language-switcher.html +++ b/blog/themes/anubis/layouts/partials/language-switcher.html @@ -1,5 +1,15 @@ \ No newline at end of file + {{ $pageLang := .Page.Lang}} + {{ $translations := .AllTranslations }} + {{ if not .IsTranslated }} + {{ $translations = $.Site.Home.AllTranslations }} + {{ end }} + + {{ range $translations }} + {{ if eq .Lang $pageLang }} +
  • {{ .Language.LanguageName }}
  • + {{ else }} +
  • {{ .Language.LanguageName }}
  • + {{ end }} + {{ end }} + diff --git a/blog/themes/anubis/layouts/partials/pagination.html b/blog/themes/anubis/layouts/partials/pagination.html index c561c09..332d265 100644 --- a/blog/themes/anubis/layouts/partials/pagination.html +++ b/blog/themes/anubis/layouts/partials/pagination.html @@ -1,15 +1,15 @@ {{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }} {{ $toNewPostsMessage := i18n "toNewPosts" }} - {{ $toOldPostsMessage := i18n "toOldPosts" }} + {{ $toOldPostsMessage := i18n "toOldPosts" }} diff --git a/blog/themes/anubis/layouts/partials/post-info.html b/blog/themes/anubis/layouts/partials/post-info.html index c7dc3cd..870a4e6 100644 --- a/blog/themes/anubis/layouts/partials/post-info.html +++ b/blog/themes/anubis/layouts/partials/post-info.html @@ -7,7 +7,7 @@ {{ if .Params.date }} {{ end }} - + {{ .Permalink }} {{ .Params.author | default .Site.Params.author }} @@ -16,7 +16,7 @@ {{ if .Params.categories }} {{ end }} diff --git a/blog/themes/anubis/layouts/partials/post-pagination.html b/blog/themes/anubis/layouts/partials/post-pagination.html index 92582d3..2130181 100644 --- a/blog/themes/anubis/layouts/partials/post-pagination.html +++ b/blog/themes/anubis/layouts/partials/post-pagination.html @@ -2,12 +2,12 @@ diff --git a/blog/themes/anubis/layouts/partials/resource.html b/blog/themes/anubis/layouts/partials/resource.html index 146c902..1ecc5e5 100644 --- a/blog/themes/anubis/layouts/partials/resource.html +++ b/blog/themes/anubis/layouts/partials/resource.html @@ -9,7 +9,7 @@ {{ if $resource }} {{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }} - {{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} + {{ if hugo.IsProduction }} {{ $resource = $resource | resources.Minify }} {{ end }} {{ $resource = $resource | resources.Fingerprint "sha256" }} @@ -26,4 +26,4 @@ {{ else if eq .type "js" }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/blog/themes/anubis/layouts/partials/title.html b/blog/themes/anubis/layouts/partials/title.html new file mode 100644 index 0000000..648d9df --- /dev/null +++ b/blog/themes/anubis/layouts/partials/title.html @@ -0,0 +1 @@ +{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }} diff --git a/blog/themes/anubis/layouts/robots.txt b/blog/themes/anubis/layouts/robots.txt index 3e78ed8..2e1d1eb 100644 --- a/blog/themes/anubis/layouts/robots.txt +++ b/blog/themes/anubis/layouts/robots.txt @@ -1,7 +1,7 @@ User-agent: * -# robotstxt.org - if ENV production variable is false robots will be disallowed. -{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }} +# robotstxt.org - if environment is not `production` then robots will be disallowed. +{{ if hugo.IsProduction }} Disallow: {{ else }} Disallow: / -{{ end }} \ No newline at end of file +{{ end }} diff --git a/blog/themes/anubis/netlify.toml b/blog/themes/anubis/netlify.toml new file mode 100644 index 0000000..06db190 --- /dev/null +++ b/blog/themes/anubis/netlify.toml @@ -0,0 +1,15 @@ +[build] +publish = "exampleSiteMultilingual/public" +command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --baseURL $URL" + +[build.environment] +HUGO_VERSION = "0.89.0" +HUGO_THEME = "repo" + +[context.deploy-preview] +command = "cd exampleSiteMultilingual && hugo --themesDir=../.. --buildFuture --buildDrafts --baseURL $DEPLOY_PRIME_URL" + +[[headers]] + for = "/*" + [headers.values] + Access-Control-Allow-Origin = "*" \ No newline at end of file