🎨 style: fix whitespace issues
This commit is contained in:
parent
8aabeaecc3
commit
5458b1c533
@ -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."
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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';
|
||||
|
@ -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(
|
||||
|
@ -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) }}
|
||||
<a href="{{ config.base_url }}{% if language_name != config.default_language %}/{{ language_name }}{% endif %}/">
|
||||
{{ macros_translate::translate(key="go_home", default="go back to the homepage", force_lang=language_name, language_strings=language_strings) }}</a>{{ macros_translate::translate(key="full_stop", default=".", force_lang=language_name, language_strings=language_strings) }}</p>
|
||||
{% endmacro %}
|
||||
|
@ -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
|
||||
|
@ -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) -%}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
||||
<section class="body">
|
||||
|
@ -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 %}
|
||||
></script>
|
||||
|
||||
{% elif analytics_service == "umami" %}
|
||||
<script async defer
|
||||
<script async defer
|
||||
{% if self_hosted_url %}
|
||||
data-website-id="{{ analytics_id }}"
|
||||
data-website-id="{{ analytics_id }}"
|
||||
src="{{ self_hosted_url ~ '/umami.js' }}"
|
||||
{% else %}
|
||||
data-website-id="{{ analytics_id }}"
|
||||
data-website-id="{{ analytics_id }}"
|
||||
src="https://analytics.eu.umami.is/script.js"
|
||||
{% endif %}
|
||||
data-do-not-track="true">
|
||||
</script>
|
||||
|
||||
{% elif analytics_service == "plausible" %}
|
||||
<script
|
||||
defer
|
||||
data-domain="{{ analytics_id }}"
|
||||
<script
|
||||
defer
|
||||
data-domain="{{ analytics_id }}"
|
||||
src="{% if self_hosted_url %}{{ self_hosted_url ~ '/js/plausible.js' }}{% else %}https://plausible.io/js/script.js{% endif %}"
|
||||
></script>
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
{%- endif -%}
|
||||
|
||||
{% set target_url = page.extra.link_to | default(value=page.permalink) %}
|
||||
|
||||
|
||||
<a rel="{{ rel_attributes }}" {{ blank_target }} href="{{ target_url }}">
|
||||
{% if page.extra.local_image %}
|
||||
{% set meta = get_image_metadata(path=page.extra.local_image, allow_missing=true) %}
|
||||
|
@ -16,7 +16,7 @@
|
||||
{# Feed #}
|
||||
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }}" href="{{ get_url(path="atom.xml",
|
||||
trailing_slash=false) }}">
|
||||
|
||||
|
||||
{# 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 %}
|
||||
<link rel="stylesheet" href="{{ get_url(path=stylesheet, cachebust=true) | safe }}" />
|
||||
{%- endfor %}
|
||||
|
||||
|
||||
<meta name="color-scheme" content="{%- if config.extra.theme_switcher -%}light dark{%- elif config.extra.default_theme -%}{{config.extra.default_theme}}{%- else -%}light{%- endif -%}" />
|
||||
|
||||
{%- 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 #}
|
||||
<meta property="og:image" content="{{ get_url(path=final_path, cachebust=true) }}" />
|
||||
<meta property="og:image:width" content="{{ meta.width }}" />
|
||||
@ -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 -%}
|
||||
<link rel="canonical" href="{{ canonical_url }}" />
|
||||
@ -139,7 +139,7 @@
|
||||
{%- elif current_url -%}
|
||||
<meta property="og:url" content="{{ current_url }}" />
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
<meta property="og:site_name" content="{{ config.title }}">
|
||||
|
||||
{%- include "partials/content_security_policy.html" -%}
|
||||
|
@ -30,7 +30,7 @@
|
||||
<p>{{ open_quote ~ original ~ close_quote }}</p>
|
||||
{% if author %}<p> — {{ author }}{% endif %} <label for="toggle-{{ random_id }}" class="quote-label quote-label-translate">
|
||||
({{- macros_translate::translate(key="show_translation", default="Show translation", language_strings=language_strings) -}})
|
||||
</label></p>
|
||||
</label></p>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user