theme update and related improvements

This commit is contained in:
Salar Rahmanian 2025-06-14 09:15:14 -07:00
parent 57ddb18949
commit f080a22e16
17 changed files with 249 additions and 114 deletions

View file

@ -38,21 +38,34 @@ index_format = "elasticlunr_json"
[markdown]
highlight_code = true
bottom_footnotes = true
highlight_theme = "css"
smart_punctuation = true
external_links_class = "external"
[link_checker]
internal_level = "warn"
skip_prefixes = [
"https://www.vultr.com/",
]
skip_anchor_prefixes = [
"https://github.com/",
]
[extra]
peertube = "https://watch.softinio.com/c/softinio/videos"
twitter_meta = "SalarRahmanian" # for SEO: twitter:site and twitter:creator
fediverse_creator = { handle = "softinio", domain = "social.softinio.com"}
# google = "Your Google Site verification code."
# bing = "Your Bing Site verification code."
# Check out the documentation (or the comments below) to learn how to customise tabi:
# https://welpo.github.io/tabi/blog/mastering-tabi-settings/
# Use sans-serif font everywhere.
# By default, the serif font is only used in articles.
override_serif_with_sans = false
# Enable JavaScript theme toggler to allow users to switch between dark/light mode.
# If disabled, your site will only use the theme specified in the `default_theme` variable.
theme_switcher = true
@ -82,6 +95,21 @@ browser_theme_color = "#f56a00"
# You can load a stylesheet for a single post by adding it to the [extra] section of the post's front matter, following this same format.
stylesheets = []
# Remote repository for your Zola site.
# Used for `show_remote_changes` and `show_remote_source` (see below).
# Supports GitHub, GitLab, Gitea, and Codeberg.
remote_repository_url = "https://github.com/softinio/softinio.com"
# Set this to "auto" to try and auto-detect the platform based on the repository URL.
# Accepted values are "github", "gitlab", "gitea", and "codeberg".
remote_repository_git_platform = "github" # Defaults to "auto".
# Branch in the repo hosting the Zola site.
remote_repository_branch = "main" # Defaults to "main".
# Show a link to the commit history of updated posts, right next to the last updated date.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
show_remote_changes = true # Defaults to true.
# Show a link to the repository of the site, right next to the "Powered by Zola & tabi" text.
show_remote_source = true # Defaults to true.
# Sets the default canonical URL for all pages.
# Individual pages can override this in the [extra] section using canonical_url.
# Example: "$base_url/blog/post1" will get the canonical URL "https://example.com/blog/post1".
@ -92,22 +120,64 @@ stylesheets = []
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
copy_button = true
# Make code block names clickable if they are URLs (loads ~400 bytes of JavaScript).
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
code_block_name_links = false
# Show the reading time of a page.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
show_reading_time = true
# Adds backlinks to footnotes (loads ~500 bytes of JavaScripts).
# Show the author(s) of a page.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
footnote_backlinks = false
show_author = false
# Show the date of a page below its title.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
show_date = true
# Determines how dates are displayed in the post listing (e.g. front page or /blog). Options:
# "date" - Show only the original date of the post (default if unset).
# "updated" - Show only the last updated date of the post. If there is no last updated date, it shows the original date.
# "both" - Show both the original date and the last updated date.
post_listing_date = "date"
# Show "Jump to posts" link next to series' title.
# By default, the link appears automatically when a series description exceeds 2000 characters.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
# show_jump_to_posts = true
# Determines if indexes should be increasing (false) or decreasing (true) in series' posts list.
# It has only effect if the section uses indexes metadata (which is only the case for series as of now).
# Can be set at section levels, following the hierarchy: section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
post_listing_index_reversed = false # Defaults to false.
# Enable KaTeX for all posts.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
katex = false
# Enable Mermaid diagrams for all posts.
# Loads ~2.5MB of JavaScript.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
mermaid = false
# Serve Mermaid JavaScript locally. Version bundled with tabi.
# If set to false, it will load the latest version from JSDelivr.
# Only relevant when `mermaid = true`.
serve_local_mermaid = true
# Show links to previous and next articles at the bottom of posts.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
show_previous_next_article_links = false
# Invert order of the links to previous and next articles at the bottom of posts.
# By default, next articles are on the left side of the page and previous articles are on the right side.
# To reverse the order (next articles on the right and previous articles on the left), set it to true.
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
invert_previous_next_article_links = false
# Whether the navigation for previous/next article should match the full width of the site (same as the navigation bar at the top) or the article width.
# To match the navigation bar at the top, set it to true.
previous_next_article_links_full_width = true
@ -137,6 +207,17 @@ separator = "•"
# Compact: tag_name^n (superscript number)
compact_tags = false
# How tags are sorted in a Tags listing based on templates/tags/list.html.
# "name" for alphabetical, "frequency" for descending count of posts.
# Default: "name".
tag_sorting = "name"
# Show clickable tags above cards.html template (e.g. projects/) to filter the displayed items.
# Loads JS to filter. If JS is disabled, the buttons are links to the tag's page.
# Can be set at the section or config.toml level, following the hierarchy: section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
# Default: true
enable_cards_tag_filtering = true
# Invert the order of the site title and page title in the browser tab.
# Example: true => "Blog • ~/tabi", false => "~/tabi • Blog"
invert_title_order = false
@ -220,6 +301,10 @@ allowed_domains = [
{ directive = "frame-src", domains = ["player.vimeo.com", "https://www.youtube-nocookie.com", "https://watch.softinio.com", "https://notes.softinio.com/embed"] },
]
# Enable the CSP directives configured (or default).
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
enable_csp = true
# Custom subset of characters for the header.
# If set to true, the `static/custom_subset.css` file will be loaded first.
# This avoids a flashing text issue in Firefox.
@ -262,3 +347,45 @@ avatar = true
voting = true
page_author_hashes = "" # hash (or list of hashes) of the author.
lazy_loading = true # Loads when the comments are in the viewport (using the Intersection Observer API).
[extra.webmentions]
# To disable for a specific section or page, set webmentions = false in that page/section's front matter's [extra] section.
enable = false
# Specify the domain registered with webmention.io.
domain = ""
# The HTML ID for the object to fill in with the webmention data.
# Defaults to "webmentions"
# id = "webmentions"
# data configuration for the webmention.min.js script
# The base URL to use for this page. Defaults to window.location
# page_url =
# Additional URLs to check, separated by |s
# add_urls
# The maximum number of words to render in reply mentions.
# wordcount = 20
# The maximum number of mentions to retrieve. Defaults to 30.
# max_webmentions = 30
# By default, Webmentions render using the mf2 'url' element, which plays
# nicely with webmention bridges (such as brid.gy and telegraph)
# but allows certain spoofing attacks. If you would like to prevent
# spoofing, set this to a non-empty string (e.g. "true").
# prevent_spoofing
# What to order the responses by; defaults to 'published'. See
# https://github.com/aaronpk/webmention.io#api
# sort_by
# The order to sort the responses by; defaults to 'up' (i.e. oldest
# first). See https://github.com/aaronpk/webmention.io#api
# sort_dir
# If set to a non-empty string (e.g. "true"), will display comment-type responses
# (replies/mentions/etc.) as being part of the reactions
# (favorites/bookmarks/etc.) instead of in a separate comment list.
# comments_are_reactions = "true"

