From 10c06b661c10b8b457a2e05cd5c4f957decf7a19 Mon Sep 17 00:00:00 2001 From: jimmyff Date: Mon, 20 Feb 2023 11:24:42 +0000 Subject: [PATCH] Google analytics & fix for whitespace --- CHANGELOG.md | 2 + config.toml | 3 ++ templates/base.html | 50 ++++++++++++++---------- templates/gallery.html | 25 ++++++------ templates/macros/images.html | 76 ++++++++++++++++++------------------ templates/page.html | 14 +++---- 6 files changed, 90 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2efe9c3..2d28648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. - Hooks names updated for consistency - Added class parameter for responsive images - Added `images::image()` macro and `image_original` shortcode for images that don't want resizing (eg: animated gifs) +- Added Google Analytics to `config.toml` see: `config.extra.google_analytics_tag_id` +- Fixes issues with unnecessary whitespace in templates ## [1.0] diff --git a/config.toml b/config.toml index 3642579..7f6637f 100644 --- a/config.toml +++ b/config.toml @@ -38,6 +38,9 @@ anchors = "on" # Place your avatar in your /static folder avatar = "/inky.png" +# Your Google Analytics measurement id ("G-XXXXXXXXXX") +# google_analytics_tag_id = ""; + keywords = "zola, theme, ink, hugo-ink" search_enabled = false diff --git a/templates/base.html b/templates/base.html index f9b2839..82f726f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,12 +12,22 @@ {%- block og_preview -%} {{ social::og_preview() }} {%-endblock og_preview -%} - {% block rss %} + {% block rss -%} {% - endblock %} + href="{{ get_url(path='atom.xml',trailing_slash=false)|safe}}"> + {% endblock rss -%} + {% if config.extra.google_analytics_tag_id -%} + + + + {% endif -%}
- {% if config.extra.avatar %} + {% if config.extra.avatar -%} - {% endif %} + {% endif -%}

{{ config.title }}

@@ -51,63 +61,63 @@
- {% block content %} - {% endblock %} + {% block content -%} + {% endblock -%}