mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 12:13:19 -06:00
Small shortcode cleanuo & use .IsNamedParams
This commit is contained in:
parent
e9266cdead
commit
8e3fb4038a
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
{{ with .Resources.GetMatch "feature" }}
|
{{ with .Resources.GetMatch "feature" }}
|
||||||
<div class="post-media">
|
<div class="post-media">
|
||||||
{{ partial "figure.html" (dict "src" . "border" true) }}
|
{{ partial "figure.html" (dict "src" .) }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
{{ with .Resources.GetMatch "feature" }}
|
{{ with .Resources.GetMatch "feature" }}
|
||||||
<div class="post-media">
|
<div class="post-media">
|
||||||
{{ partial "figure.html" (dict "src" . "border" true) }}
|
{{ partial "figure.html" (dict "src" .) }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
{{ with .Resources.GetMatch "feature" }}
|
{{ with .Resources.GetMatch "feature" }}
|
||||||
<div class="post-media">
|
<div class="post-media">
|
||||||
{{ partial "figure.html" (dict "src" . "border" true) }}
|
{{ partial "figure.html" (dict "src" .) }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -1 +1,5 @@
|
|||||||
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
|
{{ if .IsNamedParams }}
|
||||||
|
<abbr title="{{ .Get "title" }}">{{ .Inner }}</abbr>
|
||||||
|
{{ else }}
|
||||||
|
<abbr title="{{ .Get 0 }}">{{ .Inner }}</abbr>
|
||||||
|
{{ end }}
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
{{ $resource := $.Page.Resources.GetMatch (.Get "src") }}
|
{{ $resource := "" }}
|
||||||
|
{{ if .IsNamedParams }}
|
||||||
|
{{ $resource = $.Page.Resources.GetMatch (.Get "src") }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $resource = $.Page.Resources.GetMatch (.Get 0) }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $noborder := false }}
|
{{ $noborder := false }}
|
||||||
{{ if .Get "noborder" }}
|
{{ if .Get "noborder" }}
|
||||||
|
Loading…
Reference in New Issue
Block a user