diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 364b88b..7b8e234 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -74,12 +74,12 @@ function generate_and_commit_card { echo "Failed to update social media card for $file" exit 1 } - + git add "$social_media_card" || { echo "Failed to add social media card $social_media_card" exit 1 } - + git add "$file" || { echo "Failed to add $file" exit 1 @@ -103,13 +103,13 @@ function is_minified() { echo "Either terser or uglifyjs is not installed. Skipping minification check." return 0 fi - + # Original file size. local original_size=$(wc -c < "$file") - + # File size after compression with terser. local terser_size=$(terser --compress --mangle -- "$file" | wc -c) - + # File size after compression with uglifyjs. local uglifyjs_size=$(uglifyjs --compress --mangle -- "$file" | wc -c) @@ -117,7 +117,7 @@ function is_minified() { if (( original_size <= terser_size && original_size <= uglifyjs_size )); then return 0 fi - + # If the file isn't as small as it can be, suggest the better compressor in the error message if (( terser_size < uglifyjs_size )); then error_exit "Minified JS file $file isn't as small as it can be! Try using terser for better compression." diff --git a/config.toml b/config.toml index 6eeabe1..9a09282 100644 --- a/config.toml +++ b/config.toml @@ -63,7 +63,7 @@ default_theme = "light" # All other skins have optimal contrast. skin = "" -# Set browser theme colour. Can be a single colour or [light, dark]. +# Set browser theme colour. Can be a single colour or [light, dark]. # Note: Bright colors may be ignored in dark mode. # More details: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color browser_theme_color = "#087e96" diff --git a/sass/parts/_header-anchor.scss b/sass/parts/_header-anchor.scss index 97df654..e7a20f0 100644 --- a/sass/parts/_header-anchor.scss +++ b/sass/parts/_header-anchor.scss @@ -9,7 +9,7 @@ width: 1.9rem; height: 100%; user-select: none; - + @media (max-width: 500px) { display: none; } @@ -28,7 +28,7 @@ h1, h2, h3, h4, h5, h6 { &:hover .header-anchor { opacity: 1; } - + .header-anchor:hover { background-color: transparent; } diff --git a/static/js/decodeMail.js b/static/js/decodeMail.js index d62c70c..6751991 100644 --- a/static/js/decodeMail.js +++ b/static/js/decodeMail.js @@ -9,10 +9,10 @@ // See https://en.wikipedia.org/wiki/Email_address#Internationalization // Code below adapted from Jackie Han: https://stackoverflow.com/a/64752311 const byteString = atob(encodedString); - + // Convert byteString to an array of char codes. const charCodes = [...byteString].map(char => char.charCodeAt(0)); - + // Use TypedArray.prototype.set() to copy the char codes into a Uint8Array. const bytes = new Uint8Array(charCodes.length); bytes.set(charCodes); diff --git a/static/js/isso.js b/static/js/isso.js index 652db48..4097474 100644 --- a/static/js/isso.js +++ b/static/js/isso.js @@ -56,7 +56,7 @@ function loadIsso(commentsDiv) { script.setAttribute('data-isso-vote', voting); script.setAttribute('data-isso-page-author-hashes', hashes); script.setAttribute('data-isso-css', 'false'); - + // Set the id and data-isso-id of the Isso thread. const section = document.createElement('section'); section.id = 'isso-thread'; diff --git a/static/js/utterances.js b/static/js/utterances.js index 784e772..f652d33 100644 --- a/static/js/utterances.js +++ b/static/js/utterances.js @@ -1,7 +1,7 @@ function setUtterancesTheme(newTheme) { // Get the frame with class "utterances-frame". const frame = document.querySelector(".utterances-frame"); - + if (frame) { // If the iframe exists, send a message to set the theme. frame.contentWindow.postMessage( diff --git a/templates/404.html b/templates/404.html index 32fc96c..84e414d 100644 --- a/templates/404.html +++ b/templates/404.html @@ -10,7 +10,7 @@  {{ macros_translate::translate(key="translation_missing", default="or hasn't been translated into your language yet", force_lang=language_name, language_strings=language_strings) }}{{ macros_translate::translate(key="full_stop", default=".", force_lang=language_name, language_strings=language_strings) }} {%- else %}. {%- endif %} - {{ macros_translate::translate(key="check_url", default="Check the URL for errors or", force_lang=language_name, language_strings=language_strings) }} + {{ macros_translate::translate(key="check_url", default="Check the URL for errors or", force_lang=language_name, language_strings=language_strings) }} {{ macros_translate::translate(key="go_home", default="go back to the homepage", force_lang=language_name, language_strings=language_strings) }}{{ macros_translate::translate(key="full_stop", default=".", force_lang=language_name, language_strings=language_strings) }}

{% endmacro %} diff --git a/templates/archive.html b/templates/archive.html index 2f14ffd..e963ca0 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -14,7 +14,7 @@ {%- set section_item = get_section(path=section_path ~ "_index.md") %} {%- else %} {%- set section_item = get_section(path=section_path ~ "_index." ~ lang ~ ".md") %} - {%- endif %} + {%- endif %} {% for year, posts in section_item.pages | group_by(attribute="year") %} {% if posts | length > 0 diff --git a/templates/base.html b/templates/base.html index 2d4f7d2..9711e99 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,7 +6,7 @@ {% import "macros/table_of_contents.html" as macros_toc %} {% import "macros/translate.html" as macros_translate %} -{# Load the internationalisation data for the current language from +{# Load the internationalisation data for the current language from the .toml files in the user's '/i18n' folder, falling back to the theme's. This variable will hold all the text strings for the language #} {%- set language_strings = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} diff --git a/templates/macros/format_date.html b/templates/macros/format_date.html index 067a941..4ee9f6e 100644 --- a/templates/macros/format_date.html +++ b/templates/macros/format_date.html @@ -26,7 +26,7 @@ {% endif %} {# Return the date. #} - {{ date | date(format="%-d") }}{{ suffix }} + {{ date | date(format="%-d") }}{{ suffix }} {% if short == true %} {{ date | date(format="%b %Y") }} {% else %} diff --git a/templates/page.html b/templates/page.html index 3d8ca8f..a12b2e4 100644 --- a/templates/page.html +++ b/templates/page.html @@ -98,7 +98,7 @@ {# Optional table of contents below the header #} {% if page.toc and macros_settings::evaluate_setting_priority(setting="toc", page=page, default_global_value=false) == "true" %} - {{ macros_toc::toc(page=page, header=true, language_strings=language_strings) }} + {{ macros_toc::toc(page=page, header=true, language_strings=language_strings) }} {% endif %}
diff --git a/templates/partials/analytics.html b/templates/partials/analytics.html index e3c9596..db84300 100644 --- a/templates/partials/analytics.html +++ b/templates/partials/analytics.html @@ -8,27 +8,27 @@ data-goatcounter="{{ self_hosted_url ~ '/count' }}" src="{{ self_hosted_url ~ '/count.js' }}" {% else %} - data-goatcounter="https://{{ analytics_id }}.goatcounter.com/count" + data-goatcounter="https://{{ analytics_id }}.goatcounter.com/count" src="https://gc.zgo.at/count.js" {% endif %} > {% elif analytics_service == "umami" %} - {% elif analytics_service == "plausible" %} - diff --git a/templates/partials/cards_pages.html b/templates/partials/cards_pages.html index 12d0e91..48755e0 100644 --- a/templates/partials/cards_pages.html +++ b/templates/partials/cards_pages.html @@ -11,7 +11,7 @@ {%- endif -%} {% set target_url = page.extra.link_to | default(value=page.permalink) %} - + {% if page.extra.local_image %} {% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %} diff --git a/templates/partials/header.html b/templates/partials/header.html index e3c3c3d..d2263ed 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -16,7 +16,7 @@ {# Feed #} - + {# CSS #} {# Load subset of glyphs for header. Avoids flashing issue in Firefox #} {% if config.extra.custom_subset and config.extra.custom_subset == true %} @@ -49,7 +49,7 @@ {%- for stylesheet in stylesheets %} {%- endfor %} - + {%- if config.extra.browser_theme_color and config.extra.browser_theme_color is iterable -%} @@ -90,10 +90,10 @@ {# Try to construct the image path relative to the current page #} {% set colocated_path = page.colocated_path | default(value="") %} {% set file_path = colocated_path ~ social_media_card %} - + {# Fetch metadata to verify image existence at the relative path #} {%- set meta = get_image_metadata(path=file_path, allow_missing=true) -%} - + {# Check if relative path exists, else try absolute path #} {% if meta %} {% set final_path = file_path %} @@ -107,7 +107,7 @@ {{ throw(message="Could not get metadata for the specified social media card image in page " ~ page.path ~ ". Attempted relative path: '" ~ file_path ~ "' and absolute path: '" ~ social_media_card ~ "'. Ensure the file exists at one of these locations.") }} {% endif %} {% endif %} - + {# Generate the social media meta tags #} @@ -131,7 +131,7 @@ {%- set canonical_url = current_url | replace(from=config.base_url, to=config.extra.base_canonical_url) -%} {%- endif -%} {%- endif -%} - + {# Add canonical URL, if set #} {%- if canonical_url -%} @@ -139,7 +139,7 @@ {%- elif current_url -%} {%- endif -%} - + {%- include "partials/content_security_policy.html" -%} diff --git a/templates/shortcodes/multilingual_quote.html b/templates/shortcodes/multilingual_quote.html index e363460..b25a4e7 100644 --- a/templates/shortcodes/multilingual_quote.html +++ b/templates/shortcodes/multilingual_quote.html @@ -30,7 +30,7 @@

{{ open_quote ~ original ~ close_quote }}

{% if author %}

— {{ author }}{% endif %}

+

diff --git a/theme.toml b/theme.toml index f5313cd..ac90fa1 100644 --- a/theme.toml +++ b/theme.toml @@ -42,7 +42,7 @@ default_theme = "light" # All other skins have optimal contrast. skin = "" -# Set browser theme colour. Can be a single colour or [light, dark]. +# Set browser theme colour. Can be a single colour or [light, dark]. # Note: Bright colors may be ignored in dark mode. # More details: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color # browser_theme_color = "#087e96" # Example of single value.