Skip to content

Commit

Permalink
feat(lead): allow adding extra classes by the class parameter
Browse files Browse the repository at this point in the history
For example: {{< bs/lead class="mb-4" >}}.
  • Loading branch information
razonyang committed Jun 25, 2023
1 parent 79005dc commit c010a54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion layouts/partials/bootstrap/lead.html
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<p class="lead">{{ . }}</p>
{{- $class := "" }}
{{- if .IsNamedParams }}
{{- with .Get "class" }}{{ $class = . }}{{ end }}
{{- end }}
<p class="lead{{ with $class }} {{ . }}{{ end }}">{{ .Inner }}</p>
3 changes: 2 additions & 1 deletion layouts/shortcodes/bootstrap/lead.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{ partial "bootstrap/lead" .Inner }}
{{- if eq .Inner "" }}{{ end }}
{{ partial "bootstrap/lead" . }}
3 changes: 2 additions & 1 deletion layouts/shortcodes/bs/lead.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{ partial "bootstrap/lead" .Inner }}
{{- if eq .Inner "" }}{{ end }}
{{ partial "bootstrap/lead" . }}

0 comments on commit c010a54

Please sign in to comment.