mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-07-07 04:27: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 }}
|
||||
<figure>
|
||||
{{ partial "embed-resource.html" ($.Page.Resources.Get $.Destination) }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
</figure>
|
||||
{{ else }}
|
||||
{{ partial "embed-resource.html" (.Page.Resources.Get .Destination) }}
|
||||
{{ errorf "%q" . }}
|
||||
{{ end }}
|
||||
{{ with .Attributes }}
|
||||
{{/* FIXME: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_markup/render-image.html */}}
|
||||
{{ errorf "%q" . }}
|
||||
{{ end }}
|
||||
{{ with .Text }}
|
||||
{{ errorf "%q" . }}
|
||||
{{ 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 }}
|
||||
{{ with .Get "caption" }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
<figcaption>{{ . | markdownify }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
</p>
|
||||
{{ end }}
|
||||
</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