mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-25 22:40:39 +00:00
fix: fix broken rendering of nested buttons (#266)
This commit is contained in:
parent
3b5c9a3a65
commit
3333560056
@ -1,25 +1,29 @@
|
|||||||
{{ $ref := "" }}
|
{{- $ref := "" }}
|
||||||
{{ $size := default "regular" (.Get "size" | lower) }}
|
{{- $class := "" }}
|
||||||
|
{{- $size := default "regular" (.Get "size" | lower) }}
|
||||||
|
|
||||||
{{ if not (in (slice "regular" "large") $size) }}
|
{{- if not (in (slice "regular" "large") $size) }}
|
||||||
{{ $size = "regular" }}
|
{{- $size = "regular" }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ with .Get "href" }}
|
{{- with .Get "href" }}
|
||||||
{{ $ref = . }}
|
{{- $ref = . }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
{{ with .Get "relref" }}
|
{{- with .Get "relref" }}
|
||||||
{{ $ref = relref $ . }}
|
{{- $ref = relref $ . }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- with .Get "class" }}
|
||||||
|
{{- $class = . }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
<span
|
<span class="gblog-button gblog-button--{{ $size }}{{ with $class }}{{ printf " %s" . }}{{ end }}">
|
||||||
class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }}
|
<a
|
||||||
{{ printf " %s" . }}
|
class="gblog-button__link"
|
||||||
{{ end }}"
|
{{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
||||||
>
|
>
|
||||||
<a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link">
|
|
||||||
{{ $.Inner }}
|
{{ $.Inner }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user