script to fix anubis
|
|
@ -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
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
# Anubis Theme for Hugo [](https://opensource.org/licenses/MIT) [](https://www.paypal.com/paypalme/mitrichius/1)
|
# Anubis Theme for Hugo [](https://opensource.org/licenses/MIT) [](https://app.netlify.com/sites/hugo-theme-anubis/deploys) [](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/).
|
||||||
|
|
||||||
|
[Demo](https://hugo-theme-anubis.netlify.app/)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
@ -119,7 +121,7 @@ Options:
|
||||||
- `auto-without-switcher` - theme based on user system settings, without switcher, JS-free
|
- `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
|
- `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
|
- `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
|
### Social icons
|
||||||
#### Predefined 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.
|
If you want font awesome icons, download "Font Awesome For Desktop" and open svg directory.
|
||||||
|
|
||||||
### Google Analytics
|
### Google Analytics
|
||||||
Only works for production environment. You either build your site with variable like
|
Only works for production environment.
|
||||||
`HUGO_ENV=production hugo --minify`
|
|
||||||
or just put `env: production` to `params` section of config.
|
|
||||||
|
|
||||||
### 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/).
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,6 @@ th, td {
|
||||||
|
|
||||||
/* Code */
|
/* Code */
|
||||||
pre {
|
pre {
|
||||||
color: var(--pre-color);
|
|
||||||
background-color: var(--pre-bg-color);
|
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
@ -153,6 +151,8 @@ pre {
|
||||||
code,
|
code,
|
||||||
pre,
|
pre,
|
||||||
kbd {
|
kbd {
|
||||||
|
color: var(--pre-color);
|
||||||
|
background-color: var(--pre-bg-color);
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
font-size: 0.90em;
|
font-size: 0.90em;
|
||||||
line-height: 154%;
|
line-height: 154%;
|
||||||
|
|
@ -298,6 +298,10 @@ main h1 {
|
||||||
color: var(--link-state-color);
|
color: var(--link-state-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post-short-list .post-title {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
.post-title.favorite::after {
|
.post-title.favorite::after {
|
||||||
content: "☆";
|
content: "☆";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ author = "Dmitry Kolosov"
|
||||||
description = "Anubis is a simple minimalist theme for Hugo blog engine."
|
description = "Anubis is a simple minimalist theme for Hugo blog engine."
|
||||||
dateFormat = "2006-01-02"
|
dateFormat = "2006-01-02"
|
||||||
paginationSinglePost = true
|
paginationSinglePost = true
|
||||||
style = "light-without-switcher"
|
style = "auto"
|
||||||
readMore = false
|
readMore = false
|
||||||
|
|
||||||
# utteranc.es support
|
# utteranc.es support
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
||||||
|
|
||||||
## Twitter Simple Shortcode
|
## Twitter Simple Shortcode
|
||||||
|
|
||||||
{{< twitter_simple 1085870671291310081 >}}
|
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ author = "Dmitry Kolosov"
|
||||||
description = "Anubis is a simple minimalist theme for Hugo blog engine."
|
description = "Anubis is a simple minimalist theme for Hugo blog engine."
|
||||||
dateFormat = "2006-01-02"
|
dateFormat = "2006-01-02"
|
||||||
paginationSinglePost = true
|
paginationSinglePost = true
|
||||||
style = "light-without-switcher"
|
style = "auto"
|
||||||
readMore = false
|
readMore = false
|
||||||
|
|
||||||
# utteranc.es support
|
# utteranc.es support
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
||||||
|
|
||||||
## Twitter Simple Shortcode
|
## Twitter Simple Shortcode
|
||||||
|
|
||||||
{{< twitter_simple 1085870671291310081 >}}
|
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
||||||
|
|
||||||
## Twitter Simple Shortcode
|
## Twitter Simple Shortcode
|
||||||
|
|
||||||
{{< twitter_simple 1085870671291310081 >}}
|
{{< tweet user="DesignReviewed" id="1085870671291310081" >}}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Site.DisqusShortname }}
|
{{ if .Site.DisqusShortname }}
|
||||||
{{ template "_internal/disqus.html" . }}
|
{{ partial "disqus.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Site.Params.UtterancesRepo }}
|
{{ if .Site.Params.UtterancesRepo }}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<h1>{{ i18n .Data.Singular | humanize }}: {{ .Title }}</h1>
|
<h1>{{ i18n .Data.Singular | humanize }}: {{ .Title }}</h1>
|
||||||
<div class="post-info">
|
<div class="post-info">
|
||||||
<a href="{{ (printf "%s/%s" .Site.LanguagePrefix .Data.Plural) | absLangURL }}">{{ 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 }}
|
{{ range .Paginator.Pages }}
|
||||||
{{ partial "post-summary.html" . }}
|
{{ partial "post-summary.html" . }}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{{ template "_internal/disqus.html" . }}
|
||||||
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
|
Before Width: | Height: | Size: 524 B After Width: | Height: | Size: 524 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 684 B After Width: | Height: | Size: 684 B |
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 460 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 869 B After Width: | Height: | Size: 869 B |
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 730 B |
|
|
@ -0,0 +1,2 @@
|
||||||
|
<link rel="icon" type="image/x-icon" href="{{ "favicon.ico" | absURL }}">
|
||||||
|
<link rel="apple-touch-icon-precomposed" href="{{ "favicon.png" | absURL }}">
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
{{ $dict := newScratch }}
|
{{ $dict := newScratch }}
|
||||||
|
|
||||||
{{ if (eq .custom true) }}
|
{{ if (eq .custom true) }}
|
||||||
{{ $dict.Set "filename" (print "static/fa-icons/" .iconName ".svg") }}
|
{{ $dict.Set "svg" (readFile (print "static/fa-icons/" .iconName ".svg")) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $dict.Set "filename" (print "themes/anubis/static/fa-icons/" .iconName ".svg") }}
|
{{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{- $path:="<path" -}}
|
{{- $path:="<path" -}}
|
||||||
{{- $fill:="<path fill=\"currentColor\"" -}}
|
{{- $fill:="<path fill=\"currentColor\"" -}}
|
||||||
{{ replace (readFile ($dict.Get "filename")) $path $fill | safeHTML }}
|
{{ replace ($dict.Get "svg") $path $fill | safeHTML }}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,14 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="referrer" content="no-referrer-when-downgrade">
|
<meta name="referrer" content="no-referrer-when-downgrade">
|
||||||
|
|
||||||
<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
|
{{ partial "title.html" . }}
|
||||||
<meta name="description" content="{{ .Site.Params.Description }}">
|
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ 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 -}}
|
||||||
|
|
||||||
<link rel="icon" type="image/x-icon" href="{{ "favicon.ico" | absURL }}">
|
{{ partial "favicons.html" . }}
|
||||||
<link rel="apple-touch-icon-precomposed" href="{{ "favicon.png" | absURL }}">
|
|
||||||
|
|
||||||
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
|
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
|
||||||
|
|
||||||
{{ range .Site.Params.customJS -}}
|
{{ range .Site.Params.customJS -}}
|
||||||
|
|
@ -41,7 +39,7 @@
|
||||||
<meta property="article:tag" content="">
|
<meta property="article:tag" content="">
|
||||||
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
|
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
|
||||||
|
|
||||||
{{ 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" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,15 @@
|
||||||
<ul class="language-select">
|
<ul class="language-select">
|
||||||
{{ range $.Site.Home.AllTranslations }}
|
{{ $pageLang := .Page.Lang}}
|
||||||
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
{{ $translations := .AllTranslations }}
|
||||||
{{ end }}
|
{{ if not .IsTranslated }}
|
||||||
|
{{ $translations = $.Site.Home.AllTranslations }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ range $translations }}
|
||||||
|
{{ if eq .Lang $pageLang }}
|
||||||
|
<li>{{ .Language.LanguageName }}</li>
|
||||||
|
{{ else }}
|
||||||
|
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
|
<div class="left pagination-item {{ if not .Paginator.HasPrev }}disabled{{ end }}">
|
||||||
{{ if .Paginator.HasPrev }}
|
{{ if .Paginator.HasPrev }}
|
||||||
<a href="{{ .Paginator.Prev.URL | relLangURL }}">{{ $toNewPostsMessage }}</a>
|
<a href="{{ .Paginator.Prev.URL }}">{{ $toNewPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
<div class="right pagination-item {{ if not .Paginator.HasNext }}disabled{{ end }}">
|
||||||
{{ if .Paginator.HasNext }}
|
{{ if .Paginator.HasNext }}
|
||||||
<a href="{{ .Paginator.Next.URL | relLangURL }}">{{ $toOldPostsMessage }}</a>
|
<a href="{{ .Paginator.Next.URL }}">{{ $toOldPostsMessage }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
{{ if .Params.categories }}
|
{{ if .Params.categories }}
|
||||||
<ul class="post-categories">
|
<ul class="post-categories">
|
||||||
{{ range .Params.categories }}
|
{{ range .Params.categories }}
|
||||||
<li><a href="{{ "/categories/" | urlize | absLangURL }}">{{ . }}</a></li>
|
<li><a href="{{ "/categories/" | absLangURL }}{{ . | urlize }}">{{ . }}</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
<div class="pagination post-pagination">
|
<div class="pagination post-pagination">
|
||||||
<div class="left pagination-item {{ if not .NextInSection }}disabled{{ end }}">
|
<div class="left pagination-item {{ if not .NextInSection }}disabled{{ end }}">
|
||||||
{{ if .NextInSection }}
|
{{ if .NextInSection }}
|
||||||
<a href="{{ .NextInSection.Permalink | relLangURL }}">{{ .NextInSection.Title }}</a>
|
<a href="{{ .NextInSection.RelPermalink }}">{{ .NextInSection.Title }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
<div class="right pagination-item {{ if not .PrevInSection }}disabled{{ end }}">
|
<div class="right pagination-item {{ if not .PrevInSection }}disabled{{ end }}">
|
||||||
{{ if .PrevInSection }}
|
{{ if .PrevInSection }}
|
||||||
<a href="{{ .PrevInSection.Permalink | relLangURL }}">{{ .PrevInSection.Title }}</a>
|
<a href="{{ .PrevInSection.RelPermalink }}">{{ .PrevInSection.Title }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
{{ if $resource }}
|
{{ if $resource }}
|
||||||
{{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }}
|
{{ $resource := $resource | resources.ExecuteAsTemplate $targetFilename . }}
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
{{ if hugo.IsProduction }}
|
||||||
{{ $resource = $resource | resources.Minify }}
|
{{ $resource = $resource | resources.Minify }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $resource = $resource | resources.Fingerprint "sha256" }}
|
{{ $resource = $resource | resources.Fingerprint "sha256" }}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<title>{{ if and (.Title) (not .IsHome) }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
User-agent: *
|
User-agent: *
|
||||||
# robotstxt.org - if ENV production variable is false robots will be disallowed.
|
# robotstxt.org - if environment is not `production` then robots will be disallowed.
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
{{ if hugo.IsProduction }}
|
||||||
Disallow:
|
Disallow:
|
||||||
{{ else }}
|
{{ else }}
|
||||||
Disallow: /
|
Disallow: /
|
||||||
|
|
|
||||||
|
|
@ -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 = "*"
|
||||||