Skip to content

Commit

Permalink
feat: add the ico shortcode (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang authored Mar 7, 2024
1 parent 2d23160 commit 3f66da3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
15 changes: 15 additions & 0 deletions layouts/partials/icons/shortcode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- $opts := newScratch }}
{{- if .IsNamedParams }}
{{- $opts.Set "vendor" (.Get "vendor") }}
{{- $opts.Set "name" (.Get "name") }}
{{- range slice "size" "width" "height" "color" "className" }}
{{- $field := . }}
{{- with $.Get . }}
{{- $opts.Set $field . }}
{{- end }}
{{- end }}
{{- else }}
{{- $opts.Set "vendor" (.Get 0) }}
{{- $opts.Set "name" (.Get 1) }}
{{- end }}
{{- partial "icons/icon" $opts.Values -}}
1 change: 1 addition & 0 deletions layouts/shortcodes/ico.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ partial "icons/shortcode" . }}
16 changes: 1 addition & 15 deletions layouts/shortcodes/icons/icon.html
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
{{- $opts := newScratch }}
{{- if .IsNamedParams }}
{{- $opts.Set "vendor" (.Get "vendor") }}
{{- $opts.Set "name" (.Get "name") }}
{{- range slice "size" "width" "height" "color" "className" }}
{{- $field := . }}
{{- with $.Get . }}
{{- $opts.Set $field . }}
{{- end }}
{{- end }}
{{- else }}
{{- $opts.Set "vendor" (.Get 0) }}
{{- $opts.Set "name" (.Get 1) }}
{{- end }}
{{- partial "icons/icon" $opts.Values -}}
{{ partial "icons/shortcode" . }}

0 comments on commit 3f66da3

Please sign in to comment.