🐛 Fix: resources get match error for page images

This commit is contained in:
Cell
2024-08-29 14:35:10 +08:00
parent 349de54009
commit 5aaacec004
5 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -2,12 +2,12 @@
{{- if .Title | and .Text -}}
{{- $linked := ne $params.lightgallery false -}}
<figure>
{{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" $linked "Responsive" true | partial "plugin/image.html" -}}
{{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" $linked "Responsive" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
<figcaption class="image-caption">
{{- .Text | safeHTML -}}
</figcaption>
</figure>
{{- else -}}
{{- $linked := (eq $params.lightgallery "force") | or ($params.lightgallery | and (ne .Title "")) -}}
{{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Responsive" true | partial "plugin/image.html" -}}
{{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Responsive" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
{{- end -}}
-1
View File
@@ -7,7 +7,6 @@
{{- $pages = $pages | first .Config.limit -}}
{{- end -}}
{{- $length := $pages.Len -}}
{{- /* TODO 文章内图片链接、分类、标签等处理 */ -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.10-312b6363" -}}
{{- .Scratch.Set "version" "v0.3.10-5e1a7845" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+1
View File
@@ -1,3 +1,4 @@
{{- /* TODO refactor */ -}}
{{- $params := partial "function/params.html" -}}
{{- $class := .Class | default "" -}}
{{- $style := "" -}}
+1
View File
@@ -2,6 +2,7 @@
{{- $options = cond .IsNamedParams (.Get "alt") (.Get 1) | .Page.RenderString | dict "Alt" | merge $options -}}
{{- $caption := cond .IsNamedParams (.Get "caption") (.Get 2) | .Page.RenderString -}}
{{- $options = dict "Caption" $caption | merge $options -}}
{{- $options = dict "Resources" .Page.Resources | merge $options -}}
{{- if .IsNamedParams -}}
{{- $options = dict "Title" (.Get "title") | merge $options -}}