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