From 4e4ad45acdfbbf513ee730c58f8aab4fac49be88 Mon Sep 17 00:00:00 2001 From: zloylinux Date: Tue, 8 Apr 2025 19:53:34 +0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(indieweb):=20add=20hidden=20h-?= =?UTF-8?q?card?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 24 ++++++++ themes/tabi/templates/partials/hcard.html | 75 +++++++++++++++++++++++ themes/tabi/templates/section.html | 5 +- themes/tabi/theme.toml | 24 ++++++++ 4 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 themes/tabi/templates/partials/hcard.html diff --git a/config.toml b/config.toml index f8bd194..047396c 100644 --- a/config.toml +++ b/config.toml @@ -277,3 +277,27 @@ 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). + +# h-card configuration +# Will identify you on the indieweb (see https://microformats.org/wiki/h-card) +[extra.hcard] +# Enable home page h-card. +enable = true +# Add your email to the card if extra.email is set and not encoded. +with_mail = true +# Add your social links ('socials' config) to the card. +with_social_links = true +# Homepage url. Defaults to the value of 'base_url'. +homepage = "https://zlinux.ru" +avatar = "img/avator.webp" +# Display name, default to the value of 'author'. +full_name = "Zloy Linux" +# Small bio, as shown on social media profiles. +biography = "Linux Man" +# +# You can add any property from https://microformats.org/wiki/h-card#Properties +# Make sure to replace all '-' characters by '_' +# Examples: +p_nickname = "zloy_linux" +# p_locality = "Bordeaux" +p_country_name = "Russia" diff --git a/themes/tabi/templates/partials/hcard.html b/themes/tabi/templates/partials/hcard.html new file mode 100644 index 0000000..91c023b --- /dev/null +++ b/themes/tabi/templates/partials/hcard.html @@ -0,0 +1,75 @@ +{%- set hcard = config.extra.hcard -%} + +{% set full_name = config.author %} +{% if hcard.full_name %} + {% set full_name = hcard.full_name %} +{% endif %} + +{%- set homepage = config.base_url -%} +{% if hcard.homepage %} + {%- set homepage = hcard.homepage -%} +{% endif %} + +{% if hcard.enable %} + +{% endif %} diff --git a/themes/tabi/templates/section.html b/themes/tabi/templates/section.html index 77b6c73..9065219 100644 --- a/themes/tabi/templates/section.html +++ b/themes/tabi/templates/section.html @@ -24,7 +24,10 @@ {%- endif -%}
-{%- if section.extra.header %} +{%- if config.extra.hcard %} + {%- include "partials/hcard.html" -%} +{% endif -%} + {%- if section.extra.header %} {%- include "partials/home_banner.html" -%} {%- elif section.content -%}
diff --git a/themes/tabi/theme.toml b/themes/tabi/theme.toml index db3384e..3dcb701 100644 --- a/themes/tabi/theme.toml +++ b/themes/tabi/theme.toml @@ -375,3 +375,27 @@ custom_subset = 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). + +# h-card configuration +# Will identify you on the indieweb (see https://microformats.org/wiki/h-card) +[extra.hcard] +# Enable home page h-card. +enable = true +# Add your email to the card if extra.email is set and not encoded. +# with_mail = true +# Add your social links ('socials' config) to the card. +with_social_links = true +# Homepage url. Defaults to the value of 'base_url'. +# homepage = "https://myhomepage.net" +# avatar = "img/profile.webp" +# Display name, default to the value of 'author'. +# full_name = "John Doe" +# Small bio, as shown on social media profiles. +# biography = "Fond of the indieweb" +# +# You can add any property from https://microformats.org/wiki/h-card#Properties +# Make sure to replace all '-' characters by '_' +# Examples: +# p_nickname = "nickname" +# p_locality = "Bordeaux" +# p_country_name = "France"