From 3ae904c031422e5ad26e344506fc1aa80e98ea1c Mon Sep 17 00:00:00 2001 From: oltdaniel Date: Sun, 7 May 2023 12:05:28 +0200 Subject: [PATCH] remove translations + small improvements - remove the translations due to the awful support within zola and theme usages + better improved 404 page + better get theme fallback mechanism + avoid errors when an extra key is not set --- README.md | 14 +++++++------- config.toml | 20 +++++++------------- templates/404.html | 5 ++++- templates/base.html | 4 +++- templates/tags/list.html | 2 +- templates/tags/single.html | 2 +- theme.toml | 6 ------ 7 files changed, 23 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 8278614..07e5d96 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ and then enable it in your `config.toml`: theme = "dose" ``` -The following taxonomies are enabled (for default `en` and `de`): +You can enable the following taxonomies: ```toml taxonomies = [ @@ -40,7 +40,7 @@ default_theme = "dark" # or "light" ``` The description of yourself with your image, you can modify by using a template. Just create a new -file `myblog/parts/me.html`: +file `myblog/templates/parts/me.html`: ```html @@ -74,12 +74,12 @@ This theme supports dark and light mode. Currently this will be only switched ba #### Size The JavaScript has been moved into the page itself to allow minification. Together this results in the following sizes for the `index.html`: -- `2.91kB` JavaScript -- `3.04kB` CSS -- `16.7kB` Profile Image -- `4.67kB - 2.91kB = 1.76kB` HTML +- `~ 3kB` JavaScript +- `~ 3kB` CSS +- `~ 17kB` Profile Image +- `~5kB - ~3kB = ~2kB` HTML -Which results in a total loading size of `2.91kB + 3.04kB + 16.7kB + 1.76kB = 24.41kB`. +Which results in a total loading size of `3kB + 3kB + 17kB + 2kB = 25kB`. #### Syntax Highlighting diff --git a/config.toml b/config.toml index ca0a587..2bde9e5 100644 --- a/config.toml +++ b/config.toml @@ -9,26 +9,20 @@ compile_sass = true # Whether to build a search index to be used later on by a JavaScript library build_search_index = false -# Default English language -[languages.en] +# Explicitly set default language +default_language = "en" + +# Enable taxonomies in default language taxonomies = [ - { name = "tags", feed = true } + { name = "tags" } ] -[languages.en.translations] -tags = "Tags" -toggle_theme = "Toggle Theme" - -# German language [languages.de] +# Enable taxonomies in german language taxonomies = [ - { name = "tags", feed = true } + { name = "tags" } ] -[languages.de.translations] -tags = "Tags" -toggle_theme = "Thema umschalten" - [markdown] # Whether to do syntax highlighting # Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola diff --git a/templates/404.html b/templates/404.html index 65919ff..d4887a4 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,5 +1,8 @@ {% extends "base.html" %} {% block content %} - 404 +
+

404

+
NOT FOUND
+
{% endblock content %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 9b45e13..dabe685 100644 --- a/templates/base.html +++ b/templates/base.html @@ -30,7 +30,7 @@