Skip to content

Commit

Permalink
🐛 Fix: resources get match error for page images
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Aug 29, 2024
1 parent 349de54 commit 5aaacec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 0 additions & 1 deletion layouts/partials/feed/rss.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/init/index.html
Original file line number Diff line number Diff line change
@@ -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" . -}}
Expand Down
1 change: 1 addition & 0 deletions layouts/partials/plugin/image.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- /* TODO refactor */ -}}
{{- $params := partial "function/params.html" -}}
{{- $class := .Class | default "" -}}
{{- $style := "" -}}
Expand Down
1 change: 1 addition & 0 deletions layouts/shortcodes/image.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down

0 comments on commit 5aaacec

Please sign in to comment.