Skip to content

Commit

Permalink
fix(alter-link): add named parameters: text and url
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Mar 8, 2024
1 parent e612f1a commit 2dcba71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion layouts/partials/bootstrap/alert-link.html
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<a href="{{ .Get 1 }}" class="alert-link">{{ .Get 0 }}</a>
{{- $text := "" }}
{{- $url := "" }}
{{- if .IsNamedParams }}
{{- $text = .Get "text" }}
{{- $url = .Get "url" }}
{{- else }}
{{- $text = .Get 0 }}
{{- $url = .Get 1 }}
{{- end }}
<a href="{{ $url }}" class="alert-link">{{ $text }}</a>

0 comments on commit 2dcba71

Please sign in to comment.