From 9a344d88944a08a96e9681fd399d9b2f25eac56c Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 2 Sep 2023 18:54:22 +0200 Subject: Add meta description --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.toml') diff --git a/config.toml b/config.toml index ca8d27a..9b94cd6 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,6 @@ title = "Zola ʕ•ᴥ•ʔ Bear Blog" base_url = "https://alanpearce.codeberg.page/zola-bearblog" -description = "" +description = "A Zola-theme based on Bear Blog." # Whether to automatically compile all Sass files in the sass directory compile_sass = false -- cgit 1.4.1 From 4c9ac0a4636df958309fe7bb17945113a0fa5fb2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 08:23:09 +0000 Subject: Update base_url --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.toml') diff --git a/config.toml b/config.toml index 9b94cd6..d2a8833 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ title = "Zola ʕ•ᴥ•ʔ Bear Blog" -base_url = "https://alanpearce.codeberg.page/zola-bearblog" +base_url = "https://zola-bearblog.netlify.app/" description = "A Zola-theme based on Bear Blog." # Whether to automatically compile all Sass files in the sass directory -- cgit 1.4.1 From f51202d961e6d2337a96ef3552c4efced1fe2beb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 9 Sep 2023 19:10:40 +0200 Subject: Allow end-user to disable CSP header meta tags without editing theme --- config.toml | 1 + templates/base.html | 8 ++++++-- theme.toml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'config.toml') diff --git a/config.toml b/config.toml index d2a8833..78e9f9a 100644 --- a/config.toml +++ b/config.toml @@ -20,6 +20,7 @@ highlight_code = true [extra] date_format="%d %b, %Y" +webserver_sends_csp_headers=true [[extra.main_menu]] name = "Bear" diff --git a/templates/base.html b/templates/base.html index 02fdfe6..ee206b3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,7 +1,9 @@ - {% include "security_tags.html" ignore missing %} + {%- if config.webserver_sends_csp_headers %} + {%- include "security_tags.html" ignore missing %} + {%- endif %} {% include "favicon.html" ignore missing -%} @@ -13,7 +15,9 @@ {%- endblock -%} {%- endif %} - {% include "style.html" ignore missing -%} + {% include "custom_head.html" ignore missing -%} diff --git a/theme.toml b/theme.toml index 1bba50d..902c8ec 100644 --- a/theme.toml +++ b/theme.toml @@ -13,6 +13,7 @@ demo = "https://zola-bearblog.netlify.app/" # Use snake_casing to be consistent with the rest of Zola [extra] date_format="%d %b, %Y" +webserver_sends_csp_headers=false [author] name = "Alan Pearce" -- cgit 1.4.1 From a423677c42b7a3f755ee5c2ba434ed77ef6f6b99 Mon Sep 17 00:00:00 2001 From: Oleksii Dobrovolskyi Date: Wed, 14 Feb 2024 17:30:00 +0200 Subject: Add Home to extra.main_menu so it can be translated on the multilingual websites --- README.md | 4 ++++ config.toml | 4 ++++ templates/nav.html | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'config.toml') diff --git a/README.md b/README.md index db77233..7ebe80b 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ Please check out the included [config.toml](https://codeberg.org/alanpearce/zola Create an array in `extra` with a key of `main_menu`. `url` is passed to [`get_url`](https://www.getzola.org/documentation/templates/overview/#get-url) ```toml +[[extra.main_menu]] +name = "Home" +url = "/" + [[extra.main_menu]] name = "Bear" url = "@/bear.md" diff --git a/config.toml b/config.toml index 78e9f9a..bd675af 100644 --- a/config.toml +++ b/config.toml @@ -22,6 +22,10 @@ highlight_code = true date_format="%d %b, %Y" webserver_sends_csp_headers=true +[[extra.main_menu]] +name = "Home" +url = "/" + [[extra.main_menu]] name = "Bear" url = "@/bear.md" diff --git a/templates/nav.html b/templates/nav.html index e18fda2..a71652e 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,4 +1,3 @@ -Home {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} {%- if item.url is matching("https?://") %} -- cgit 1.4.1 From a6000685cfcbb4253f634b44637b599cec96d5bc Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 13:58:34 +0100 Subject: Create basic German version of website --- config.toml | 35 +++++++++++++++++++++++++++++++---- content/_index.de.md | 23 +++++++++++++++++++++++ content/bear.de.md | 15 +++++++++++++++ content/blog/_index.de.md | 3 +++ content/zola.de.md | 36 ++++++++++++++++++++++++++++++++++++ templates/footer.html | 2 +- templates/nav.html | 11 +++++++++-- templates/section.html | 8 ++++---- templates/taxonomy_list.html | 2 +- templates/taxonomy_single.html | 2 +- 10 files changed, 124 insertions(+), 13 deletions(-) create mode 100644 content/_index.de.md create mode 100644 content/bear.de.md create mode 100644 content/blog/_index.de.md create mode 100644 content/zola.de.md (limited to 'config.toml') diff --git a/config.toml b/config.toml index bd675af..5a54517 100644 --- a/config.toml +++ b/config.toml @@ -13,6 +13,29 @@ taxonomies = [ {name = "tags", feed = true}, ] +default_language = "en" + +[translations] +no_posts = "No posts yet" +remove_filter = "Remove filter" +filtering_for = "Filtering for" +made_with = "Made with" + +[languages.de] +title = "Zola ʕ•ᴥ•ʔ Bear Blog" +description = "Ein Zola-theme basiert auf Bear Blog." + +taxonomies = [ + {name = "categories", feed = true}, + {name = "tags", feed = true}, +] + +[languages.de.translations] +no_posts = "Keine Einträge" +remove_filter = "Filter entfernen" +filtering_for = "Filtern nach" +made_with = "Erstellt mit" + [markdown] # Whether to do syntax highlighting # Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola @@ -23,17 +46,21 @@ date_format="%d %b, %Y" webserver_sends_csp_headers=true [[extra.main_menu]] -name = "Home" +name_en = "Home" +name_de = "Startseite" url = "/" [[extra.main_menu]] -name = "Bear" +name_en = "Bear" +name_de = "Bear" url = "@/bear.md" [[extra.main_menu]] -name = "Zola" +name_en = "Zola" +name_de = "Zola" url = "@/zola.md" [[extra.main_menu]] -name = "Blog" +name_en = "Blog" +name_de = "Blog" url = "@/blog/_index.md" diff --git a/content/_index.de.md b/content/_index.de.md new file mode 100644 index 0000000..cdcad42 --- /dev/null +++ b/content/_index.de.md @@ -0,0 +1,23 @@ ++++ ++++ +# Eine himmlische Verbindung + +Es gibt eine Krise der Website-Fettleibigkeit. Aufgeblähte Websites voller Skripte, Werbung und Tracker bremsen deine Leser jedes Mal aus, wenn sie versuchen, deine gut gestalteten Inhalte zu lesen. + +Zola Bear Blog ist alles, was du brauchst, um eine fantastische und optimierte Website oder einen Blog zu erstellen. Es funktioniert perfekt auf **jedem** Anzeigegerät. Alles, worauf du dich konzentrieren müssen, ist das Schreiben guter Inhalte. + +[Zum ursprünglichen Bear-Blog](https://bearblog.dev/). + +--- + +Was passiert, wenn du den weltweit schnellsten und leichtesten Generator für statische Websites mit einem Design-Theme kombinieren, das dir kostenlose, unkomplizierte und superschnelle Blogging-Funktionen bietet? + +**Benutze dieses Theme und finde es heraus!** + +Erstellt mit 💚 von [Alan Pearce](https://alanpearce.eu). + +--- + +Veröffentliche einfach deine Inhalte online, bau ein Publikum auf und halte deine Seiten klein, schnell und **für Suchmaschinen optimiert**. + +Jede Seite ist ~5kb groß, und du kannst dein Blog selbst **hosten**. diff --git a/content/bear.de.md b/content/bear.de.md new file mode 100644 index 0000000..b9a1f3e --- /dev/null +++ b/content/bear.de.md @@ -0,0 +1,15 @@ ++++ +title = "Bear" ++++ + +Webseite: [https://bearblog.dev](https://bearblog.dev) + +Es gibt eine Krise der Website-Fettleibigkeit. Aufgeblähte Websites voller Skripte, Werbung und Tracker bremsen deine Leser jedes Mal aus, wenn sie versuchen, deine gut gestalteten Inhalte zu lesen. + +Zola Bear Blog ist alles, was du brauchst, um eine fantastische und optimierte Website oder einen Blog zu erstellen. Es funktioniert perfekt auf **jedem** Anzeigegerät. Alles, worauf du dich konzentrieren müssen, ist das Schreiben guter Inhalte. + +Bear macht es einfach, Inhalte online zu veröffentlichen und ein Publikum aufzubauen, während die Seiten klein, schnell und **für Suchmaschinen optimiert** bleiben. + +Jede Seite ist ~5kb. + +Weitere Informationen und Beiträge unter [GitHub](https://github.com/HermanMartinus/bearblog). diff --git a/content/blog/_index.de.md b/content/blog/_index.de.md new file mode 100644 index 0000000..34651ab --- /dev/null +++ b/content/blog/_index.de.md @@ -0,0 +1,3 @@ ++++ +title = "Blog" ++++ diff --git a/content/zola.de.md b/content/zola.de.md new file mode 100644 index 0000000..204f790 --- /dev/null +++ b/content/zola.de.md @@ -0,0 +1,36 @@ ++++ +title = "Zola" ++++ +## Keine Abhängigkeiten + +Zola wird als einzelne ausführbare Datei mit Sass-Kompilierung, Syntax +Syntaxhervorhebung, Inhaltsverzeichnis und vielen anderen Funktionen, die +die normalerweise das Einrichten einer Entwicklungsumgebung oder das Hinzufügen einiger +JavaScript-Bibliotheken zu deiner Website. + +## Rasend schnell + +Die durchschnittliche Website wird in weniger als einer Sekunde erstellt, einschließlich +Sass-Kompilierung und Syntaxhervorhebung. + +## Skalierbar + +Zola rendert deine gesamte Website als statische Dateien, was es trivial macht +jede Art von Datenverkehr zu bewältigen, ohne dass du dich um die +ohne sich um die Verwaltung eines Servers oder einer Datenbank kümmern zu müssen. + +## Einfach zu bedienen + +Von der CLI bis zur Template-Engine ist alles so konzipiert, dass es +intuitiv. Verlasse dich jedoch nicht auf mein Wort, sondern schaue in die Dokumentation +und überzeug dich selbst. + +## Flexibel + +Zola geht dir aus dem Weg, damit du dich auf deine Inhalte konzentrieren kannst, sei es ein +Blog, eine Wissensdatenbank, eine Landing Page oder eine Kombination aus beidem. + +## Erweitertes Markdown + +Zola verfügt über Shortcodes und interne Links, die das Schreiben von +deine Inhalte zu schreiben. diff --git a/templates/footer.html b/templates/footer.html index c952a93..6d4f0f7 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -1,5 +1,5 @@ diff --git a/templates/nav.html b/templates/nav.html index a71652e..cd2d391 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,9 +1,16 @@ +{% set current_lang = config.default_language %} +{% if page %} + {% set current_lang = page.lang %} +{% elif section %} + {% set current_lang = section.lang %} +{% endif %} {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} + {% set language_key = 'name_' ~ current_lang %} {%- if item.url is matching("https?://") %} - {{ item.name }} + {{ item[language_key] }} {%- else %} - {{ item.name }} + {{ item[language_key] }} {%- endif %} {%- endfor %} {%- endif -%} diff --git a/templates/section.html b/templates/section.html index f3c218a..9560719 100644 --- a/templates/section.html +++ b/templates/section.html @@ -3,9 +3,9 @@ {% block main %}
{%- if taxonomy.term %} -