View file

@ -1,7 +1,6 @@
+++
title = "About"
template = "info-page.html"
path = "about"
[extra]
isso = false
@ -10,15 +9,14 @@ quick_navigation_buttons = true
I, [Salar Rahmanian](https://www.softinio.com), am a software engineer based in San Francisco Bay Area, California.
I have been developing software since the age of eleven. My current passion is functional programming, big data and distributed systems.
I have been developing software since the age of eleven. My current passion is functional programming, big data and distributed systems.
I am particularly enthusiastic about the Scala Programming language and NixOS and technologies such as Apache Nifi, Kafka, Spark and Akka / Pekko.
I am particularly enthusiastic about the Scala Programming language and NixOS and technologies such as Apache Nifi, Kafka, Spark and Akka / Pekko.
I contribute to open source projects when time allows.
I contribute to open source projects when time allows.
At work, I am currently working as a Data Engineer using spark and Databricks alot. For full details of my experience have a look at my [Resume](/resume).
As a long term Vim user and Neovim fan I also have started contributing plugins written in Lua for Neovim.
{{ full_width_image(src="SalarRahmanianFamily.jpg" alt="Salar Rahmanian's family photo") }}

View file

@ -1,6 +1,5 @@
+++
paginate_by = 4
path = "/archived"
title = "Archived"
sort_by = "date"
template = "section.html"

View file

@ -1,6 +1,5 @@
+++
paginate_by = 4
path = "/post"
title = "Articles"
sort_by = "date"
template = "section.html"

View file

@ -7,4 +7,5 @@ insert_anchor_links = "left"
[extra]
show_reading_time = false
quick_navigation_buttons = true
enable_cards_tag_filtering = true
+++

View file

@ -4,7 +4,7 @@ description = "A modern, type-safe Scala 3 wrapper library for DuckDB."
weight = 3
[taxonomies]
tags = ["Scala", "DuckDB", "Database"]
tags = ["Scala", "DuckDB", "Database", "Project"]
categories = ["Project"]
[extra]

View file

@ -4,7 +4,7 @@ description = "Fishee is a command-line interface (CLI) tool designed specifical
weight = 4
[taxonomies]
tags = ["Fish Shell", "Swift", "Terminal Tools"]
tags = ["Fish Shell", "Swift", "Terminal Tools", "Project"]
categories = ["Project"]
[extra]

View file

@ -4,7 +4,7 @@ description = "Lua Library and Neovim Plugin to search scaladex for scala packag
weight = 2
[taxonomies]
tags = ["Scala", "lua", "neovim"]
tags = ["Scala", "lua", "neovim", "Project"]
categories = ["Project"]
[extra]
@ -30,4 +30,3 @@ I then used it to create a [Neovim](https://neovim.io) plugin and [telescope.nvi
- Repository: <https://github.com/softinio/scaladex.nvim>
- README: <https://github.com/softinio/scaladex.nvim/blob/main/README.md>

View file

@ -4,7 +4,7 @@ description = "Scala bloggers directory and news feed using RSS"
weight = 1
[taxonomies]
tags = ["Scala", "Typelevel"]
tags = ["Scala", "Typelevel", "Project"]
categories = ["Project"]
[extra]

View file

@ -4,7 +4,7 @@ description = "A High performance, purely functional library for building, compo
weight = 5
[taxonomies]
tags = ["actor model", "concurrency", "distributed systems", "scala", "functional programming", "zio"]
tags = ["actor model", "concurrency", "distributed systems", "scala", "functional programming", "zio", "Project"]
categories = ["Project"]
[extra]

View file

@ -1,10 +1,8 @@
+++
title = "Subscribe"
template = "subscribe.html"
path = "subscribe"
[extra]
isso = false
quick_navigation_buttons = true
+++

View file

@ -1,6 +1,5 @@
+++
paginate_by = 5
path = "/til"
title = "Things I've Learned"
sort_by = "date"
template = "section.html"
@ -9,4 +8,3 @@ insert_anchor_links = "left"
[extra]
show_previous_next_article_links = true
+++

14
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1707956935,
"narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=",
"lastModified": 1749285348,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"type": "github"
},
"original": {
@ -25,17 +25,17 @@
"theme": {
"flake": false,
"locked": {
"lastModified": 1707564545,
"narHash": "sha256-m0XIxf3yKBKJwbSonAPDjw7DPHDi0BgRMhhD3FArWA4=",
"lastModified": 1749415357,
"narHash": "sha256-RAugqePumSe6nQZa7luSNNb1VGAyNjs/m9M6swWZBW0=",
"owner": "welpo",
"repo": "tabi",
"rev": "7e428c899b1bf595100e1448578f9cfc84ad3355",
"rev": "2e29782279d8154cb9c6f1df9a2401612ec77948",
"type": "github"
},
"original": {
"owner": "welpo",
"repo": "tabi",
"rev": "7e428c899b1bf595100e1448578f9cfc84ad3355",
"rev": "2e29782279d8154cb9c6f1df9a2401612ec77948",
"type": "github"
}
}

View file

@ -3,29 +3,44 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
theme = {
url = "github:welpo/tabi/7e428c899b1bf595100e1448578f9cfc84ad3355";
theme = {
url = "github:welpo/tabi/2e29782279d8154cb9c6f1df9a2401612ec77948";
flake = false;
};
};
outputs = { self, nixpkgs, theme }:
let
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs allSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
packages = forAllSystems (system:
outputs =
{
self,
nixpkgs,
theme,
}:
let
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
allSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs allSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in {
in
{
default = pkgs.stdenv.mkDerivation rec {
name = "softinio-${system}";
version = "0.1";
src = ./.;
nativeBuildInputs = with pkgs; [ nodePackages_latest.wrangler zola ];
nativeBuildInputs = with pkgs; [
nodePackages_latest.wrangler
zola
];
configurePhase = ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
@ -35,22 +50,29 @@
'';
installPhase = ''
mkdir -p $out
cp -r public/* $out
cp -r public/* $out
'';
};
});
}
);
devShells = forAllSystems (system:
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system};
in {
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [ nodePackages_latest.wrangler zola ];
buildInputs = with pkgs; [
nodePackages_latest.wrangler
zola
];
shellHook = ''
mkdir -p themes
ln -snf "${theme}" "themes/${themeName}"
'';
};
});
};
}
);
};
}

0
static/social_icons/peertube.svg Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

Before After
Before After

View file

@ -2,21 +2,23 @@
{%- set rel_attributes = macros_rel_attributes::rel_attributes() | trim -%}
{%- if config.markdown.external_links_target_blank -%}
{%- set blank_target = "target=_blank" -%}
{%- else -%}
{%- set blank_target = "" -%}
{%- endif -%}
{%- set blank_target = macros_target_attribute::target_attribute(new_tab=config.markdown.external_links_target_blank) -%}
{#- Feed icon -#}
{%- set feed_url = feed_utils::get_feed_url() -%}
{%- set should_show_feed = feed_utils::should_show_footer_feed_icon() == "true" -%}
{%- set should_show_footer_icons = should_show_feed or config.extra.socials or config.extra.email -%}
<footer>
<section>
<nav class="socials nav-navs">
{%- if config.extra.socials %}
{%- if should_show_footer_icons -%}
<ul>
{%- if config.generate_feed and config.extra.feed_icon -%}
{%- if should_show_feed -%}
<li>
<a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href={{ get_url(path=config.feed_filename, lang=lang, trailing_slash=false) | safe }}>
<img alt="feed" title="feed" src="{{ get_url(path='/social_icons/rss.svg') }}">
<a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href="{{ get_url(path=feed_url, lang=lang, trailing_slash=false) | safe }}">
<img loading="lazy" alt="feed" title="feed" src="{{ get_url(path='/social_icons/rss.svg') }}">
</a>
</li>
{%- endif -%}
@ -43,18 +45,20 @@
{%- else -%}
<a class="nav-links no-hover-padding social" href="mailto:{{ config.extra.email | safe }}">
{%- endif -%}
<img alt="email" title="email" src="{{ get_url(path='social_icons/email.svg') }}">
<img loading="lazy" alt="email" title="email" src="{{ get_url(path='social_icons/email.svg') }}">
</a>
</li>
{%- endif -%}
{% for social in config.extra.socials %}
<li>
<a class="nav-links no-hover-padding social" rel="{{ rel_attributes }} me" {{ blank_target }} href={{ social.url | safe }}>
<img alt={{ social.name }} title={{ social.name }} src="{{ get_url(path='social_icons/' ~ social.icon ~ '.svg') }}">
</a>
</li>
{% endfor %}
{%- if config.extra.socials %}
{% for social in config.extra.socials %}
<li>
<a class="nav-links no-hover-padding social" rel="{{ rel_attributes }} me" {{ blank_target }} href="{{ social.url | safe }}">
<img loading="lazy" alt="{{ social.name }}" title="{{ social.name }}" src="{{ get_url(path='social_icons/' ~ social.icon ~ '.svg') }}">
</a>
</li>
{% endfor %}
{% endif %}
</ul>
{% endif %}
</nav>
@ -108,4 +112,3 @@
{% include "partials/search_modal.html" %}
{%- endif -%}
</footer>

View file

@ -1,5 +1,10 @@
<head>
<meta charset="UTF-8">
{%- if macros_settings::evaluate_setting_priority(setting="enable_csp", page=page | default(value=""), section=section | default(value=""), default_global_value="true") == "true" -%}
{%- include "partials/content_security_policy.html" -%}
{%- endif -%}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="base" content="{{ config.base_url | safe }}">
@ -11,21 +16,39 @@
<link rel="icon" type="image/png" href="{{ get_url(path=config.extra.favicon) }}"/>
{% endif %}
{% if config.extra.favicon_emoji %}
<link rel=icon href="{{ get_url(path=config.extra.favicon_emoji, trailing_slash=false) | safe }}">
<link rel=icon href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50%" x="50%" dominant-baseline="central" text-anchor="middle" font-size="88">{{ config.extra.favicon_emoji }}</text></svg>'>
{% endif %}
{# Feed #}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }}" href="{{ get_url(path="atom.xml",
trailing_slash=false) }}">
{# Feeds #}
{% if config.generate_feeds | default(value=config.generate_feed) %}
{% if config.feed_filenames %}
{# Zola 0.19 and newer #}
{% for feed in config.feed_filenames %}
{% if feed == "atom.xml" %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }} - Atom Feed" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% elif feed == "rss.xml" %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title | safe }} - RSS Feed" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% else %}
<link rel="alternate" href="{{ get_url(path=feed, trailing_slash=false) | safe }}">
{% endif %}
{% endfor %}
{% else %}
{# Older Zola versions #}
{% set feed_url = config.feed_filename | default(value="atom.xml") %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title | safe }}" href="{{ get_url(path=feed_url, trailing_slash=false) | safe }}">
{% endif %}
{% endif %}
{# CSS #}
{# Load subset of glyphs for header. Avoids flashing issue in Firefox #}
{% if config.extra.custom_subset and config.extra.custom_subset == true %}
<link rel="stylesheet" href="{{ get_url(path="custom_subset.css" , cachebust=true) }}">
{% elif lang == 'en' %}
<link rel="stylesheet" href="{{ get_url(path="inter_subset_en.css", cachebust=true ) }}">
{% elif lang == 'es' %}
<link rel="stylesheet" href="{{ get_url(path="inter_subset_es.css", cachebust=true ) }}">
{% if config.extra.enable_subset %}
{% if config.extra.custom_subset == true %}
<link rel="stylesheet" href="{{ get_url(path="custom_subset.css" , cachebust=true) }}">
{% elif lang == 'en' %}
<link rel="stylesheet" href="{{ get_url(path="inter_subset_en.css", cachebust=true ) }}">
{% elif lang == 'es' %}
<link rel="stylesheet" href="{{ get_url(path="inter_subset_es.css", cachebust=true ) }}">
{% endif %}
{% endif %}
{# Define array of CSS files to load. main.css is always loaded. #}
@ -70,8 +93,8 @@
<meta name="description" content="{{ section.description }}" />
<meta property="og:description" content="{{ section.description }}" />
{%- elif page.summary %}
<meta name="description" content="{{ page.summary | striptags | safe | trim_end_matches(pat=".") }}" />
<meta property="og:description" content="{{ page.summary | striptags | safe | trim_end_matches(pat=".") }}" />
<meta name="description" content="{{ page.summary | striptags | trim_end_matches(pat=".") | safe }}" />
<meta property="og:description" content="{{ page.summary | striptags | trim_end_matches(pat=".") | safe }}" />
{%- else %}
<meta name="description" content="{{ config.description }}" />
<meta property="og:description" content="{{ config.description }}" />
@ -80,47 +103,13 @@
{% if is_404 %}
<meta name="robots" content="noindex, follow" />
{% else %}
<!-- <meta name="robots" content="index, nofollow" /> -->
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
{% endif %}
<meta property="og:title" content="{{ page.title | default(value=config.title) | safe }}" />
<meta property="og:type" content="article" />
{# Image for social media sharing #}
{%- set social_media_card = macros_settings::evaluate_setting_priority(setting="social_media_card", page=page | default(value=""), section=section | default(value=""), default_global_value="") -%}
{% if social_media_card %}
{# 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 %}
{% else %}
{# If the relative path didn't work, try fetching metadata for the absolute path #}
{% set meta = get_image_metadata(path=social_media_card, allow_missing=true) %}
{% if meta %}
{% set final_path = social_media_card %}
{% else %}
{# Throw an error if the image doesn't exist at either path #}
{{ 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 }}" />
<meta property="og:image:height" content="{{ meta.height }}" />
<meta name="twitter:image" content="{{ get_url(path=final_path, cachebust=true) }}" />
<meta name="twitter:card" content="summary_large_image" />
{% endif %}
{%- include "partials/social_media_images.html" -%}
{# Add og:locale and hreflang tags for multilingual sites #}
{%- if config.languages | length > 0 and current_url %}
@ -149,8 +138,6 @@
<meta property="og:site_name" content="{{ config.title }}">
{%- include "partials/content_security_policy.html" -%}
{%- if config.extra.theme_switcher and config.extra.theme_switcher == true -%}
{# If JavaScript is disabled, hide the button. #}
<noscript><link rel="stylesheet" href="{{ get_url(path='no_js.css') | safe }}"/></noscript>
@ -162,6 +149,11 @@
{%- include "partials/analytics.html" -%}
{%- endif -%}
{# Socials #}
{%- if config.extra.fediverse_creator -%}
<meta name="fediverse:creator" content="@{{ config.extra.fediverse_creator["handle"] }}@{{ config.extra.fediverse_creator["domain"]}}" />
{%- endif -%}
{# Search #}
{%- if config.build_search_index -%}
{%- if config.search.index_format -%}
@ -191,4 +183,3 @@
{%- include "partials/custom_header.html" -%}
</head>