use maintained theme

This commit is contained in:
Christoph Cullmann 2021-02-18 22:21:36 +01:00
parent 640572ecab
commit 0c7cb4486a
1779 changed files with 41468 additions and 26258 deletions

View file

@ -1,207 +0,0 @@
{{- $params := .Scratch.Get "params" -}}
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- $config := (.Scratch.Get "this").config -}}
{{- /* Smooth Scroll */ -}}
{{- $source := $cdn.smoothScrollJS | default "lib/smooth-scroll/smooth-scroll.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* Search */ -}}
{{- if .Site.Params.search | and .Site.Params.search.enable -}}
{{- $search := .Site.Params.search -}}
{{- $source := $cdn.autocompleteJS | default "lib/autocomplete/autocomplete.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "maxResultLength" $search.maxResultLength "snippetLength" $search.snippetLength "highlightTag" $search.highlightTag "noResultsFound" (T "noResultsFound") | dict "search" | merge $config -}}
{{- if eq $search.type "lunr" -}}
{{- with .Site.Home.OutputFormats.Get "json" -}}
{{- $config = dict "type" "lunr" "lunrIndexURL" .RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- $source := $cdn.lunrJS | default "lib/lunr/lunr.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if T "lunrLanguageLib" -}}
{{- $config = T "lunrLanguageCode" | dict "lunrLanguageCode" | dict "search" | merge $config -}}
{{- with T "lunrSegmentitLib" -}}
{{- $config = dict "lunrSegmentitURL" (resources.Get .).RelPermalink | dict "search" | merge $config -}}
{{- end -}}
{{- dict "Source" "lib/lunr/lunr.stemmer.support.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- else if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- end -}}
{{- end -}}
{{- /* lazysizes */ -}}
{{- $source := $cdn.lazysizesJS | default "lib/lazysizes/lazysizes.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* twemoji */ -}}
{{- if $params.twemoji -}}
{{- $source := $cdn.twemojiJS | default "lib/twemoji/twemoji.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "twemoji" true | merge $config -}}
{{- end -}}
{{- /* lightgallery.js */ -}}
{{- if $params.lightgallery -}}
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/lightgallery.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.lightgalleryJS | default "lib/lightgallery/lightgallery.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryThumbnailJS | default "lib/lightgallery/lg-thumbnail.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false | dict "lightGallery" | merge $config -}}
{{- end -}}
{{- $code := $params.code | default dict -}}
{{- $config = cond (ne $code.maxShownLines nil) $code.maxShownLines 10 | dict "maxShownLines" | dict "code" | merge $config -}}
{{- /* clipboard.js */ -}}
{{- if ne $code.copy false -}}
{{- $source := $cdn.clipboardJS | default "lib/clipboard/clipboard.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = T "copyToClipboard" | dict "copyTitle" | dict "code" | merge $config -}}
{{- end -}}
{{- /* Sharer.js */ -}}
{{- if $params.share.enable -}}
{{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* TypeIt */ -}}
{{- with (.Scratch.Get "this").typeitMap -}}
{{- $typeit := $.Site.Params.typeit -}}
{{- $source := $cdn.typeitJS | default "lib/typeit/typeit.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "speed" $typeit.speed "cursorSpeed" $typeit.cursorSpeed "cursorChar" $typeit.cursorChar "duration" $typeit.duration "data" . | dict "typeit" | merge $config -}}
{{- end -}}
{{- /* KaTeX */ -}}
{{- $math := $params.math -}}
{{- if eq $math true -}}
{{- $math = .Site.Params.page.math | default dict -}}
{{- else if eq $math false -}}
{{- $math = dict "enable" false -}}
{{- end -}}
{{- if $math.enable -}}
{{- $source := $cdn.katexCSS | default "lib/katex/katex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.katexJS | default "lib/katex/katex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.katexAutoRenderJS | default "lib/katex/auto-render.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- if $math.copyTex -}}
{{- $source := $cdn.katexCopyTexCSS | default "lib/katex/copy-tex.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.katexCopyTexJS | default "lib/katex/copy-tex.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- if $math.mhchem -}}
{{- $source := $cdn.katexMhchemJS | default "lib/katex/mhchem.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- $delimiters := slice (dict "left" "$$" "right" "$$" "display" true) (dict "left" "\\[" "right" "\\]" "display" true) -}}
{{- if and $math.blockLeftDelimiter $math.blockRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.blockLeftDelimiter "right" $math.blockRightDelimiter "display" true) -}}
{{- end -}}
{{- $delimiters = $delimiters | append (dict "left" "$" "right" "$" "display" false) (dict "left" "\\(" "right" "\\)" "display" false) -}}
{{- if and $math.inlineLeftDelimiter $math.inlineRightDelimiter -}}
{{- $delimiters = $delimiters | append (dict "left" $math.inlineRightDelimiter "right" $math.inlineRightDelimiter "display" false) -}}
{{- end -}}
{{- $config = dict "strict" false "delimiters" $delimiters | dict "math" | merge $config -}}
{{- end -}}
{{- /* mermaid */ -}}
{{- if (.Scratch.Get "this").mermaid -}}
{{- $source := $cdn.mermaidJS | default "lib/mermaid/mermaid.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/mermaid/mermaid.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- /* ECharts */ -}}
{{- if (.Scratch.Get "this").echarts -}}
{{- $source := $cdn.echartsJS | default "lib/echarts/echarts.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $source := $cdn.echartsMacaronsJS | default "lib/echarts/macarons.js" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* Mapbox GL */ -}}
{{- if (.Scratch.Get "this").mapbox -}}
{{- $source := $cdn.mapboxGLCSS | default "lib/mapbox-gl/mapbox-gl.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.mapboxGLJS | default "lib/mapbox-gl/mapbox-gl.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- dict "Source" "lib/mapbox-gl/mapbox-gl-language.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "accessToken" $params.mapbox.accessToken "RTLTextPlugin" "https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js" | dict "mapbox" | merge $config -}}
{{- end -}}
{{- /* Music */ -}}
{{- if (.Scratch.Get "this").music -}}
{{- /* APlayer */ -}}
{{- $source := $cdn.aplayerCSS | default "lib/aplayer/APlayer.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* MetingJS */ -}}
{{- $source := $cdn.metingJS | default "lib/meting/Meting.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- /* Cookie Consent */ -}}
{{- if .Site.Params.cookieconsent | and .Site.Params.cookieconsent.enable -}}
{{- $source := $cdn.cookieconsentCSS | default "lib/cookieconsent/cookieconsent.min.css" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.cookieconsentJS | default "lib/cookieconsent/cookieconsent.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $cookieconsentConfig := dict "popup" (dict "background" "#1aa3ff") "button" (dict "background" "#f0f0f0") | dict "theme" "edgeless" "palette" -}}
{{- $cookieconsentConfig = .Site.Params.cookieconsent | merge $cookieconsentConfig -}}
{{- $cookieconsentConfig = dict "message" ($cookieconsentConfig.content.message | default (T "cookieconsentMessage")) "dismiss" ($cookieconsentConfig.content.dismiss | default (T "cookieconsentDismiss")) "link" ($cookieconsentConfig.content.link | default (T "cookieconsentLink")) | dict "content" | merge $cookieconsentConfig -}}
{{- $config = $cookieconsentConfig | dict "cookieconsent" | merge $config -}}
{{- end -}}
{{- range $params.library.css -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- range $params.library.js -}}
{{- dict "Source" . "Fingerprint" $fingerprint | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- with (.Scratch.Get "this").styleArr -}}
{{- $content := delimit . "" -}}
{{- $path := substr (md5 $content) 0 6 | printf "css/%v" -}}
{{- $options := printf "%v.min.css" $path | dict "targetPath" -}}
{{- dict "Content" $content "Path" (printf "%v.scss" $path) "ToCSS" $options | dict "Scratch" $.Scratch "Data" | partial "scratch/style.html" -}}
{{- end -}}
{{- /* Config script */ -}}
{{- $config | jsonify | printf "window.config=%s;" | dict "Content" | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* Theme script */ -}}
{{- dict "Source" "js/theme.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
{{- with (.Scratch.Get "this").scriptArr -}}
{{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- range (.Scratch.Get "this").style -}}
{{- partial "plugin/style.html" . -}}
{{- end -}}
{{- range (.Scratch.Get "this").script -}}
{{- partial "plugin/script.html" . -}}
{{- end -}}
{{- partial "plugin/analytics.html" . -}}

View file

@ -1,130 +0,0 @@
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- $comment := .Scratch.Get "comment" | default dict -}}
{{- $commentConfig := dict -}}
{{- if $comment.enable -}}
<div id="comments">
{{- /* Disqus Comment System */ -}}
{{- $disqus := $comment.disqus | default dict -}}
{{- if $disqus.enable -}}
<div id="disqus_thread" class="comment"></div>
{{- $source := printf "https://%v.disqus.com/embed.js" $disqus.shortname -}}
{{- dict "Source" $source "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript">Disqus</a>.
</noscript>
{{- end -}}
{{- /* Gitalk Comment System */ -}}
{{- $gitalk := $comment.gitalk | default dict -}}
{{- if $gitalk.enable -}}
<div id="gitalk" class="comment"></div>
{{- $source := $cdn.gitalkCSS | default "lib/gitalk/gitalk.css" -}}
{{- dict "Source" $source "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.gitalkJS | default "lib/gitalk/gitalk.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $commentConfig = dict "id" .Date "title" .Title "clientID" $gitalk.clientId "clientSecret" $gitalk.clientSecret "repo" $gitalk.repo "owner" $gitalk.owner "admin" (slice $gitalk.owner) | dict "gitalk" | merge $commentConfig -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://github.com/gitalk/gitalk"></a>Gitalk</a>.
</noscript>
{{- end -}}
{{- /* Valine Comment System */ -}}
{{- $valine := $comment.valine | default dict -}}
{{- if $valine.enable -}}
<div id="valine" class="comment"></div>
{{- $options := dict "targetPath" "lib/valine/valine.min.css" -}}
{{- dict "Source" "lib/valine/valine.scss" "ToCSS" $options | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.valineJS | default "lib/valine/Valine.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $commentConfig = dict "el" "#valine" "appId" $valine.appId "appKey" $valine.appKey "lang" ($valine.lang | default (T "valineLang")) "visitor" $valine.visitor "recordIP" $valine.recordIP "placeholder" ($valine.placeholder | default (T "valinePlaceholder")) "highlight" (ne $valine.highlight false) "enableQQ" $valine.enableQQ | dict "valine" | merge $commentConfig -}}
{{- with $valine.avatar -}}
{{- $commentConfig = dict "avatar" . | dict "valine" | merge $commentConfig -}}
{{- end -}}
{{- with $valine.meta -}}
{{- $commentConfig = dict "meta" . | dict "valine" | merge $commentConfig -}}
{{- end -}}
{{- with $valine.pageSize -}}
{{- $commentConfig = dict "pageSize" . | dict "valine" | merge $commentConfig -}}
{{- end -}}
{{- with $valine.serverURLs -}}
{{- $commentConfig = dict "serverURLs" . | dict "valine" | merge $commentConfig -}}
{{- end -}}
{{- $commentConfig = $valine.emoji | default "google.yml" | printf "data/emoji/%v" | resources.Get | transform.Unmarshal | dict "valine" | merge $commentConfig -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://valine.js.org/">Valine</a>.
</noscript>
{{- end -}}
{{- /* Facebook Comment System */ -}}
{{- $facebook := $comment.facebook | default dict -}}
{{- if $facebook.enable -}}
<div id="fb-root" class="comment"></div>
<div
class="fb-comments"
data-href="{{ .Permalink }}"
data-width="{{ $facebook.width }}"
data-numposts="{{ $facebook.numPosts }}"
></div>
{{- $source := printf "https://connect.facebook.net/%v/sdk.js#xfbml=1&version=v5.0&appId=%v&autoLogAppEvents=1" ($facebook.languageCode | default (T "facebookLanguageCode")) $facebook.appId -}}
{{- dict "Source" $source "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://developers.facebook.com/docs/plugins/comments/"></a>Facebook</a>.
</noscript>
{{- end -}}
{{- /* Telegram Comments System */ -}}
{{- $telegram := $comment.telegram | default dict -}}
{{- if $telegram.enable -}}
<div id="telegram-comments" class="comment"></div>
{{- $attr := printf `data-comments-app-website="%v"` $telegram.siteID -}}
{{- $attr = printf `%v data-limit="%v"` $attr ($telegram.limit | default 5) -}}
{{- with $telegram.height -}}
{{- $attr = printf `%v data-height="%v"` $attr . -}}
{{- end -}}
{{- with $telegram.color -}}
{{- $attr = printf `%v data-color="%v"` $attr . -}}
{{- end -}}
{{- if $telegram.colorful -}}
{{- $attr = printf `%v data-colorful="1"` $attr -}}
{{- end -}}
{{- if $telegram.dislikes -}}
{{- $attr = printf `%v data-dislikes="1"` $attr -}}
{{- end -}}
{{- if $telegram.outlined -}}
{{- $attr = printf `%v data-outlined="1"` $attr -}}
{{- end -}}
{{- dict "Source" "https://comments.app/js/widget.js?2" "Defer" true "Attr" $attr | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>.
</noscript>
{{- end -}}
{{- /* Commento Comment System */ -}}
{{- $commento := $comment.commento | default dict -}}
{{- if $commento.enable -}}
<div id="commento"></div>
{{- dict "Source" "https://cdn.commento.io/js/commento.js" "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://commento.io/">Commento</a>.
</noscript>
{{- end -}}
{{- /* Utterances Comment System */ -}}
{{- $utterances := $comment.utterances | default dict -}}
{{- if $utterances.enable -}}
<div id="utterances"></div>
{{- $commentConfig = dict "repo" $utterances.repo | dict "utterances" | merge $commentConfig -}}
{{- $commentConfig = $utterances.issueTerm | default "pathname" | dict "issueTerm" | dict "utterances" | merge $commentConfig -}}
{{- $commentConfig = dict "label" $utterances.label | dict "utterances" | merge $commentConfig -}}
{{- $commentConfig = $utterances.lightTheme | default "github-light" | dict "lightTheme" | dict "utterances" | merge $commentConfig -}}
{{- $commentConfig = $utterances.darkTheme | default "github-dark" | dict "darkTheme" | dict "utterances" | merge $commentConfig -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://utteranc.es/">Utterances</a>.
</noscript>
{{- end -}}
</div>
{{- end -}}
{{- dict "comment" $commentConfig | dict "config" | merge (.Scratch.Get "this") | .Scratch.Set "this" -}}

View file

@ -1,51 +0,0 @@
{{- if ne .Site.Params.footer.enable false -}}
<footer class="footer">
<div class="footer-container">
{{- /* Custom Content */ -}}
{{- with .Site.Params.footer.custom -}}
<div class="footer-line">
{{- safeHTML . -}}
</div>
{{- end -}}
{{- /* Hugo and LoveIt */ -}}
{{- if ne .Site.Params.footer.hugo false -}}
<div class="footer-line">
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %v">Hugo</a>` hugo.Version -}}
{{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt %v"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>` -}}
{{- dict "Hugo" $hugo "Theme" $theme | T "poweredBySome" | safeHTML }}
</div>
{{- end -}}
<div class="footer-line">
{{- /* Copyright year */ -}}
{{- if ne .Site.Params.footer.copyright false -}}
<i class="far fa-copyright fa-fw"></i>
{{- with .Site.Params.footer.since -}}
<span itemprop="copyrightYear">
{{- if lt . now.Year }}{{ . }} - {{ end }}{{ now.Year -}}
</span>
{{- else -}}
<span itemprop="copyrightYear">{{ now.Year }}</span>
{{- end -}}
{{- end -}}
{{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}}
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span>
{{- end -}}
{{- /* License */ -}}
{{- with .Site.Params.footer.license -}}
&nbsp;|&nbsp;<span class="license">{{ . | safeHTML }}</span>
{{- end -}}
{{- /* ICP */ -}}
{{- with .Site.Params.footer.icp -}}
<span class="icp-splitter">&nbsp;|&nbsp;</span><br class="icp-br"/>
<span class="icp">{{ . | safeHTML }}</span>
{{- end -}}
</div>
</div>
</footer>
{{- end -}}

View file

@ -1,9 +0,0 @@
{{- /* Checkbox unchecked */ -}}
{{- $old := `<input disabled="" type="checkbox">` -}}
{{- $new := `<i class="far fa-square fa-fw"></i>` -}}
{{- $content := replace . $old $new -}}
{{- /* Checkbox checked */ -}}
{{- $old = `<input checked="" disabled="" type="checkbox">` -}}
{{- $new = `<i class="far fa-check-square fa-fw"></i>` -}}
{{- return replace $content $old $new -}}

View file

@ -1,19 +0,0 @@
{{- $content := .Content -}}
{{- if .Ruby -}}
{{- $content = partial "function/ruby.html" $content -}}
{{- end -}}
{{- if .Fraction -}}
{{- $content = partial "function/fraction.html" $content -}}
{{- end -}}
{{- if .Fontawesome -}}
{{- $content = partial "function/fontawesome.html" $content -}}
{{- end -}}
{{- $content = partial "function/checkbox.html" $content -}}
{{- $content = partial "function/escape.html" $content -}}
{{- return $content -}}

View file

@ -1,5 +0,0 @@
{{- /* Escape character */ -}}
{{- /* {?X} -> X */ -}}
{{- $REin := `\{\?(.)\}` -}}
{{- $REout := `$1` -}}
{{- return replaceRE $REin $REout . -}}

View file

@ -1,14 +0,0 @@
{{- /* Font Awesome */ -}}
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
{{- $REin := ` (:\([\w- ]+?\):)` -}}
{{- $REout := `&nbsp;$1` -}}
{{- $content := replaceRE $REin $REout . -}}
{{- $REin = `(:\([\w- ]+?\):) ` -}}
{{- $REout = `$1&nbsp;` -}}
{{- $content = replaceRE $REin $REout . -}}
{{- $REin = `:\(([\w- ]+?)\):` -}}
{{- $REout = `<i class="$1"></i>` -}}
{{- return replaceRE $REin $REout $content -}}

View file

@ -1,5 +0,0 @@
{{- /* Fraction */ -}}
{{- /* [A]/[B] -> <sup>A</sup>/<sub>B</sub> */ -}}
{{- $REin := `\[(.+?)\]/\[(.+?)\]` -}}
{{- $REout := `<sup>$1</sup>/<sub>$2</sub>` -}}
{{- return replaceRE $REin $REout . -}}

View file

@ -1,8 +0,0 @@
{{- /* ID */ -}}
{{- $count := (.Scratch.Get "this").count | default 1 -}}
{{- $id := printf "id-%d" $count -}}
{{- $count | add 1 | .Scratch.SetInMap "this" "count" -}}
{{- with .Content -}}
{{- dict $id . | dict "data" | dict "config" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- end -}}
{{- return $id -}}

View file

@ -1,3 +0,0 @@
{{- /* https://discourse.gohugo.io/t/how-decode-urls-in-hugo/7549/4 */ -}}
{{- $URL := . | urlize | urls.Parse -}}
{{- return $URL.Path -}}

View file

@ -1,16 +0,0 @@
{{- $resource := 0 -}}
{{- $url := urls.Parse .Path -}}
{{- if not $url.Host | and $url.Path | and (strings.HasSuffix $url.Path "/" | not) -}}
{{- if .Resources -}}
{{- with .Resources.GetMatch $url.Path -}}
{{- $resource = . -}}
{{- end -}}
{{- end -}}
{{- if not $resource -}}
{{- with resources.Get $url.Path -}}
{{- $resource = . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $resource -}}

View file

@ -1,5 +0,0 @@
{{- /* Ruby */ -}}
{{- /* [EN]^(English) -> <strong><ruby>EN<rt>English</rt></ruby></strong> */ -}}
{{- $REin := `\[(.+?)\]\^\((.+?)\)` -}}
{{- $REout := `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
{{- return replaceRE $REin $REout . -}}

View file

@ -1,51 +0,0 @@
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- if not .Site.Params.app.noFavicon -}}
{{- with .Site.Params.app.svgFavicon -}}
<link rel="icon" href="{{ . }}">
{{- else -}}
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
{{- end -}}
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
{{- with .Site.Params.app.iconColor -}}
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="{{ . }}">
{{- end -}}
<link rel="manifest" href="/site.webmanifest">
{{- end -}}
<link rel="canonical" href="{{ .Permalink }}" />
{{- if .PrevInSection -}}
<link rel="prev" href="{{ .PrevInSection.Permalink }}" />
{{- end -}}
{{- if .NextInSection -}}
<link rel="next" href="{{ .NextInSection.Permalink }}" />
{{- end -}}
{{- with .OutputFormats.Get "RSS" -}}
<link rel="alternate" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
<link rel="feed" href="{{ .RelPermalink }}" type="application/rss+xml" title="{{ $.Site.Title }}">
{{- end -}}
{{- /* normalize.css */ -}}
{{- $source := $cdn.normalizeCSS | default "lib/normalize/normalize.min.css" -}}
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
{{- partial "plugin/style.html" $style -}}
{{- /* style.min.css */ -}}
{{- $style := dict "Source" "css/style.scss" "Fingerprint" $fingerprint -}}
{{- $options := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}}
{{- $style = dict "Context" . "ToCSS" $options | merge $style -}}
{{- partial "plugin/style.html" $style -}}
{{- /* Font Awesome */ -}}
{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
{{- partial "plugin/style.html" $style -}}
{{- /* Animate.css */ -}}
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
{{- partial "plugin/style.html" $style -}}

View file

@ -1,17 +0,0 @@
{{- $params := .Scratch.Get "params" -}}
<meta name="Description" content="{{ $params.description | default .Site.Params.description }}">
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
<meta name="application-name" content="{{ .Site.Params.app.title | default .Site.Title }}">
<meta name="apple-mobile-web-app-title" content="{{ .Site.Params.app.title | default .Site.Title }}">
{{- with .Site.Params.app.themeColor -}}
<meta name="theme-color" content="{{ . }}">
{{- end -}}
{{- with .Site.Params.app.tileColor -}}
<meta name="msapplication-TileColor" content="{{ . }}">
{{- end -}}

View file

@ -1,153 +0,0 @@
{{- $params := .Scratch.Get "params" -}}
{{- with .Site.Params.verification.google -}}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.bing -}}
<meta name="msvalidate.01" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.yandex -}}
<meta name="yandex-verification" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.pinterest -}}
<meta name="p:domain_verify" content="{{ . }}" />
{{- end -}}
{{- with .Site.Params.verification.baidu -}}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{- /* Home SEO */ -}}
{{- if .IsHome -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
{{- with .Site.Params.description -}}
"description": {{ . | safeHTML }},
{{- end -}}
{{- $image := .Site.Params.seo.image -}}
{{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" -}}
"image": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
},
{{- else -}}
{{- with $image -}}
"image": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.thumbnailUrl -}}
{{- with dict "Path" . "Resources" $.Resources | partial "function/resource.html" -}}
"thumbnailUrl": "{{ .Permalink }}",
{{- else -}}
"thumbnailUrl": "{{ . | absURL }}",
{{- end -}}
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeHTML }}",
{{- end -}}
"name": {{ .Site.Title | safeHTML }}
}
</script>
{{- /* Page SEO */ -}}
{{- else if .IsPage -}}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": {{ .Title | safeHTML }},
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Permalink }}"
},
{{- $images := $params.seo.images | default slice -}}
{{- if not $images -}}
{{- with .Resources.GetMatch "featured-image-preview" -}}
{{- $images = slice "featured-image-preview" -}}
{{- end -}}
{{- with .Resources.GetMatch "featured-image" -}}
{{- $images = slice "featured-image" -}}
{{- end -}}
{{- end -}}
{{- with .Site.Params.seo.image -}}
{{- $images = $images | default (slice .) -}}
{{- end -}}
{{- with $images -}}
"image": [
{{- range $index, $value := . -}}
{{- if gt $index 0 }},{{ end -}}
{{- with dict "Path" $value "Resources" $.Resources | partial "function/resource.html" -}}
{
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $value -}}
"{{ . | absURL }}"
{{- end -}}
{{- end -}}
{{- end -}}
],
{{- end -}}
"genre": "{{ .Type }}",
{{- with .Params.tags -}}
"keywords": "{{ delimit . ", " }}",
{{- end -}}
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- else if not .Date.IsZero -}}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Lastmod -}}
"dateModified": {{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := .Params.author | default .Site.Author.name | default (T "author") | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
"name": {{ $publisher.name | safeHTML }}
{{- $logo := $publisher.logoUrl -}}
{{- with dict "Path" $logo "Resources" .Resources | partial "function/resource.html" -}}
,"logo": {
"@type": "ImageObject",
"url": "{{ .Permalink }}",
"width": {{ .Width }},
"height": {{ .Height }}
}
{{- else -}}
{{- with $logo -}}
,"logo": "{{ . | absURL }}"
{{- end -}}
{{- end -}}
},
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
},
{{- end -}}
"description": {{ .Description | safeHTML }}
}
</script>
{{- end -}}

View file

@ -1,183 +0,0 @@
{{- /* Desktop header */ -}}
<header class="desktop" id="header-desktop">
<div class="header-wrapper">
<div class="header-title">
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
{{- with .Site.Params.header.title -}}
{{- with .logo -}}
{{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}}
{{- end -}}
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- if .typeit -}}
{{- $id := dict "Content" .name "Scratch" $.Scratch | partial "function/id.html" -}}
<span id="{{ $id }}" class="typeit"></span>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- .name -}}
{{- end -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}
{{- else -}}
{{- .Site.Title -}}
{{- end -}}
</a>
</div>
<div class="menu">
<div class="menu-inner">
{{- range .Site.Menus.main -}}
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
<a class="menu-item{{ if $.IsMenuCurrent `main` . | or ($.HasMenuCurrent `main` .) | or (eq $.RelPermalink $url) }} active{{ end }}" href="{{ $url }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
{{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}}
</a>
{{- end -}}
{{- if .Site.Menus.main -}}
<span class="menu-item delimiter"></span>
{{- end -}}
{{- if .Site.IsMultiLingual -}}
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
{{- .Language.LanguageName -}}
<i class="fas fa-chevron-right fa-fw"></i>
<select class="language-select" id="language-select-desktop" onchange="location = this.value;">
{{- if eq .Kind "404" -}}
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
{{- range .Sites -}}
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
<option value="{{ $link }}"{{ if eq . $.Site }} selected{{ end }}>
{{- .Language.LanguageName -}}
</option>
{{- end -}}
{{- else -}}
{{- range .AllTranslations -}}
<option value="{{ .RelPermalink }}"{{ if eq .Lang $.Lang }} selected{{ end }}>
{{- .Language.LanguageName -}}
</option>
{{- end -}}
{{- end -}}
</select>
</a>
{{- end -}}
{{- if .Site.Params.search.enable -}}
<span class="menu-item search" id="search-desktop">
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-desktop">
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="{{ T `search` }}">
<i class="fas fa-search fa-fw"></i>
</a>
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="{{ T `clear` }}">
<i class="fas fa-times-circle fa-fw"></i>
</a>
<span class="search-button search-loading" id="search-loading-desktop">
<i class="fas fa-spinner fa-fw fa-spin"></i>
</span>
</span>
{{- end -}}
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw"></i>
</a>
</div>
</div>
</div>
</header>
{{- /* Mobile header */ -}}
<header class="mobile" id="header-mobile">
<div class="header-container">
<div class="header-wrapper">
<div class="header-title">
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
{{- with .Site.Params.header.title -}}
{{- with .logo -}}
{{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}}
{{- end -}}
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- if .typeit -}}
{{- $id := dict "Content" .name "Scratch" $.Scratch | partial "function/id.html" -}}
<span id="{{ $id }}" class="typeit"></span>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- .name -}}
{{- end -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}
{{- else -}}
{{- .Site.Title -}}
{{- end -}}
</a>
</div>
<div class="menu-toggle" id="menu-toggle-mobile">
<span></span><span></span><span></span>
</div>
</div>
<div class="menu" id="menu-mobile">
{{- if .Site.Params.search.enable -}}
<div class="search-wrapper">
<div class="search mobile" id="search-mobile">
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-mobile">
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="{{ T `search` }}">
<i class="fas fa-search fa-fw"></i>
</a>
<a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="{{ T `clear` }}">
<i class="fas fa-times-circle fa-fw"></i>
</a>
<span class="search-button search-loading" id="search-loading-mobile">
<i class="fas fa-spinner fa-fw fa-spin"></i>
</span>
</div>
<a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
{{ T `cancel` }}
</a>
</div>
{{- end -}}
{{- $currentPage := . -}}
{{- range .Site.Menus.main -}}
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
<a class="menu-item" href="{{ $url }}" title="{{ .Title }}"{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
{{- .Pre | safeHTML }}{{ .Name }}{{ .Post | safeHTML -}}
</a>
{{- end -}}
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw"></i>
</a>
{{- if .Site.IsMultiLingual -}}
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
{{- .Language.LanguageName -}}
<i class="fas fa-chevron-right fa-fw"></i>
<select class="language-select" onchange="location = this.value;">
{{- if eq .Kind "404" -}}
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
{{- range .Sites -}}
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
<option value="{{ $link }}"{{ if eq . $.Site }} selected{{ end }}>
{{- .Language.LanguageName -}}
</option>
{{- end -}}
{{- else -}}
{{- range .AllTranslations -}}
<option value="{{ .RelPermalink }}"{{ if eq .Lang $.Lang }} selected{{ end }}>
{{- .Language.LanguageName -}}
</option>
{{- end -}}
{{- end -}}
</select>
</a>
{{- end -}}
</div>
</div>
</header>
<div class="search-dropdown desktop">
<div id="search-dropdown-desktop"></div>
</div>
<div class="search-dropdown mobile">
<div id="search-dropdown-mobile"></div>
</div>

View file

@ -1,95 +0,0 @@
{{- $profile := .Site.Params.home.profile -}}
<div class="home-profile">
{{- $avatar := $profile.avatarURL -}}
{{- with $profile.gravatarEmail -}}
{{- $avatar = md5 . | printf "https://www.gravatar.com/avatar/%v?s=240&d=mp" -}}
{{- end -}}
{{- if $avatar -}}
<div class="home-avatar">
{{- $menus := $.Site.Menus.main | default slice -}}
{{- with index $menus 0 -}}
{{- $url := .URL | relLangURL -}}
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
</a>
{{- else -}}
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
{{- end -}}
</div>
{{- end -}}
{{- with $profile.title -}}
<h1 class="home-title">
{{- . | safeHTML -}}
</h1>
{{- end -}}
{{- with $profile.subtitle -}}
<h2 class="home-subtitle">
{{- if $profile.typeit -}}
{{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}}
<div id="{{ $id }}" class="typeit"></div>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- . -}}
{{- end -}}
</h2>
{{- end -}}
{{- if $profile.social -}}
<div class="links">
{{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}}
{{- $socialArr := slice -}}
{{- range $key, $value := .Site.Params.social -}}
{{- $social := $key | lower | index $socialMap | default dict -}}
{{- if $value -}}
{{- if reflect.IsMap $value -}}
{{- with $value.weight -}}
{{- $social = dict "Weight" . | merge $social -}}
{{- end -}}
{{- with $value.prefix -}}
{{- $social = dict "Prefix" . | merge $social -}}
{{- end -}}
{{- with $value.template -}}
{{- $social = dict "Template" . | merge $social -}}
{{- end -}}
{{- with $value.id -}}
{{- $social = dict "Id" . | merge $social -}}
{{- end -}}
{{- with $value.url -}}
{{- $social = dict "Url" . | merge $social -}}
{{- end -}}
{{- with $value.title -}}
{{- $social = dict "Title" . | merge $social -}}
{{- end -}}
{{- with $value.newtab -}}
{{- $social = dict "Newtab" . | merge $social -}}
{{- end -}}
{{- with $value.icon -}}
{{- $social = dict "Icon" . | merge $social -}}
{{- end -}}
{{- else if ne $value true -}}
{{- $social = dict "Id" $value | merge $social -}}
{{- end -}}
{{- if $social.Icon.Simpleicons -}}
{{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}}
{{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}}
{{- end -}}
{{- $socialArr = $socialArr | append $social -}}
{{- end -}}
{{- end -}}
{{- range sort $socialArr "Weight" -}}
{{- partial "plugin/social.html" . -}}
{{- end -}}
</div>
{{- end -}}
{{- with $profile.disclaimer -}}
<h3 class="home-disclaimer">
{{- . | safeHTML -}}
</h3>
{{- end -}}
</div>

View file

@ -1,41 +0,0 @@
{{- .Scratch.Set "version" "0.2.10" -}}
{{- /* LoveIt theme version detection */ -}}
{{- $VERSION := "0.2.X" -}}
{{- if eq .Site .Sites.First -}}
{{- if not .Site.Params.version -}}
{{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 LoveIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}}
{{- else if ne .Site.Params.version $VERSION -}}
{{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/dillonzq/LoveIt/releases\n" .Site.Params.version $VERSION) -}}
{{- end -}}
{{- end -}}
{{- $params := .Params | merge .Site.Params.page -}}
{{- if eq hugo.Environment "production" -}}
{{- $cdn := .Site.Params.cdn -}}
{{- with $cdn.data -}}
{{- $cdnData := printf "data/cdn/%v" . | resources.Get | transform.Unmarshal -}}
{{- $cdn = dict "simpleIconsPrefix" $cdnData.prefix.simpleIcons -}}
{{- $prefix := $cdnData.prefix.libFiles | default "" -}}
{{- range $key, $value := $cdnData.libFiles -}}
{{- $cdn = printf "%v%v" $prefix $value | dict $key | merge $cdn -}}
{{- end -}}
{{- end -}}
{{- .Scratch.Set "cdn" $cdn -}}
{{- .Scratch.Set "fingerprint" .Site.Params.fingerprint -}}
{{- .Scratch.Set "analytics" .Site.Params.analytics -}}
{{- .Scratch.Set "comment" $params.comment -}}
{{- if eq .Params.comment true -}}
{{- .Scratch.Set "comment" .Site.Params.comment -}}
{{- else if eq .Params.comment false -}}
{{- .Scratch.Set "comment" dict -}}
{{- end -}}
{{- else if eq .Site .Sites.First -}}
{{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}}
{{- end -}}
{{- .Scratch.Set "params" $params -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "plugin/compatibility.html" . -}}

View file

@ -1,30 +0,0 @@
{{- if gt .Paginator.TotalPages 1 -}}
<ul class="pagination">
{{- .Scratch.Set "paginator.ellipsed" false -}}
{{- range $.Paginator.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}}
{{- $showNumber := or (le .PageNumber 1) (eq $right 0) -}}
{{- $showNumber := or $showNumber (and (gt .PageNumber (sub $.Paginator.PageNumber 3)) (lt .PageNumber (add $.Paginator.PageNumber 3))) -}}
{{- if $showNumber -}}
{{- $.Scratch.Set "paginator.ellipsed" false -}}
{{- $.Scratch.Set "paginator.shouldEllipse" false -}}
{{- else -}}
{{- $.Scratch.Set "paginator.shouldEllipse" (not ($.Scratch.Get "paginator.ellipsed") ) -}}
{{- $.Scratch.Set "paginator.ellipsed" true -}}
{{- end -}}
{{- if $showNumber -}}
<li class="page-item {{ if eq . $.Paginator }}active{{ end }}">
<span class="page-link">
<a href="{{ .URL }}">
{{- .PageNumber -}}
</a>
</span>
</li>
{{- else if ($.Scratch.Get "paginator.shouldEllipse") -}}
<li class="page-item ">
<span class="page-link" aria-hidden="true">&hellip;</span>
</li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}

View file

@ -1,22 +0,0 @@
{{- $analytics := .Scratch.Get "analytics" | default dict -}}
{{- if $analytics.enable -}}
{{- /* Google Analytics */ -}}
{{- with $analytics.google.id -}}
<script type="text/javascript">
window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());
gtag('config', '{{ . }}'{{ if $analytics.google.anonymizeIP }}, { 'anonymize_ip': true }{{ end }});
</script>
{{- printf "https://www.googletagmanager.com/gtag/js?id=%v" . | dict "Async" true "Source" | partial "plugin/script.html" -}}
{{- end -}}
{{- /* Fathom Analytics */ -}}
{{- with $analytics.fathom.id -}}
<script type="text/javascript">
window.fathom=window.fathom||function(){(fathom.q=fathom.q||[]).push(arguments);};
fathom('set', 'siteId', '{{ . }}');
fathom('trackPageview');
</script>
{{- dict "Source" ($analytics.fathom.server | default "cdn.usefathom.com" | printf "https://%v/tracker.js") "Async" true "Attr" "id=fathom-script" | partial "plugin/script.html" -}}
{{- end -}}
{{- end -}}

View file

@ -1,22 +0,0 @@
{{- $compatibility := .Site.Params.compatibility | default dict -}}
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
{{- /* Polyfill.io */ -}}
{{- if $compatibility.polyfill -}}
{{- $features := slice -}}
{{- range resources.Get "data/polyfill.yml" | transform.Unmarshal -}}
{{- range . -}}
{{- $features = $features | append . -}}
{{- end -}}
{{- end -}}
{{- with $features | uniq -}}
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%v" | dict "Source" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- end -}}
{{- /* object-fit-images */ -}}
{{- if $compatibility.objectFit -}}
{{- $source := $cdn.objectFitImagesJS | default "lib/object-fit-images/ofi.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}

View file

@ -1,13 +0,0 @@
{{- with .Class -}}
<i class="{{ . }}"></i>
{{- else -}}
{{- $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 -}}
{{- $src = (resources.Get $src | minify).RelPermalink -}}
{{- end -}}
<i data-svg-src="{{ $src }}"></i>
{{- end -}}

View file

@ -1,38 +0,0 @@
{{- /* lazysizes and lightgallery.js */ -}}
{{- $src := .Src -}}
{{- with dict "Path" .Src "Resources" .Resources | partial "function/resource.html" -}}
{{- $src = .RelPermalink -}}
{{- end -}}
{{- $small := .SrcSmall | default $src -}}
{{- with dict "Path" .SrcSmall "Resources" .Resources | partial "function/resource.html" -}}
{{- $small = .RelPermalink -}}
{{- end -}}
{{- $large := .SrcLarge | default $src -}}
{{- with dict "Path" .SrcLarge "Resources" .Resources | partial "function/resource.html" -}}
{{- $large = .RelPermalink -}}
{{- end -}}
{{- $alt := .Alt | default $src -}}
{{- $loading := resources.Get "svg/loading.svg" | minify -}}
{{- if .Linked -}}
<a class="lightgallery" href="{{ $large | safeURL }}" title="{{ .Title | default $alt }}" data-thumbnail="{{ $small | safeURL }}"{{ with .Caption }} data-sub-html="<h2>{{ . }}</h2>{{ with $.Title }}<p>{{ . }}</p>{{ end }}"{{ end }}{{ with .Rel }} rel="{{ . }}"{{ end }}>
<img
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
src="{{ $loading.RelPermalink }}"
data-src="{{ .Src | safeURL }}"
data-srcset="{{ $small | safeURL }}, {{ .Src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
data-sizes="auto"
alt="{{ $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }} />
</a>
{{- else -}}
<img
class="lazyload{{ with .Class }} {{ . }}{{ end }}"
src="{{ $loading.RelPermalink }}"
data-src="{{ .Src | safeURL }}"
data-srcset="{{ $small | safeURL }}, {{ .Src | safeURL }} 1.5x, {{ $large | safeURL }} 2x"
data-sizes="auto"
alt="{{ $alt }}"
title="{{ .Title | default $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }} />
{{- end -}}

View file

@ -1,9 +0,0 @@
{{- $rel := "" -}}
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if (urls.Parse .Destination).Host | or .Newtab }}{{ $rel = "noopener noreffer" }} target="_blank"{{ end }} rel="{{ $rel }}{{ with .Rel }} {{ . }}{{ end }}"{{ with .Class }} class="{{ . }}"{{ end }}>
{{- with .Icon -}}
{{- partial "plugin/icon.html" . -}}
{{- end -}}
{{- with .Content -}}
{{- . | safeHTML -}}
{{- end -}}
</a>

View file

@ -1,25 +0,0 @@
{{- if .Content -}}
<script type="text/javascript">
{{- .Content | safeJS -}}
</script>
{{- else if strings.HasPrefix .Source "<script" -}}
{{- safeHTML .Source -}}
{{- else -}}
{{- $src := .Source -}}
{{- $integrity := .Integrity -}}
{{- if (urls.Parse $src).Host | not -}}
{{- $resource := resources.Get $src -}}
{{- with .Template -}}
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
{{- end -}}
{{- if .Minify -}}
{{- $resource = $resource | minify -}}
{{- end -}}
{{- with .Fingerprint -}}
{{- $resource = $resource | fingerprint . -}}
{{- $integrity = $resource.Data.Integrity -}}
{{- end -}}
{{- $src = $resource.RelPermalink -}}
{{- end -}}
<script type="text/javascript" src="{{ $src }}"{{ if .Crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ if .Async }} async{{ end }}{{ if .Defer }} defer{{ end }}{{ with .Attr }} {{ . | safeHTMLAttr }}{{ end }}></script>
{{- end -}}

View file

@ -1,199 +0,0 @@
{{- $share := (.Scratch.Get "params").share | default dict -}}
{{- if $share.enable -}}
{{- /* 001: Twitter */ -}}
{{- if $share.Twitter -}}
<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 }}>
{{- dict "Class" "fab fa-twitter fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 002: Facebook */ -}}
{{- if $share.Facebook -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Facebook" data-sharer="facebook" data-url="{{ .Permalink }}"{{ with .Params.tags }} data-hashtag="{{ index . 0 }}"{{ end }}>
{{- dict "Class" "fab fa-facebook-square fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 003: Linkedin */ -}}
{{- if $share.Linkedin -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Linkedin" data-sharer="linkedin" data-url="{{ .Permalink }}">
{{- dict "Class" "fab fa-linkedin fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 004: WhatsApp */ -}}
{{- if $share.Whatsapp -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} WhatsApp" data-sharer="whatsapp" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-web>
{{- dict "Class" "fab fa-whatsapp fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 005: Viber */ -}}
{{- if $share.Viber -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Viber" data-sharer="viber" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-viber fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 006: Pinterest */ -}}
{{- if $share.Pinterest -}}
<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 }}>
{{- dict "Class" "fab fa-pinterest fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 007: Tumblr */ -}}
{{- if $share.Tumblr -}}
<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 }}>
{{- dict "Class" "fab fa-tumblr fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 008: Hacker News */ -}}
{{- if $share.Hackernews -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Hacker News" data-sharer="hackernews" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-hacker-news fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 009: Reddit */ -}}
{{- if $share.Reddit -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Reddit" data-sharer="reddit" data-url="{{ .Permalink }}">
{{- dict "Class" "fab fa-reddit fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 010: VK */ -}}
{{- if $share.VK -}}
<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 }}>
{{- dict "Class" "fab fa-vk fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 011: Buffer */ -}}
{{- if $share.Buffer -}}
<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 }}>
{{- dict "Class" "fab fa-buffer fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 012: Xing */ -}}
{{- if $share.Xing -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Xing" data-sharer="xing" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-xing fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 013: Line */ -}}
{{- if $share.Line -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Line" data-sharer="line" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Simpleicons" "line" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 014: Instapaper */ -}}
{{- if $share.Instapaper -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Instapaper" data-sharer="instapaper" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- dict "Simpleicons" "instapaper" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 015: Pocket */ -}}
{{- if $share.Pocket -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Pocket" data-sharer="pocket" data-url="{{ .Permalink }}">
{{- dict "Class" "fab fa-get-pocket fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 016: Digg */ -}}
{{- if $share.Digg -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
{{- dict "Class" "fab fa-digg fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 017: StumbleUpon */ -}}
{{- if $share.Stumbleupon -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-stumbleupon fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 018: Flipboard */ -}}
{{- if $share.Flipboard -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Flipboard" data-sharer="flipboard" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-flipboard fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 019: 微博 */ -}}
{{- if $share.Weibo -}}
<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 }}>
{{- dict "Class" "fab fa-weibo fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 020: 人人 */ -}}
{{- if $share.Renren -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
{{- dict "Class" "fab fa-renren fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 021: Myspace */ -}}
{{- if $share.Myspace -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- dict "Simpleicons" "myspace" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 022: Blogger */ -}}
{{- if $share.Blogger -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Blogger" data-sharer="blogger" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- dict "Class" "fab fa-blogger fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 023: 百度 */ -}}
{{- if $share.Baidu -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} 百度" data-sharer="baidu" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Simpleicons" "baidu" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 024: OK.RU */ -}}
{{- if $share.Odnoklassniki -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} OK.RU" data-sharer="okru" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-odnoklassniki fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 025: Evernote */ -}}
{{- if $share.Evernote -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Evernote" data-sharer="evernote" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-evernote fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 026: Skype */ -}}
{{- if $share.Skype -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Skype" data-sharer="skype" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
{{- dict "Class" "fab fa-skype fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 027: Trello */ -}}
{{- if $share.Trello -}}
<a href="javascript:void(0);" title="{{ T `shareOn` }} Trello" data-sharer="trello" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
{{- dict "Class" "fab fa-trello fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- /* 028: Mix */ -}}
{{- if $share.Mix -}}
<a href="//mix.com/add?url={{ .Permalink }}&amp;description={{ .Title }}" target="_blank" title="{{ T `shareOn` }} Mix">
{{- dict "Class" "fab fa-mix fa-fw" | partial "plugin/icon.html" -}}
</a>
{{- end -}}
{{- end -}}

View file

@ -1,11 +0,0 @@
{{- $destination := "" -}}
{{- with .Url -}}
{{- $destination = . | relLangURL -}}
{{- else -}}
{{- $template := .Template | default "%v" -}}
{{- with .Prefix -}}
{{- $template = . | strings.TrimSuffix "/" | printf "%v/%%v" -}}
{{- end -}}
{{- $destination = printf (string $template) .Id -}}
{{- end -}}
{{- dict "Destination" $destination "Rel" "me" | merge . | partial "plugin/link.html" -}}

View file

@ -1,31 +0,0 @@
{{- if strings.HasPrefix .Source "<link" -}}
{{- safeHTML .Source -}}
{{- else -}}
{{- $href := .Source -}}
{{- $integrity := .Integrity -}}
{{- $resource := 0 -}}
{{- if $href | and (not (urls.Parse $href).Host) -}}
{{- $resource = resources.Get $href -}}
{{- end -}}
{{- with .Content -}}
{{- $resource = resources.FromString $.Path . -}}
{{- end -}}
{{- if $resource -}}
{{- with .Template -}}
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
{{- end -}}
{{- with .ToCSS -}}
{{- $options := . | merge (dict "outputStyle" "compressed") -}}
{{- $resource = $resource | toCSS $options -}}
{{- end -}}
{{- if .Minify -}}
{{- $resource = $resource | minify -}}
{{- end -}}
{{- with .Fingerprint -}}
{{- $resource = $resource | fingerprint . -}}
{{- $integrity = $resource.Data.Integrity -}}
{{- end -}}
{{- $href = $resource.RelPermalink -}}
{{- end -}}
<link rel="stylesheet" href="{{ $href }}"{{ if .Crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ with .Attr }} {{ . | safeHTMLAttr }}{{ end }}>
{{- end -}}

View file

@ -1,36 +0,0 @@
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Author.name) -}}
<item>
<title>
{{- .Page.Title -}}
</title>
<link>
{{- .Page.Permalink -}}
</link>
<pubDate>
{{- .Page.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
</pubDate>
<author>
{{- .params.author | default (T "author") -}}
</author>
<guid>
{{- .Page.Permalink -}}
</guid>
<description>
{{- "<![CDATA[" | safeHTML -}}
{{- with $params.featuredimage -}}
<div class="featured-image">
<img src="{{ . | relURL }}" referrerpolicy="no-referrer">
</div>
{{- end -}}
{{- $content := .Page.Description -}}
{{- if $params.rssFullText -}}
{{- $content = dict "Content" .Page.Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" -}}
{{- else -}}
{{- with .Page.Summary -}}
{{- $content = dict "Content" . "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" -}}
{{- end -}}
{{- end -}}
{{- $content | replaceRE `<figure[^>]*>.*</figure>` "" | replaceRE `<img[^>]*( /)?>` "" | safeHTML -}}
{{- "]]>" | safeHTML -}}
</description>
</item>

View file

@ -1,4 +0,0 @@
{{- $this := .Scratch.Get "this" -}}
{{- $script := $this.script | default slice -}}
{{- $script = $script | append (slice .Data) -}}
{{- .Scratch.SetInMap "this" "script" $script -}}

View file

@ -1,4 +0,0 @@
{{- $this := .Scratch.Get "this" -}}
{{- $style := $this.style | default slice -}}
{{- $style = $style | append (slice .Data) -}}
{{- .Scratch.SetInMap "this" "style" $style -}}

View file

@ -1,72 +0,0 @@
{{- $params := .Scratch.Get "params" -}}
<div class="post-footer" id="post-footer">
<div class="post-info">
<div class="post-info-line">
<div class="post-info-mod">
<span>
{{- with .Site.Params.dateformat | default "2006-01-02" | .Lastmod.Format -}}
{{- dict "Date" . | T "updatedOnDate" -}}
{{- if $.Site.Params.gitRepo -}}
{{- with $.GitInfo -}}
&nbsp;<a class="git-hash" href="{{ printf `%v/commit/%v` $.Site.Params.gitRepo .Hash }}" target="_blank" title="commit by {{ .AuthorName }}({{ .AuthorEmail }}) {{ .Hash }}: {{ .Subject }}">
<i class="fas fa-hashtag fa-fw"></i>{{- .AbbreviatedHash -}}
</a>
{{- end -}}
{{- end -}}
{{- end -}}
</span>
</div>
<div class="post-info-license">
{{- with $params.license | string -}}
<span>
{{- . | safeHTML -}}
</span>
{{- end -}}
</div>
</div>
<div class="post-info-line">
<div class="post-info-md">
{{- if $params.linktomarkdown -}}
{{- with .OutputFormats.Get "markdown" -}}
<span>
<a class="link-to-markdown" href="{{ .RelPermalink }}" target="_blank">
{{- T "readMarkdown" -}}
</a>
</span>
{{- end -}}
{{- end -}}
</div>
<div class="post-info-share">
<span>
{{- partial "plugin/share.html" . -}}
</span>
</div>
</div>
</div>
<div class="post-info-more">
<section class="post-tags">
{{- with .Params.tags -}}
<i class="fas fa-tags fa-fw"></i>&nbsp;
{{- range $index, $value := . -}}
{{- if gt $index 0 }},&nbsp;{{ end -}}
{{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}}
<a href="{{ $tag.RelPermalink }}">{{ $tag.Title }}</a>
{{- end -}}
{{- end -}}
</section>
<section>
<span><a href="javascript:void(0);" onclick="window.history.back();">{{ T "back" }}</a></span>&nbsp;|&nbsp;<span><a href="{{ .Site.Home.RelPermalink }}">{{ T "home" }}</a></span>
</section>
</div>
<div class="post-nav">
{{- if .PrevInSection -}}
<a href="{{ .PrevInSection.RelPermalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw"></i>{{ .PrevInSection.Title }}</a>
{{- end -}}
{{ if .NextInSection }}
<a href="{{ .NextInSection.RelPermalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw"></i></a>
{{- end -}}
</div>
</div>