feat(content): support complete local resource references (#388)

This commit is contained in:
Dillon
2020-05-28 17:05:37 +08:00
committed by GitHub
parent 0c1f7d0ef8
commit aa48df5edd
93 changed files with 872 additions and 714 deletions

View File

@@ -1,10 +1,10 @@
{{- with .Title -}}
{{- if .Title -}}
<figure>
{{- dict "src" $.Destination "alt" $.Text "caption" . "linked" true | partial "plugin/image.html" -}}
{{- dict "Src" .Destination "Title" .Text "Caption" .Title "Linked" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
<figcaption class="image-caption">
{{- . | safeHTML -}}
{{- .Title | safeHTML -}}
</figcaption>
</figure>
{{- else -}}
{{- dict "src" .Destination "alt" .Text | partial "plugin/image.html" -}}
{{- dict "Src" .Destination "Title" .Text "Resources" .Page.Resources | partial "plugin/image.html" -}}
{{- end -}}

View File

@@ -1,2 +1,6 @@
{{- $options := dict "href" .Destination "title" .Title "content" .Text -}}
{{- $destination := .Destination -}}
{{- with dict "Path" $destination "Resources" .Page.Resources | partial "function/resource.html" -}}
{{- $destination = .RelPermalink -}}
{{- end -}}
{{- $options := dict "Destination" $destination "Title" .Title "Content" .Text -}}
{{- partial "plugin/link.html" $options -}}