fix: get_social_icon can not get local icon

This commit is contained in:
st1020 2024-08-01 21:49:55 +08:00
parent f6e399016a
commit 0b07957c59
2 changed files with 4 additions and 3 deletions

View file

@ -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 -%}