Skip to content

Commit

Permalink
fix: get_social_icon can not get local icon
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Aug 1, 2024
1 parent f6e3990 commit 0b07957
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions templates/macros.html
Original file line number Diff line number Diff line change
@@ -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 -%}
Expand Down
2 changes: 1 addition & 1 deletion templates/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
{% endif %}

<!-- Dark Icon -->
<link rel="preload" as="image" href="{{ get_url(path=`icons/` ~ `theme.svg`) }}" />
<link rel="preload" as="image" href="{{ get_url(path=`icons/theme.svg`) }}" />

<!-- Math -->
{% if page.extra.math | default(value=config.extra.math) %}
Expand Down

0 comments on commit 0b07957

Please sign in to comment.