From 0b07957c594c7ec35b40a63628af514d2cd9455f Mon Sep 17 00:00:00 2001 From: st1020 Date: Thu, 1 Aug 2024 21:49:55 +0800 Subject: [PATCH] fix: get_social_icon can not get local icon --- templates/macros.html | 5 +++-- templates/partials/head.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/macros.html b/templates/macros.html index a533d1c..fb26db0 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -1,7 +1,8 @@ {%- macro get_social_icon(icon) -%} -{%- set meta = get_image_metadata(path="/static/icons/" ~ icon ~ ".svg", allow_missing=true) -%} +{%- set path = "icons/" ~ icon ~ ".svg" -%} +{%- set meta = get_image_metadata(path=path, allow_missing=true) -%} {%- if meta -%} -{{- get_url(path="icons/" ~ icon ~ ".svg") -}} +{{- get_url(path=path) -}} {%- else -%} {{- "https://cdn.jsdelivr.net/npm/simple-icons/icons/" ~ icon ~ ".svg" -}} {%- endif -%} diff --git a/templates/partials/head.html b/templates/partials/head.html index 2476f88..bd756e7 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -88,7 +88,7 @@ {% endif %} - + {% if page.extra.math | default(value=config.extra.math) %}