feat(content): support complete local resource references (#388)

This commit is contained in:
Dillon
2020-05-28 17:05:37 +08:00
committed by GitHub
parent 0c1f7d0ef8
commit aa48df5edd
93 changed files with 872 additions and 714 deletions

View File

@@ -1,13 +1,9 @@
{{- with .class -}}
{{- with .Class -}}
<i class="{{ . }}"></i>
{{- else -}}
{{- $src := .src -}}
{{- with .simpleicons -}}
{{- $prefix := "lib/simple-icons/icons" -}}
{{- with $.prefix -}}
{{- $prefix = . -}}
{{- end -}}
{{- $prefix = $prefix | strings.TrimSuffix "/" -}}
{{- $src := .Src -}}
{{- with .Simpleicons -}}
{{- $prefix := $.Prefix | default "lib/simple-icons/icons" | strings.TrimSuffix "/" -}}
{{- $src = printf "%v/%v.svg" $prefix . -}}
{{- end -}}
{{- if (urls.Parse $src).Host | not -}}