mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-21 20:30:39 +00:00
fix: fix broken rendering of nested buttons (#443)
This commit is contained in:
parent
09bb615cfc
commit
580ea885e3
@ -1,26 +1,26 @@
|
||||
{{ $ref := "" }}
|
||||
{{ $target := "" }}
|
||||
{{ $size := default "regular" (.Get "size" | lower) }}
|
||||
{{- $ref := "" }}
|
||||
{{- $target := "" }}
|
||||
{{- $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 = . }}
|
||||
{{ $target = "_blank" }}
|
||||
{{ end }}
|
||||
{{- with .Get "href" }}
|
||||
{{- $ref = . }}
|
||||
{{- $target = "_blank" }}
|
||||
{{- end }}
|
||||
|
||||
{{ with .Get "relref" }}
|
||||
{{ $ref = relref $ . }}
|
||||
{{ end }}
|
||||
{{- with .Get "relref" }}
|
||||
{{- $ref = relref $ . }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
<span class="gdoc-button gdoc-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}">
|
||||
<a
|
||||
{{ with $ref }}href="{{ . }}"{{ end }}
|
||||
{{ with $target }}target="{{ . }}"{{ end }}
|
||||
class="gdoc-button__link"
|
||||
{{- with $ref }}{{ printf " href=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
||||
{{- with $target }}{{ printf " target=\"%s\"" . | safeHTMLAttr }}{{ end }}
|
||||
>
|
||||
{{ $.Inner }}
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user