chore(partials): refactor partials
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
|
||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||
{{- $content := replaceRE $REin $REout . -}}
|
||||
|
||||
{{- /* Ruby */ -}}
|
||||
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
|
||||
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Checkbox */ -}}
|
||||
{{- $REin = `<input disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-check-square fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Checkbox checked */ -}}
|
||||
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- /* Fix <sup>[return]</sup> */ -}}
|
||||
{{- $REin = `<sup>\[return\]</sup>` -}}
|
||||
{{- $REout = `↩︎` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
|
||||
{{- $content | safeHTML -}}
|
||||
@@ -1,3 +0,0 @@
|
||||
<a href="{{ index . `href` | safeURL }}" rel="me noopener noreffer" target="_blank" title="{{ index . `title` }}">
|
||||
{{- partial "function/icon.html" . -}}
|
||||
</a>
|
||||
@@ -1,23 +0,0 @@
|
||||
{{- $type := index . "type" | default "fa" -}}
|
||||
{{- $classList := split (index . "class") " " -}}
|
||||
{{- $scratch := index . "scratch" -}}
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- if eq $type "fa" -}}
|
||||
<i class="{{ delimit $classList ` ` }}"></i>
|
||||
{{- /* Fork Awesome */ -}}
|
||||
{{- else if eq $type "fo" -}}
|
||||
{{- $newClassList := slice -}}
|
||||
{{- range $classList -}}
|
||||
{{- if eq . "fa" -}}
|
||||
{{- $newClassList = $newClassList | append "fo" -}}
|
||||
{{- else -}}
|
||||
{{- $newClassList = $newClassList | append (replaceRE `^fa\-(.+)$` `fo-$1` .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<i class="{{ delimit $newClassList ` ` }}"></i>
|
||||
{{- $scratch.Set "forkawesome" true -}}
|
||||
{{- /* Others */ -}}
|
||||
{{- else -}}
|
||||
<i class="{{ delimit $classList ` ` }}"></i>
|
||||
{{- $scratch.Set "iconfont" true -}}
|
||||
{{- end -}}
|
||||
@@ -1,3 +0,0 @@
|
||||
{{- /* Lazyload */ -}}
|
||||
{{- $res := resources.Get "svg/loading.svg" | minify -}}
|
||||
<img src="{{ $res.RelPermalink | safeURL }}" data-sizes="auto" data-src="{{ index . `src` | safeURL }}" alt="{{ index . `alt` }}" title="{{ index . `title` | default (index . `alt`) }}" class="lazyload">
|
||||
Reference in New Issue
Block a user