mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-06 11:53:31 +08:00
fix(markdown image): be able to insert external images
This commit is contained in:
parent
35ce4cb0ce
commit
d36a7c0950
@ -1,4 +1,5 @@
|
|||||||
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
|
{{- $image := .Page.Resources.GetMatch (printf "%s" (.Destination | safeURL)) -}}
|
||||||
|
{{- if $image -}}
|
||||||
{{- $small := $image.Resize "480x" -}}
|
{{- $small := $image.Resize "480x" -}}
|
||||||
{{- $big := $image.Resize "1024x" -}}
|
{{- $big := $image.Resize "1024x" -}}
|
||||||
{{- $alt := .PlainText | safeHTML -}}
|
{{- $alt := .PlainText | safeHTML -}}
|
||||||
@ -16,3 +17,6 @@
|
|||||||
<figcaption>{{ . | markdownify }}</figcaption>
|
<figcaption>{{ . | markdownify }}</figcaption>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
|
{{- else -}}
|
||||||
|
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}"{{ end }} />
|
||||||
|
{{- end -}}
|
Loading…
Reference in New Issue
Block a user