{{ trim .Title " " }}
© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}
-{{ i18n "powered" | humanize }} Hugo, {{ i18n "theme" }} Anubis.
-
diff --git a/README.md b/README.md index a5f7f0a..f131846 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Anubis is a simple minimalist theme for [Hugo blog engine](https://gohugo.io/). ## Features +- Dark mode (automatic, by switcher) - Pagination - Tags/Categories support - Archive @@ -61,6 +62,7 @@ params: - css/my.css # relative path to "static" directory dateFormat: "2006-01-02" paginationSinglePost: true + style: light-without-switcher markup: goldmark: @@ -78,6 +80,16 @@ Now enter [`localhost:1313`](http://localhost:1313/) in the address bar of your ## Feature Settings +### Dark Mode +Customize via `style` param in `params` section of config. +Options: +- `light-without-switcher` - light theme, without switcher, JS-free (by default) +- `dark-without-switcher` - dark theme, 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 +- `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 + ### Google Analytics Only works for production environment. You either build your site with variable like `HUGO_ENV=production hugo --minify` diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8ccca3d..817f7a9 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -13,6 +13,9 @@ googleAnalytics = "" [params] author = "Dmitry Kolosov" description = "Anubis is a simple minimalist theme for Hugo blog engine." + dateFormat = "2006-01-02" + paginationSinglePost = true + style = "light-without-switcher" [menu] diff --git a/exampleSiteMultilingual/config.toml b/exampleSiteMultilingual/config.toml index 5d164d6..e33540b 100644 --- a/exampleSiteMultilingual/config.toml +++ b/exampleSiteMultilingual/config.toml @@ -14,6 +14,9 @@ googleAnalytics = "" [params] author = "Dmitry Kolosov" description = "Anubis is a simple minimalist theme for Hugo blog engine." + dateFormat = "2006-01-02" + paginationSinglePost = true + style = "light-without-switcher" [languages.en] languageName = "English" diff --git a/images/screenshot.png b/images/screenshot.png index e344554..4eb5932 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index 4d652a1..102bd15 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9f295e8..97bfae4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,5 +1,9 @@ - +{{ $dataTheme := "" }} +{{ if eq site.Params.style "dark-without-switcher" }} + {{ $dataTheme = "dark" }} +{{ end }} +
{{ block "head" . }} {{ partial "head.html" . }} @@ -8,7 +12,7 @@ {{ i18n "skipToContent" | humanize }}© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}
-{{ i18n "powered" | humanize }} Hugo, {{ i18n "theme" }} Anubis.
-