From e9bb74a45272feebbcb147883196179b599115e3 Mon Sep 17 00:00:00 2001 From: FarseaSH Date: Tue, 20 Aug 2024 21:16:56 +0800 Subject: [PATCH] BUGFIX correct url path of pics in the link block. --- {static => assets}/link-logos/bilibili.png | Bin .../link-logos/default_link_logo.png | Bin {static => assets}/link-logos/github.png | Bin {static => assets}/link-logos/wechat.png | Bin {static => assets}/link-logos/zhihu.svg | 0 layouts/partials/link-block.html | 21 +++++++++--------- 6 files changed, 11 insertions(+), 10 deletions(-) rename {static => assets}/link-logos/bilibili.png (100%) rename {static => assets}/link-logos/default_link_logo.png (100%) rename {static => assets}/link-logos/github.png (100%) rename {static => assets}/link-logos/wechat.png (100%) rename {static => assets}/link-logos/zhihu.svg (100%) diff --git a/static/link-logos/bilibili.png b/assets/link-logos/bilibili.png similarity index 100% rename from static/link-logos/bilibili.png rename to assets/link-logos/bilibili.png diff --git a/static/link-logos/default_link_logo.png b/assets/link-logos/default_link_logo.png similarity index 100% rename from static/link-logos/default_link_logo.png rename to assets/link-logos/default_link_logo.png diff --git a/static/link-logos/github.png b/assets/link-logos/github.png similarity index 100% rename from static/link-logos/github.png rename to assets/link-logos/github.png diff --git a/static/link-logos/wechat.png b/assets/link-logos/wechat.png similarity index 100% rename from static/link-logos/wechat.png rename to assets/link-logos/wechat.png diff --git a/static/link-logos/zhihu.svg b/assets/link-logos/zhihu.svg similarity index 100% rename from static/link-logos/zhihu.svg rename to assets/link-logos/zhihu.svg diff --git a/layouts/partials/link-block.html b/layouts/partials/link-block.html index 8179222..a6daeff 100644 --- a/layouts/partials/link-block.html +++ b/layouts/partials/link-block.html @@ -2,32 +2,32 @@ {{/* PART 1 default link */}} {{ $resource_type := "link" }} -{{ $logo_file := "default_link_logo.png" }} +{{ $logo_file := "link-logos/default_link_logo.png" }} {{ $index := .index | safeJS }} {{/* 1.1 Wechat articles */}} {{ if eq 1 (len (findRE `(https?://)?mp\.weixin\.qq\.com([-a-zA-Z0-9()@:%\+.~#?&/=_]*)` .a)) }} - {{ $logo_file = "wechat.png"}} + {{ $logo_file = "link-logos/wechat.png"}} {{ end }} {{/* 1.2 Bilibili webpage */}} {{ if eq 1 (len (findRE `(https?://)?(www\.)?bilibili\.com/video/([-a-zA-Z0-9()@:%\+.~#?&/=_]*)` .a)) }} - {{ $logo_file = "bilibili.png"}} + {{ $logo_file = "link-logos/bilibili.png"}} {{ end }} {{/* 1.3 github repo */}} {{ if eq 1 (len (findRE `(https?://)?(www\.)?github\.com([-a-zA-Z0-9()@:%\+.~#?&/=_]*)` .a)) }} - {{ $logo_file = "github.png"}} + {{ $logo_file = "link-logos/github.png"}} {{ end }} {{/* 1.4.1 zhihu answers */}} {{ if eq 1 (len (findRE `(https?://)?(www\.)?zhihu\.com/question/([0-9]*)/answer/[0-9]*` .a)) }} - {{ $logo_file = "zhihu.svg"}} + {{ $logo_file = "link-logos/zhihu.svg"}} {{ end }} {{/* 1.4.2 zhihu articles */}} {{ if eq 1 (len (findRE `(https?://)?zhuanlan\.zhihu\.com/p/([0-9]*)` .a)) }} - {{ $logo_file = "zhihu.svg"}} + {{ $logo_file = "link-logos/zhihu.svg"}} {{ end }} {{/* PART 2 other link type */}} @@ -65,12 +65,13 @@