Add post: 暗黑能天使

This commit is contained in:
2022-05-10 01:13:38 +08:00
parent e0a0b033ae
commit 90b654e708
104 changed files with 3185 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
{{- $img := "" }}
{{- $validKeyword := false }}
{{- if .keyword }}
{{- if (.context.Resources.ByType "image").GetMatch .keyword }}
{{- $validKeyword = true}}
{{- end }}
{{- end }}
{{- if $validKeyword }}
{{- $img = ((.context.Resources.ByType "image").GetMatch .keyword).Permalink }}
{{- else if or (hasPrefix .url "//") (or (hasPrefix .url "http://") (hasPrefix .url "https://")) }}
{{- $img = (.url | absURL) }}
{{- else if resources.GetMatch .url }}
{{- $img = (resources.GetMatch .url).Permalink }}
{{- else if .url }}
{{- $img = (.url | absURL) }}
{{- end }}
{{- return $img }}