From 03515624c3130f9133c5435c97ef9a25910562de Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Sun, 14 Jan 2024 13:02:56 +0800 Subject: [PATCH] feat(btn-link): add the text parameter, to use self-closing syntax (#110) For example, {{< bs/btn-link url="docs" text="Read the docs" />}} --- layouts/partials/bootstrap/btn-link.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/partials/bootstrap/btn-link.html b/layouts/partials/bootstrap/btn-link.html index f64b88e..fb431e6 100644 --- a/layouts/partials/bootstrap/btn-link.html +++ b/layouts/partials/bootstrap/btn-link.html @@ -3,12 +3,14 @@ {{- $size := "" }} {{- $outline := false }} {{- $class := "" }} +{{- $text := .Inner }} {{- if .IsNamedParams }} {{- with .Get "url" }}{{ $url = . }}{{ end }} {{- with .Get "style" }}{{ $style = . }}{{ end }} {{- with .Get "outline" }}{{ $outline = . }}{{ end }} {{- with .Get "size" }}{{ $size = . }}{{ end }} {{- with .Get "class" }}{{ $class = . }}{{ end }} + {{- with .Get "text" }}{{ $text = . }}{{ end }} {{- else }} {{- with .Get 0 }}{{ $url = . }}{{ end }} {{- with .Get 1 }}{{ $style = . }}{{ end }} @@ -24,5 +26,5 @@ class="{{ delimit $classes ` ` }}" href="{{ $uri.URL }}" {{ if $uri.External }}target="_blank" rel="external"{{ end }}> - {{- .Inner -}} + {{- $text -}}