From 79fd5ed6f2bd12b6847bd28d1310e73721329e7f Mon Sep 17 00:00:00 2001 From: FarseaSH Date: Sat, 28 Aug 2021 17:18:22 +0800 Subject: [PATCH] add zhihu link logo support --- layouts/partials/link-block.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/partials/link-block.html b/layouts/partials/link-block.html index 54e0fe5..ae86e25 100644 --- a/layouts/partials/link-block.html +++ b/layouts/partials/link-block.html @@ -12,7 +12,13 @@ {{ $logo_file = "github.png"}} {{ end }} - +{{ if eq 1 (len (findRE `(https?://)?(www\.)?zhihu\.com/question/([0-9]*)/answer/[0-9]*` .a)) }} + {{ $logo_file = "zhihu.svg"}} +{{ end }} + +{{ if eq 1 (len (findRE `(https?://)?zhuanlan\.zhihu\.com/p/([0-9]*)` .a)) }} + {{ $logo_file = "zhihu.svg"}} +{{ end }}