mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-07 12:37:31 -05:00
WIP
This commit is contained in:
@ -1,8 +1,12 @@
|
|||||||
|
{{/* TODO: should we use .PageInner */}}
|
||||||
|
{{ partial "embed-resource.html" (.Page.Resources.Get .Destination) }}
|
||||||
{{ with .Title }}
|
{{ with .Title }}
|
||||||
<figure>
|
{{ errorf "%q" . }}
|
||||||
{{ partial "embed-resource.html" ($.Page.Resources.Get $.Destination) }}
|
{{ end }}
|
||||||
<figcaption>{{ . }}</figcaption>
|
{{ with .Attributes }}
|
||||||
</figure>
|
{{/* FIXME: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_markup/render-image.html */}}
|
||||||
{{ else }}
|
{{ errorf "%q" . }}
|
||||||
{{ partial "embed-resource.html" (.Page.Resources.Get .Destination) }}
|
{{ end }}
|
||||||
|
{{ with .Text }}
|
||||||
|
{{ errorf "%q" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -1,8 +1,17 @@
|
|||||||
<p>
|
<figure>
|
||||||
<figure>
|
{{ with .Get "src" }}
|
||||||
|
{{ with $.Page.Resources.Get . }}
|
||||||
|
{{ partial "embed-resource.html" . }}
|
||||||
|
{{ with .Title }}
|
||||||
|
<figcaption>{{ . | markdownify }}</figcaption>
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ errorf "resource %q not found" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
{{ .Inner }}
|
{{ .Inner }}
|
||||||
{{ with .Get "caption" }}
|
{{ with .Get "caption" }}
|
||||||
<figcaption>{{ . }}</figcaption>
|
<figcaption>{{ . | markdownify }}</figcaption>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</figure>
|
{{ end }}
|
||||||
</p>
|
</figure>
|
||||||
|
9
layouts/_shortcodes/resource.html
Normal file
9
layouts/_shortcodes/resource.html
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{{ with .Get 0 }}
|
||||||
|
{{ with $.Page.Resources.Get . }}
|
||||||
|
{{ partial "embed-resource.html" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ errorf "resource %q not found" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ else }}
|
||||||
|
{{ errorf "resource name not provided as first parameter" }}
|
||||||
|
{{ end }}
|
Reference in New Issue
Block a user