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