Skip to content

Commit

Permalink
feat(dropdown-item): add the icon and iconVendor parameters (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang authored Sep 25, 2023
1 parent 006f3c1 commit ebdb7fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions layouts/partials/bootstrap/dropdown-item.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{{- $url := "" }}
{{- $text := "" }}
{{- $icon := "" }}
{{- $iconVendor := "bootstrap" }}
{{- if .IsNamedParams }}
{{- $text = .Get "text" }}
{{- $url = .Get "url" }}
{{- with .Get "icon" }}{{ $icon = . }}{{ end }}
{{- with .Get "iconVendor" }}{{ $iconVendor = . }}{{ end }}
{{- else }}
{{- $text = .Get 0 }}
{{- $url = .Get 1 }}
Expand All @@ -13,6 +17,14 @@
class="dropdown-item"
href="{{ $uri.URL }}"
{{ if $uri.External }}target="_blank" rel="external"{{ end }}>
{{- with $icon }}
{{ partial "icons/icon" (dict
"vendor" $iconVendor
"name" $icon
"height" "1em"
"width" "1em"
"className" "me-1") }}
{{- end }}
{{ $text }}
</a>
</li>

0 comments on commit ebdb7fe

Please sign in to comment.