feature(doc): complete all Chinese and English documents and fix many bugs
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<figure>
|
||||
{{- $lightgallery := ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "title" .Title "description" .Text "lightgallery" $lightgallery "scratch" (.Page.Scratch.Get "scratch")) -}}
|
||||
{{- with (.Title | default .Text) -}}
|
||||
{{- with .Title -}}
|
||||
<figure>
|
||||
{{- partial "plugin/image.html" (dict "src" $.Destination "title" $.Title "description" $.Text "lightgallery" true "scratch" ($.Page.Scratch.Get "scratch")) -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
{{- end -}}
|
||||
</figure>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- partial "plugin/image.html" (dict "src" .Destination "title" .Title "description" .Text "lightgallery" false "scratch" (.Page.Scratch.Get "scratch")) -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{{- define "title" }}
|
||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title -}}
|
||||
{{- T .Section | default .Section | printf (T "allSome") }} | {{ .Site.Title -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
|
||||
{{- T .Section | default .Section | humanize | printf (T "allSome") -}}
|
||||
</h2>
|
||||
|
||||
{{- /* Paginate */ -}}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<span class="post-author">
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
|
||||
@@ -28,16 +28,14 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lazysizes */ -}}
|
||||
{{- if $scratch.Get "lazysizes" -}}
|
||||
{{- with $CDN.lazysizesJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "lib/lazysizes/lazysizes.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
{{- with $CDN.lazysizesJS -}}
|
||||
{{- slice . | $scratch.Add "scriptCDN" -}}
|
||||
{{- else -}}
|
||||
{{- slice "lib/lazysizes/lazysizes.min.js" | $scratch.Add "scriptLocal" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lightgallery.js */ -}}
|
||||
{{- if $scratch.Get "lightgallery" -}}
|
||||
{{- if ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- with $CDN.lightgalleryCSS -}}
|
||||
{{- slice . | $scratch.Add "linkCDN" -}}
|
||||
{{- else -}}
|
||||
@@ -139,7 +137,8 @@
|
||||
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
|
||||
{ left: '{{ $math.inlineLeftDelimiter }}', right: '{{ $math.inlineRightDelimiter }}', display: false },
|
||||
{{- end -}}
|
||||
]
|
||||
],
|
||||
strict: false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
{{- with $valine.pageSize -}}
|
||||
pageSize: {{ . | safeJS }},
|
||||
{{- end -}}
|
||||
lang: '{{ T "valineLang" }}',
|
||||
lang: '{{ $valine.lang | default "en" }}',
|
||||
{{- if $valine.visitor -}}
|
||||
visitor: true,
|
||||
{{- end -}}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="copyright">
|
||||
{{- /* Hugo and LoveIt */ -}}
|
||||
<div class="copyright-line">
|
||||
{{- printf (T "powered") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>` | safeHTML }} | {{ T "theme" }}<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
||||
{{- printf (T "poweredBySome") `<a href="https://gohugo.io/" target="_blank" rel="external nofollow noopener noreffer">Hugo</a>` | safeHTML }} | {{ T "theme" }} - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="external nofollow noopener noreffer">LoveIt<i class="far fa-heart fa-fw"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="copyright-line">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{- /* Checkbox unchecked */ -}}
|
||||
{{- $REin := `<input disabled="" type="checkbox">` -}}
|
||||
{{- $REout := `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- $content := replaceRE $REin $REout . -}}
|
||||
{{- $old := `<input disabled="" type="checkbox">` -}}
|
||||
{{- $new := `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- $content := replace . $old $new -}}
|
||||
|
||||
{{- /* Checkbox checked */ -}}
|
||||
{{- $REin = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $REout = `<i class="far fa-check-square fa-fw"></i>` -}}
|
||||
{{- return replaceRE $REin $REout $content -}}
|
||||
{{- $old = `<input checked="" disabled="" type="checkbox">` -}}
|
||||
{{- $new = `<i class="far fa-check-square fa-fw"></i>` -}}
|
||||
{{- return replace $content $old $new -}}
|
||||
|
||||
5
layouts/partials/function/escape.html
Normal file
5
layouts/partials/function/escape.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- /* Escape character */ -}}
|
||||
{{- /* {?X} -> X */ -}}
|
||||
{{- $REin := `\{\?(.)\}` -}}
|
||||
{{- $REout := `$1` -}}
|
||||
{{- return replaceRE $REin $REout . -}}
|
||||
@@ -2,5 +2,7 @@
|
||||
{{- /* Content -> unique ID */ -}}
|
||||
{{- /* shuffle md5 as id */ -}}
|
||||
{{- $id := delimit (split (md5 now.Unix) "" | shuffle | first 6) "" | printf "id-%s" -}}
|
||||
{{- .scratch.SetInMap "contentMap" $id .content -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .SetInMap "contentMap" $id $.content -}}
|
||||
{{- end -}}
|
||||
{{- return $id -}}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{- end -}}
|
||||
{{- if .Site.IsMultiLingual -}}
|
||||
|
|
||||
<span class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-item">
|
||||
<i class="fas fa-language fa-fw"></i>
|
||||
<select class="select-language" onchange="location = this.value;">
|
||||
{{- range .Page.AllTranslations -}}
|
||||
@@ -30,7 +30,7 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</select>
|
||||
</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">
|
||||
<i class="fas fa-adjust fa-rotate-180 fa-fw"></i>
|
||||
@@ -60,7 +60,7 @@
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- if .Site.IsMultiLingual -}}
|
||||
<span class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-item">
|
||||
<i class="fas fa-language fa-fw"></i>
|
||||
<select class="select-language" onchange="location = this.value;">
|
||||
{{- range .Page.AllTranslations -}}
|
||||
@@ -76,7 +76,7 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</select>
|
||||
</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">
|
||||
<i class="fas fa-adjust fa-rotate-180 fa-fw"></i>
|
||||
|
||||
@@ -11,11 +11,15 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $classList = $newClassList -}}
|
||||
{{- .scratch.Set "forkawesome" true -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .Set "forkawesome" true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* default is Font Awesome */ -}}
|
||||
{{- /* Others */ -}}
|
||||
{{- else if ne $type "fa" -}}
|
||||
{{- .scratch.Set "iconfont" true -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .Set "iconfont" true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<i class="{{ delimit $classList ` ` }}"></i>
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
data-src="{{ .src | safeURL }}"
|
||||
alt="{{ .title | default .description }}" />
|
||||
</a>
|
||||
{{- .scratch.Set "lightgallery" true -}}
|
||||
{{- with .scratch -}}
|
||||
{{- .Set "lightgallery" true -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<img
|
||||
class="lazyload"
|
||||
@@ -26,4 +28,3 @@
|
||||
alt="{{ .title | default .description }}"
|
||||
title="{{ .description }}" />
|
||||
{{- end -}}
|
||||
{{- .scratch.Set "lazysizes" true -}}
|
||||
|
||||
@@ -1,200 +1,200 @@
|
||||
{{- $scratch := .Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if ne .Site.Params.share.enable false | and (ne .Params.share false) -}}
|
||||
{{- if ne .Site.Params.share.enable false | and (ne .Params.share.enable false) -}}
|
||||
{{- $scratch.Set "share" true -}}
|
||||
|
||||
{{- /* 001: Twitter */ -}}
|
||||
{{- if .Params.Share.Twitter | default .Site.Params.Share.Twitter | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Twitter" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Twitter" data-sharer="twitter" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.tags }} data-hashtags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-twitter fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 002: Facebook */ -}}
|
||||
{{- if .Params.Share.Facebook | default .Site.Params.Share.Facebook | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-facebook-square fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 003: Linkedin */ -}}
|
||||
{{- if .Params.Share.Linkedin | default .Site.Params.Share.Linkedin | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-linkedin fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 004: WhatsApp */ -}}
|
||||
{{- if .Params.Share.Whatsapp | default .Site.Params.Share.Whatsapp | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-whatsapp fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 005: Viber */ -}}
|
||||
{{- if .Params.Share.Viber | default .Site.Params.Share.Viber | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-viber fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 006: Pinterest */ -}}
|
||||
{{- if .Params.Share.Pinterest | default .Site.Params.Share.Pinterest | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pinterest" data-sharer="pinterest" data-url="{{ .Permalink }}"{{ with .Description }} data-description="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-pinterest fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 007: Tumblr */ -}}
|
||||
{{- if .Params.Share.Tumblr | default .Site.Params.Share.Tumblr | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Tumblr" data-sharer="tumblr" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.tags }} data-tags="{{ delimit . `,` }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-tumblr fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 008: Hacker News */ -}}
|
||||
{{- if .Params.Share.Hackernews | default .Site.Params.Share.Hackernews | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-hacker-news fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 009: Reddit */ -}}
|
||||
{{- if .Params.Share.Reddit | default .Site.Params.Share.Reddit | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-reddit fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 010: VK */ -}}
|
||||
{{- if .Params.Share.VK | default .Site.Params.Share.VK | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} VK" data-sharer="vk" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Description }} data-caption="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-vk fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 011: Buffer */ -}}
|
||||
{{- if .Params.Share.Buffer | default .Site.Params.Share.Buffer | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Buffer" data-sharer="buffer" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Site.Params.Social.Twitter }} data-via="{{ . }}"{{ end }}{{ with .Params.featuredImage }} data-picture="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-buffer fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 012: Xing */ -}}
|
||||
{{- if .Params.Share.Xing | default .Site.Params.Share.Xing | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-xing fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 013: Line */ -}}
|
||||
{{- if .Params.Share.Line | default .Site.Params.Share.Line | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-line fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 014: Instapaper */ -}}
|
||||
{{- if .Params.Share.Instapaper | default .Site.Params.Share.Instapaper | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-instapaper-fill" "type" "other" "scratch" $scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 015: Pocket */ -}}
|
||||
{{- if .Params.Share.Pocket | default .Site.Params.Share.Pocket | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-get-pocket fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 016: Digg */ -}}
|
||||
{{- if .Params.Share.Digg | default .Site.Params.Share.Digg | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-digg fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 017: StumbleUpon */ -}}
|
||||
{{- if .Params.Share.Stumbleupon | default .Site.Params.Share.Stumbleupon | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-stumbleupon fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 018: Flipboard */ -}}
|
||||
{{- if .Params.Share.Flipboard | default .Site.Params.Share.Flipboard | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-flipboard fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 019: 微博 */ -}}
|
||||
{{- if .Params.Share.Weibo | default .Site.Params.Share.Weibo | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 微博" data-sharer="weibo" data-url="{{ .Permalink }}" data-title="{{ .Title }}"{{ with .Params.featuredImage }} data-image="{{ . }}"{{ end }}{{ with .Site.Params.Social.Weibo }} data-ralateuid="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-weibo fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 020: 人人 */ -}}
|
||||
{{- if .Params.Share.Renren | default .Site.Params.Share.Renren | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-renren fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 021: Myspace */ -}}
|
||||
{{- if .Params.Share.Myspace | default .Site.Params.Share.Myspace | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-myspace-fill" "type" "other" "scratch" $scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 022: Blogger */ -}}
|
||||
{{- if .Params.Share.Blogger | default .Site.Params.Share.Blogger | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-blogger fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 023: 百度 */ -}}
|
||||
{{- if .Params.Share.Baidu | default .Site.Params.Share.Baidu | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "loveit it-baidu-fill" "type" "other" "scratch" $scratch) -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 024: OK.RU */ -}}
|
||||
{{- if .Params.Share.Odnoklassniki | default .Site.Params.Share.Odnoklassniki | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-odnoklassniki fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 025: Evernote */ -}}
|
||||
{{- if .Params.Share.Evernote | default .Site.Params.Share.Evernote | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-evernote fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 026: Skype */ -}}
|
||||
{{- if .Params.Share.Skype | default .Site.Params.Share.Skype | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-skype fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 027: Trello */ -}}
|
||||
{{- if .Params.Share.Trello | default .Site.Params.Share.Trello | eq true -}}
|
||||
<a href="javascript:void(0);" title="{{ T `share` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-trello fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 028: Mix */ -}}
|
||||
{{- if .Params.Share.Mix | default .Site.Params.Share.Mix | eq true -}}
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T `share` }} Mix">
|
||||
<a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T `shareOn` }} Mix">
|
||||
{{- partial "plugin/icon.html" (dict "class" "fab fa-mix fa-fw") -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
@@ -6,4 +6,6 @@
|
||||
|
||||
{{- $content = partial "function/checkbox.html" $content -}}
|
||||
|
||||
{{- $content = partial "function/escape.html" $content -}}
|
||||
|
||||
{{- $content | safeHTML -}}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-md">
|
||||
{{- if .Site.Params.page.linkToMarkdown -}}
|
||||
{{- if ne .Site.Params.page.linkToMarkdown false | and (ne .Params.linkToMarkdown false) -}}
|
||||
{{- with .OutputFormats.Get "markdown" -}}
|
||||
<span>
|
||||
<a class="link-to-markdown" href="{{ .Permalink }}" target="_blank">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{- /* Meta */ -}}
|
||||
<div class="post-meta">
|
||||
<div class="post-meta-line">
|
||||
{{- $author := .Params.author | default .Site.Author.name -}}
|
||||
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
|
||||
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
|
||||
<span class="post-author">
|
||||
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank">
|
||||
@@ -54,7 +54,7 @@
|
||||
{{- /* TOC */ -}}
|
||||
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
|
||||
<div class="toc" id="toc-auto">
|
||||
<h2 class="toc-title">{{ T "toc" }}</h2>
|
||||
<h2 class="toc-title">{{ T "contents" }}</h2>
|
||||
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
|
||||
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
|
||||
</div>
|
||||
@@ -62,7 +62,7 @@
|
||||
<details>
|
||||
<summary>
|
||||
<div class="toc-title">
|
||||
<span>{{ T "toc" }}</span>
|
||||
<span>{{ T "contents" }}</span>
|
||||
<span><i class="details icon fas fa-angle-down"></i></span>
|
||||
</div>
|
||||
</summary>
|
||||
|
||||
@@ -16,45 +16,37 @@
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
{{- $type := .Get "type" | default "note" -}}
|
||||
{{- if eq (.Get "details") "true" -}}
|
||||
{{- if .Get "details" -}}
|
||||
<details class="admonition {{ $type }}">
|
||||
{{- with .Get "title" -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
{{- end -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | default (T $type) }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
<div class="admonition-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</details>
|
||||
{{- else -}}
|
||||
<div class="admonition {{ $type }}">
|
||||
{{- with .Get "title" -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
|
||||
{{- end -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | default (T $type) }}</p>
|
||||
<div class="admonition-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- if eq (.Get 2) "true" -}}
|
||||
{{- $type := .Get 0 | default "note" -}}
|
||||
{{- if .Get 2 -}}
|
||||
<details class="admonition {{ $type }}">
|
||||
{{- with .Get 1 -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
{{- end -}}
|
||||
<summary class="admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default (T $type) }}<i class="details {{ $iconDetails }}"></i>
|
||||
</summary>
|
||||
<div class="admonition-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</details>
|
||||
{{- else -}}
|
||||
<div class="admonition {{ $type }}">
|
||||
{{- with .Get 1 -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ . }}</p>
|
||||
{{- end -}}
|
||||
<p class="admonition-title"><i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default (T $type) }}</p>
|
||||
<div class="admonition-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="bilibili">
|
||||
{{- if .IsNamedParams -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get "aid" }}&cid={{ .Get "cid" }}&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get `av` }}&page={{ .Get `p` | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- else -}}
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get 0 }}&cid={{ .Get 1 }}&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
<iframe src="//player.bilibili.com/player.html?aid={{ .Get 0 }}&page={{ .Get 1 | default 1 }}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
{{- $options := .Get "src" | dict "src" -}}
|
||||
{{- $options = .Get "src_s" | dict "src_s" | merge $options -}}
|
||||
{{- $options = .Get "src_l" | dict "src_l" | merge $options -}}
|
||||
{{- $options = .Get "title" | dict "title" | merge $options -}}
|
||||
{{- $options = .Get "description" | dict "description" | merge $options -}}
|
||||
{{- $title := .Get "title" | $.Page.RenderString -}}
|
||||
{{- $options = $title | dict "title" | merge $options -}}
|
||||
{{- $description := .Get "description" | $.Page.RenderString -}}
|
||||
{{- $options = $description | dict "description" | merge $options -}}
|
||||
{{- $lightgallery := ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}}
|
||||
{{- $options = $lightgallery | dict "lightgallery" | merge $options -}}
|
||||
{{- $options = .Page.Scratch.Get "scratch" | dict "scratch" | merge $options -}}
|
||||
{{- partial "plugin/image.html" $options -}}
|
||||
{{- with (.Get "title" | default .Get "description") -}}
|
||||
{{- with $title | default $description -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
|
||||
@@ -1,14 +1,42 @@
|
||||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- if .IsNamedParams -}}
|
||||
<meting-js server="{{ .Get "server" }}" type="{{ .Get "type" }}" id="{{ .Get "id" }}" theme="#A9A9B3"
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mini" }} mini="{{ . }}"{{ end -}}
|
||||
{{- with .Get "fixed" }} fixed="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-folded" }} list-folded="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-max-height" }} list-max-height="{{ . }}"{{ end -}}
|
||||
></meting-js>
|
||||
{{- if .Get "url" -}}
|
||||
<meting-js url="{{ .Get `url` }}" name="{{ .Get `name` }}" artist="{{ .Get `artist` }}" cover="{{ .Get `cover` }}" theme="{{ .Get `theme` | default `#a9a9b3` }}"
|
||||
{{- with .Get "fixed" }} fixed="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mini" }} mini="{{ . }}"{{ end -}}
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
{{- with .Get "volume" }} volume="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mutex" }} mutex="{{ . }}"{{ end -}}
|
||||
></meting-js>
|
||||
{{- else if .Get "auto" -}}
|
||||
<meting-js auto="{{ .Get `auto` }}" theme="{{ .Get `theme` | default `#a9a9b3` }}"
|
||||
{{- with .Get "fixed" }} fixed="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mini" }} mini="{{ . }}"{{ end -}}
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
{{- with .Get "loop" }} loop="{{ . }}"{{ end -}}
|
||||
{{- with .Get "order" }} order="{{ . }}"{{ end -}}
|
||||
{{- with .Get "volume" }} volume="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mutex" }} mutex="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-folded" }} list-folded="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-max-height" }} list-max-height="{{ . }}"{{ end -}}
|
||||
></meting-js>
|
||||
{{- else -}}
|
||||
<meting-js server="{{ .Get `server` }}" type="{{ .Get `type` }}" id="{{ .Get `id` }}" theme="{{ .Get `theme` | default `#a9a9b3` }}"
|
||||
{{- with .Get "fixed" }} fixed="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mini" }} mini="{{ . }}"{{ end -}}
|
||||
{{- with .Get "autoplay" }} autoplay="{{ . }}"{{ end -}}
|
||||
{{- with .Get "loop" }} loop="{{ . }}"{{ end -}}
|
||||
{{- with .Get "order" }} order="{{ . }}"{{ end -}}
|
||||
{{- with .Get "volume" }} volume="{{ . }}"{{ end -}}
|
||||
{{- with .Get "mutex" }} mutex="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-folded" }} list-folded="{{ . }}"{{ end -}}
|
||||
{{- with .Get "list-max-height" }} list-max-height="{{ . }}"{{ end -}}
|
||||
></meting-js>
|
||||
{{- end -}}
|
||||
{{- else if strings.HasSuffix (.Get 0) "http" -}}
|
||||
<meting-js auto="{{ .Get 0 }}" theme="#a9a9b3"></meting-js>
|
||||
{{- else -}}
|
||||
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="#A9A9B3"></meting-js>
|
||||
<meting-js server="{{ .Get 0 }}" type="{{ .Get 1 }}" id="{{ .Get 2 }}" theme="#a9a9b3"></meting-js>
|
||||
{{- end -}}
|
||||
{{- $scratch.Set "music" true -}}
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
{{- $scratch := .Page.Scratch.Get "scratch" -}}
|
||||
|
||||
{{- /* only the trailing newline is retained */ -}}
|
||||
{{- $content := replaceRE `(?s)^\n*(.*?)\n*$` "$1\n" .Inner | .Page.RenderString | chomp -}}
|
||||
{{- $content := .Inner -}}
|
||||
{{- $classList := .Get "class" | slice -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
|
||||
{{- with .Get "code" -}}
|
||||
{{- /* highlight code content without line number */ -}}
|
||||
{{- $content = highlight $content . "linenos=false" -}}
|
||||
{{- /* delete outer label */ -}}
|
||||
{{- $content = replaceRE `<div class="highlight"><pre class="chroma"><code[^<>]*>(?s)(.*)</code></pre></div>` "$1" $content -}}
|
||||
{{- /* parsing markdown links */ -}}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content -}}
|
||||
{{- /* replace " " to " " and replace "\n" to "<br />" */ -}}
|
||||
{{- $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "<br />" -}}
|
||||
{{- /* fix "<br />" location error which is a bug of Typeit HTML parser */ -}}
|
||||
{{- $content = replaceRE `<br /></span>` "</span><br />" $content -}}
|
||||
{{- $classList = $classList | append "highlight" -}}
|
||||
{{- else -}}
|
||||
{{- $content = $content | .Page.RenderString -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* trim the newline */ -}}
|
||||
{{- $content = trim $content "\n" -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content "scratch" $scratch) -}}
|
||||
{{- $key := .Get "group" | default $id -}}
|
||||
{{- $group := index ($scratch.Get "typeitMap" | default dict) $key -}}
|
||||
{{- $group = $group | default slice | append $id -}}
|
||||
{{- $scratch.SetInMap "typeitMap" $key $group -}}
|
||||
|
||||
<div class={{ .Get "class" | default "typeit" }}>
|
||||
{{- /* raw html content */ -}}
|
||||
{{- if .Get "raw" -}}
|
||||
<div id={{ $id }}></div>
|
||||
{{- else if .Get "code" -}}
|
||||
{{- /* highlight code content without line number */ -}}
|
||||
{{- $content = highlight $content (.Get "code") "linenos=false" -}}
|
||||
{{- /* delete outer label */ -}}
|
||||
{{- $content = replaceRE `<div class="highlight"><pre class="chroma"><code[^<>]*>(?s)(.*)</code></pre></div>` "$1" $content -}}
|
||||
{{- /* parsing markdown links */ -}}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content -}}
|
||||
{{- /* replace " " to " " and replace "\n" to "<br />" */ -}}
|
||||
{{- $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "<br />" -}}
|
||||
{{- /* fix "<br />" location error which is a bug of Typeit HTML parser */ -}}
|
||||
{{- $content = replaceRE `<br /></span>` "</span><br />" $content -}}
|
||||
<div class="highlight" id={{ $id }}></div>
|
||||
{{- else -}}
|
||||
{{- $tag := .Get "tag" | default "p" -}}
|
||||
{{- printf "<%s id=%s></%s>" $tag $id $tag | safeHTML -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $key := .Get "group" | default $id -}}
|
||||
{{- $group := index ($scratch.Get "typeitMap" | default dict) $key -}}
|
||||
{{- $group = $group | default slice | append $id -}}
|
||||
{{- $scratch.SetInMap "typeitMap" $key $group -}}
|
||||
<div class="typeit">
|
||||
{{- printf `<%s id="%s" class="%s"></%s>` $tag $id (delimit $classList " ") $tag | safeHTML -}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user