From 59c7d4567380d1a9c80e96eb958fdbdd512ce006 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sun, 3 Nov 2024 20:08:36 +0300 Subject: новая жизнь блога MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/shortcodes/bilibili.html | 23 ++++++++++++++++++++++ .../layouts/shortcodes/gitlab.html | 4 ++++ .../hugo-theme-stack/layouts/shortcodes/quote.html | 15 ++++++++++++++ .../layouts/shortcodes/tencent.html | 10 ++++++++++ .../hugo-theme-stack/layouts/shortcodes/video.html | 14 +++++++++++++ .../layouts/shortcodes/youtube.html | 13 ++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/bilibili.html create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/gitlab.html create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/quote.html create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/tencent.html create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/video.html create mode 100644 themes/hugo-theme-stack/layouts/shortcodes/youtube.html (limited to 'themes/hugo-theme-stack/layouts/shortcodes') diff --git a/themes/hugo-theme-stack/layouts/shortcodes/bilibili.html b/themes/hugo-theme-stack/layouts/shortcodes/bilibili.html new file mode 100644 index 0000000..cb72e43 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/shortcodes/bilibili.html @@ -0,0 +1,23 @@ +{{ $vid := (.Get 0) }} +{{ $videopage := default 1 (.Get 1) }} +{{ $basicQuery := querify "page" $videopage "high_quality" 1 "as_wide" 1 }} +{{ $videoQuery := "" }} + +{{ if strings.HasPrefix (lower $vid) "av" }} + {{ $videoQuery = querify "aid" (strings.TrimPrefix "av" (lower $vid)) }} +{{ else if strings.HasPrefix (lower $vid) "bv" }} + {{ $videoQuery = querify "bvid" $vid }} +{{ else }} +
Bilibili 视频av号或BV号错误!请检查视频av号或BV号是否正确
+当前视频av或BV号:{{ $vid }},视频分P:{{ $videopage }}
+{{ end }} + ++\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/shortcodes/tencent.html b/themes/hugo-theme-stack/layouts/shortcodes/tencent.html new file mode 100644 index 0000000..463dec5 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/shortcodes/tencent.html @@ -0,0 +1,10 @@ +{{ $vid := .Get 0 }} +{{ .Inner | markdownify }}
+ {{- if or (.Get "author") (.Get "source") -}} + ― + {{- if .Get "author" -}} + + {{- .Get "author" -}}{{- if .Get "source" -}}, {{ end -}} + + {{- end -}} + {{- with .Get "url" -}}{{- end -}} + {{ .Get "source" }} + {{- if .Get "url" -}}{{- end -}} + + {{- end -}} +