Skip to content

Commit

Permalink
feat(btn-link): add the text parameter, to use self-closing syntax (#110
Browse files Browse the repository at this point in the history
)

For example, {{< bs/btn-link url="docs" text="Read the docs" />}}
  • Loading branch information
razonyang committed Jan 14, 2024
1 parent 3707afa commit 0351562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/partials/bootstrap/btn-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -24,5 +26,5 @@
class="{{ delimit $classes ` ` }}"
href="{{ $uri.URL }}"
{{ if $uri.External }}target="_blank" rel="external"{{ end }}>
{{- .Inner -}}
{{- $text -}}
</a>

0 comments on commit 0351562

Please sign in to comment.