Filtering for "{{ section.title }}"

+

{{ trans(key="filtering_for",lang=lang)}} "{{ section.title }}"

- Remove filter + {{ trans(key="remove_filter", lang=lang) }} {%- endif %}
- {% set tags = get_taxonomy(kind="tags") %} + {% set tags = get_taxonomy(kind="tags", lang=lang) %} {% for post in tags.items %} #{{ post.name }}  {% endfor %} diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 98b8fc9..4b4e08a 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -5,7 +5,7 @@

{{ taxonomy.name | capitalize }}

- {% set tags = get_taxonomy(kind="tags") %} + {% set tags = get_taxonomy(kind="tags", lang=lang) %} {% for post in tags.items %} #{{ post.name }}  {% endfor %} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 0f640a2..a8ca536 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -22,7 +22,7 @@ {% else %}
  • - No posts yet + {{ trans(key="no_posts", lang=lang) }}
  • {% endfor %} -- cgit 1.4.1 From d604fa65ddad76100d9061d35b4129e6c6c5771d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Feb 2024 14:59:47 +0100 Subject: Create optional language switcher --- config.toml | 14 ++++++++++---- templates/header.html | 1 + templates/language_switcher.html | 11 +++++++++++ templates/nav.html | 9 +++++++-- 4 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 templates/language_switcher.html (limited to 'config.toml') diff --git a/config.toml b/config.toml index 5a54517..92637f3 100644 --- a/config.toml +++ b/config.toml @@ -44,23 +44,29 @@ highlight_code = true [extra] date_format="%d %b, %Y" webserver_sends_csp_headers=true +language_switcher=true + +translations = [ + { code="en", name="English" }, + { code="de", name="Deutsch" }, +] [[extra.main_menu]] -name_en = "Home" +name = "Home" name_de = "Startseite" url = "/" [[extra.main_menu]] -name_en = "Bear" +name = "Bear" name_de = "Bear" url = "@/bear.md" [[extra.main_menu]] -name_en = "Zola" +name = "Zola" name_de = "Zola" url = "@/zola.md" [[extra.main_menu]] -name_en = "Blog" +name = "Blog" name_de = "Blog" url = "@/blog/_index.md" diff --git a/templates/header.html b/templates/header.html index f92e903..6e56025 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,4 +1,5 @@
    + {% include "language_switcher.html" %}

    {{ config.title }}

    diff --git a/templates/language_switcher.html b/templates/language_switcher.html new file mode 100644 index 0000000..b82ddfc --- /dev/null +++ b/templates/language_switcher.html @@ -0,0 +1,11 @@ +{% if config.extra.language_switcher %} + +{% endif %} diff --git a/templates/nav.html b/templates/nav.html index cd2d391..ac3f44e 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -7,10 +7,15 @@ {%- if config.extra.main_menu %} {%- for item in config.extra.main_menu %} {% set language_key = 'name_' ~ current_lang %} + {% if current_lang == config.default_language %} + {% set title = item | get(key=language_key, default=item.name) %} + {% else %} + {% set title = item[language_key] %} + {% endif %} {%- if item.url is matching("https?://") %} - {{ item[language_key] }} + {{ title }} {%- else %} - {{ item[language_key] }} + {{ title }} {%- endif %} {%- endfor %} {%- endif -%} -- cgit 1.4.1 From f925498eb727bcdac7c3dafc65365cff6bc4d577 Mon Sep 17 00:00:00 2001 From: Oleksii Dobrovolskyi Date: Sun, 17 Mar 2024 13:58:36 +0200 Subject: Change date format to YYYY-MM-DD --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.toml') diff --git a/config.toml b/config.toml index 92637f3..fcb1d61 100644 --- a/config.toml +++ b/config.toml @@ -42,7 +42,7 @@ made_with = "Erstellt mit" highlight_code = true [extra] -date_format="%d %b, %Y" +date_format="%Y-%m-%d" webserver_sends_csp_headers=true language_switcher=true -- cgit 1.4.1 From baabcb634bdffb8623eacc410e8707a3b4afe2b5 Mon Sep 17 00:00:00 2001 From: Emilio Ziniades Date: Sun, 12 May 2024 15:54:40 +0200 Subject: feat(table of contents): Add table of contents This feature is disabled by default, but can be enabled/disabled globally or per-page. Zola already provides `page.toc`, this PR simply adds a macro to recursively render that data in nested `ul`s. It also establishes some configuration options to display it and set a maximum headers level. --- README.md | 23 +++++++++++++++++++++++ config.toml | 6 +++++- content/zola.md | 1 + templates/macros.html | 12 ++++++++++++ templates/page.html | 7 +++++++ theme.toml | 5 +++++ 6 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 templates/macros.html (limited to 'config.toml') diff --git a/README.md b/README.md index 7ebe80b..5152949 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,29 @@ The contents of the `index`-page may be changed by editing your `content/_index. Add a `custom_head.html`-file to your `templates/`-directory. In there you may add a `