diff options
author | Christoph Cullmann <cullmann@kde.org> | 2022-10-21 21:01:11 +0200 |
---|---|---|
committer | Christoph Cullmann <cullmann@kde.org> | 2022-10-21 21:01:11 +0200 |
commit | 582a8a33aff644a6b07534aaf677973abc6f154c (patch) | |
tree | 069a34670b1b91041ef9f3fcb73192dd05c60963 /themes/LoveIt/layouts/partials | |
parent | 038eabdda56dbfdbbba4328ac035cc4d77e8d80d (diff) |
use different theme that is a lot slimer
Diffstat (limited to 'themes/LoveIt/layouts/partials')
33 files changed, 0 insertions, 1610 deletions
diff --git a/themes/LoveIt/layouts/partials/assets.html b/themes/LoveIt/layouts/partials/assets.html deleted file mode 100644 index 75b69c6..0000000 --- a/themes/LoveIt/layouts/partials/assets.html +++ /dev/null @@ -1,208 +0,0 @@ -{{- $params := .Scratch.Get "params" -}} -{{- $cdn := .Scratch.Get "cdn" | default dict -}} -{{- $fingerprint := .Scratch.Get "fingerprint" -}} -{{- $config := (.Scratch.Get "this").config -}} - -{{- /* 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 */ -}} -{{- if $params.lightgallery -}} - {{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/css/lightgallery-bundle.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/plugins/thumbnail/lg-thumbnail.min.js" -}} - {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} - {{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}} - {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} - {{- $config = dict "lightgallery" true | 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/index.umd.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/contrib/auto-render.min.js" -}} - {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} - {{- if $math.copyTex -}} - {{- $source := $cdn.katexCopyTexJS | default "lib/katex/contrib/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/contrib/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) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{equation}" "right" "\\end{equation}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{equation*}" "right" "\\end{equation*}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{align}" "right" "\\end{align}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{align*}" "right" "\\end{align*}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{alignat}" "right" "\\end{alignat}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{alignat*}" "right" "\\end{alignat*}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{gather}" "right" "\\end{gather}" "display" true) -}} - {{- $delimiters = $delimiters | append (dict "left" "\\begin{CD}" "right" "\\end{CD}" "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" -}} - {{- $_ := (resources.Get "lib/mermaid/mermaid.min.js.map").RelPermalink -}} -{{- 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" -}} - {{- $lightTheme := resources.Get "lib/echarts/theme/light.yml" | transform.Unmarshal -}} - {{- $darkTheme := resources.Get "lib/echarts/theme/dark.yml" | transform.Unmarshal -}} - {{- $config = dict "lightTheme" $lightTheme "darkTheme" $darkTheme | dict "echarts" | merge $config -}} -{{- 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.js" "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} - -{{- 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" . -}} diff --git a/themes/LoveIt/layouts/partials/comment.html b/themes/LoveIt/layouts/partials/comment.html deleted file mode 100644 index 2a52864..0000000 --- a/themes/LoveIt/layouts/partials/comment.html +++ /dev/null @@ -1,152 +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 "lib/valine/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"> - {{- $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?3" "Defer" true "Attr" $attr | partial "plugin/script.html" -}} - <noscript> - Please enable JavaScript to view the comments powered by <a href="https://comments.app/">Telegram Comments</a>. - </noscript> - </div> - {{- end -}} - - {{- /* Commento Comment System */ -}} - {{- $commento := $comment.commento | default dict -}} - {{- if $commento.enable -}} - <div id="commento" class="comment"></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" class="comment"></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 -}} - - {{- /* giscus Comment System */ -}} - {{- $giscus := $comment.giscus | default dict -}} - {{- if $giscus.enable -}} - <div id="giscus" class="comment"></div> - {{- $commentConfig = dict "repo" $giscus.repo | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = dict "repoId" $giscus.repoId | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = dict "category" $giscus.category | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = dict "categoryId" $giscus.categoryId | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.lang | default (T "valineLang") | dict "lang" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.mapping | default "pathname" | dict "mapping" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.reactionsEnabled | default "1" | dict "reactionsEnabled" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.emitMetadata | default "0" | dict "emitMetadata" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.inputPosition | default "bottom" | dict "inputPosition" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.lazyLoading | default false | dict "lazyLoading" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.lightTheme | default "github-light" | dict "lightTheme" | dict "giscus" | merge $commentConfig -}} - {{- $commentConfig = $giscus.darkTheme | default "github-dark" | dict "darkTheme" | dict "giscus" | merge $commentConfig -}} - <noscript> - Please enable JavaScript to view the comments powered by <a href="https://giscus.app">Giscus</a>. - </noscript> - {{- end -}} - </div> -{{- end -}} - -{{- dict "comment" $commentConfig | dict "config" | merge (.Scratch.Get "this") | .Scratch.Set "this" -}} diff --git a/themes/LoveIt/layouts/partials/footer.html b/themes/LoveIt/layouts/partials/footer.html deleted file mode 100644 index f21a197..0000000 --- a/themes/LoveIt/layouts/partials/footer.html +++ /dev/null @@ -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" aria-hidden="true"></i> LoveIt</a>` -}} - {{- dict "Hugo" $hugo "Theme" $theme | T "poweredBySome" | safeHTML }} - </div> - {{- end -}} - - <div class="footer-line" itemscope itemtype="http://schema.org/CreativeWork"> - {{- /* Copyright year */ -}} - {{- if ne .Site.Params.footer.copyright false -}} - <i class="far fa-copyright fa-fw" aria-hidden="true"></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"> <a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span> - {{- end -}} - - {{- /* License */ -}} - {{- with .Site.Params.footer.license -}} - | <span class="license">{{ . | safeHTML }}</span> - {{- end -}} - - {{- /* ICP */ -}} - {{- with .Site.Params.footer.icp -}} - <span class="icp-splitter"> | </span><br class="icp-br"/> - <span class="icp">{{ . | safeHTML }}</span> - {{- end -}} - </div> - </div> - </footer> -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/function/checkbox.html b/themes/LoveIt/layouts/partials/function/checkbox.html deleted file mode 100644 index c94f9a6..0000000 --- a/themes/LoveIt/layouts/partials/function/checkbox.html +++ /dev/null @@ -1,9 +0,0 @@ -{{- /* Checkbox unchecked */ -}} -{{- $old := `<input disabled="" type="checkbox">` -}} -{{- $new := `<i class="far fa-square fa-fw" aria-hidden="true"></i>` -}} -{{- $content := replace . $old $new -}} - -{{- /* Checkbox checked */ -}} -{{- $old = `<input checked="" disabled="" type="checkbox">` -}} -{{- $new = `<i class="far fa-check-square fa-fw" aria-hidden="true"></i>` -}} -{{- return replace $content $old $new -}} diff --git a/themes/LoveIt/layouts/partials/function/content.html b/themes/LoveIt/layouts/partials/function/content.html deleted file mode 100644 index 250a5b7..0000000 --- a/themes/LoveIt/layouts/partials/function/content.html +++ /dev/null @@ -1,23 +0,0 @@ -{{- $content := .Content -}} - -{{- if $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 -}} - -{{- end -}} - -{{- return $content -}} diff --git a/themes/LoveIt/layouts/partials/function/escape.html b/themes/LoveIt/layouts/partials/function/escape.html deleted file mode 100644 index 1ff794f..0000000 --- a/themes/LoveIt/layouts/partials/function/escape.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* Escape character */ -}} -{{- /* {?X} -> X */ -}} -{{- $REin := `\{\?(.)\}` -}} -{{- $REout := `$1` -}} -{{- return replaceRE $REin $REout . -}} diff --git a/themes/LoveIt/layouts/partials/function/fontawesome.html b/themes/LoveIt/layouts/partials/function/fontawesome.html deleted file mode 100644 index 2e14326..0000000 --- a/themes/LoveIt/layouts/partials/function/fontawesome.html +++ /dev/null @@ -1,14 +0,0 @@ -{{- /* Font Awesome */ -}} -{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw" aria-hidden="true"></i> */ -}} - -{{- $REin := ` (:\([\w- ]+?\):)` -}} -{{- $REout := ` $1` -}} -{{- $content := replaceRE $REin $REout . -}} - -{{- $REin = `(:\([\w- ]+?\):) ` -}} -{{- $REout = `$1 ` -}} -{{- $content = replaceRE $REin $REout . -}} - -{{- $REin = `:\(([\w- ]+?)\):` -}} -{{- $REout = `<i class="$1" aria-hidden="true"></i>` -}} -{{- return replaceRE $REin $REout $content -}} diff --git a/themes/LoveIt/layouts/partials/function/fraction.html b/themes/LoveIt/layouts/partials/function/fraction.html deleted file mode 100644 index 9aa85d0..0000000 --- a/themes/LoveIt/layouts/partials/function/fraction.html +++ /dev/null @@ -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 . -}} diff --git a/themes/LoveIt/layouts/partials/function/id.html b/themes/LoveIt/layouts/partials/function/id.html deleted file mode 100644 index e84ef9c..0000000 --- a/themes/LoveIt/layouts/partials/function/id.html +++ /dev/null @@ -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 -}} diff --git a/themes/LoveIt/layouts/partials/function/path.html b/themes/LoveIt/layouts/partials/function/path.html deleted file mode 100644 index ece426f..0000000 --- a/themes/LoveIt/layouts/partials/function/path.html +++ /dev/null @@ -1,3 +0,0 @@ -{{- /* https://discourse.gohugo.io/t/how-decode-urls-in-hugo/7549/4 */ -}} -{{- $URL := . | urlize | urls.Parse -}} -{{- return $URL.Path -}} diff --git a/themes/LoveIt/layouts/partials/function/resource.html b/themes/LoveIt/layouts/partials/function/resource.html deleted file mode 100644 index 2febef3..0000000 --- a/themes/LoveIt/layouts/partials/function/resource.html +++ /dev/null @@ -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 -}} diff --git a/themes/LoveIt/layouts/partials/function/ruby.html b/themes/LoveIt/layouts/partials/function/ruby.html deleted file mode 100644 index 49aa35b..0000000 --- a/themes/LoveIt/layouts/partials/function/ruby.html +++ /dev/null @@ -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 . -}} diff --git a/themes/LoveIt/layouts/partials/head/link.html b/themes/LoveIt/layouts/partials/head/link.html deleted file mode 100644 index e944cdd..0000000 --- a/themes/LoveIt/layouts/partials/head/link.html +++ /dev/null @@ -1,46 +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 -}} - -{{- /* style.min.css */ -}} -{{- $options := dict "Source" "css/style.scss" "Fingerprint" $fingerprint -}} -{{- $toCSS := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}} -{{- $options = dict "Context" . "ToCSS" $toCSS | merge $options -}} -{{- partial "plugin/style.html" $options -}} - -{{- /* Font Awesome */ -}} -{{- $source := $cdn.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}} -{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}} -{{- partial "plugin/style.html" $options -}} - -{{- /* Animate.css */ -}} -{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}} -{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}} -{{- partial "plugin/style.html" $options -}} diff --git a/themes/LoveIt/layouts/partials/head/meta.html b/themes/LoveIt/layouts/partials/head/meta.html deleted file mode 100644 index 0862b83..0000000 --- a/themes/LoveIt/layouts/partials/head/meta.html +++ /dev/null @@ -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 -}} diff --git a/themes/LoveIt/layouts/partials/head/seo.html b/themes/LoveIt/layouts/partials/head/seo.html deleted file mode 100644 index d431ad0..0000000 --- a/themes/LoveIt/layouts/partials/head/seo.html +++ /dev/null @@ -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 -}} diff --git a/themes/LoveIt/layouts/partials/header.html b/themes/LoveIt/layouts/partials/header.html deleted file mode 100644 index f8eca38..0000000 --- a/themes/LoveIt/layouts/partials/header.html +++ /dev/null @@ -1,186 +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/img.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.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" aria-hidden="true"></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" aria-hidden="true"></i> - </a> - <span class="search-button search-loading" id="search-loading-desktop"> - <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></i> - </span> - </span> - {{- end -}} - <a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}"> - <i class="fas fa-adjust fa-fw" aria-hidden="true"></i> - </a> - {{- if .Site.IsMultiLingual -}} - <a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}"> - <i class="fa fa-globe" aria-hidden="true"></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 -}} - </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/img.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" aria-hidden="true"></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" aria-hidden="true"></i> - </a> - <span class="search-button search-loading" id="search-loading-mobile"> - <i class="fas fa-spinner fa-fw fa-spin" aria-hidden="true"></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" aria-hidden="true"></i> - </a> - {{- if .Site.IsMultiLingual -}} - - <a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}"> - <i class="fa fa-globe fa-fw" aria-hidden="true"></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> - -{{- if .Site.Params.search.enable -}} - <div class="search-dropdown desktop"> - <div id="search-dropdown-desktop"></div> - </div> - <div class="search-dropdown mobile"> - <div id="search-dropdown-mobile"></div> - </div> -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/home/profile.html b/themes/LoveIt/layouts/partials/home/profile.html deleted file mode 100644 index 447b416..0000000 --- a/themes/LoveIt/layouts/partials/home/profile.html +++ /dev/null @@ -1,98 +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/img.html" -}} - </a> - {{- else -}} - {{- dict "Src" $avatar | partial "plugin/img.html" -}} - {{- end -}} - </div> - {{- end -}} - - {{- with $profile.title -}} - <h1 class="home-title"> - {{- . | safeHTML -}} - </h1> - {{- end -}} - - {{- with $profile.subtitle -}} - <div 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 -}} - {{- . | safeHTML -}} - {{- end -}} - </div> - {{- 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 -}} - {{- with $value.rel -}} - {{- $social = dict "Rel" . | 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> diff --git a/themes/LoveIt/layouts/partials/init.html b/themes/LoveIt/layouts/partials/init.html deleted file mode 100644 index f6794fb..0000000 --- a/themes/LoveIt/layouts/partials/init.html +++ /dev/null @@ -1,31 +0,0 @@ -{{- .Scratch.Set "version" "0.2.11" -}} - -{{- $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" . -}} diff --git a/themes/LoveIt/layouts/partials/paginator.html b/themes/LoveIt/layouts/partials/paginator.html deleted file mode 100644 index 170144f..0000000 --- a/themes/LoveIt/layouts/partials/paginator.html +++ /dev/null @@ -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">…</span> - </li> - {{- end -}} - {{- end -}} - </ul> -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/a.html b/themes/LoveIt/layouts/partials/plugin/a.html deleted file mode 100644 index 8dccaa7..0000000 --- a/themes/LoveIt/layouts/partials/plugin/a.html +++ /dev/null @@ -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>
\ No newline at end of file diff --git a/themes/LoveIt/layouts/partials/plugin/analytics.html b/themes/LoveIt/layouts/partials/plugin/analytics.html deleted file mode 100644 index 9b174ed..0000000 --- a/themes/LoveIt/layouts/partials/plugin/analytics.html +++ /dev/null @@ -1,43 +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 -}} - - {{- /* Plausible Analytics */ -}} - {{- with $analytics.plausible.dataDomain -}} - {{- dict "Source" "https://plausible.io/js/plausible.js" "Async" true "Defer" true "Attr" ($analytics.plausible.dataDomain | printf `data-domain="%v"`) | partial "plugin/script.html" -}} - {{- end -}} - - {{- /* Yandex Metrica */ -}} - {{- with $analytics.yandexMetrica.id -}} - <script type="text/javascript" > - (function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; - m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)}) - (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); - - ym({{ . }}, "init", { - clickmap:true, - trackLinks:true, - accurateTrackBounce:true - }); - </script> - <noscript><div><img src="https://mc.yandex.ru/watch/{{ . }}" style="position:absolute; left:-9999px;" alt="" /></div></noscript> - {{- end -}} -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/compatibility.html b/themes/LoveIt/layouts/partials/plugin/compatibility.html deleted file mode 100644 index b460f18..0000000 --- a/themes/LoveIt/layouts/partials/plugin/compatibility.html +++ /dev/null @@ -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 -}} diff --git a/themes/LoveIt/layouts/partials/plugin/h-card.html b/themes/LoveIt/layouts/partials/plugin/h-card.html deleted file mode 100644 index 6613032..0000000 --- a/themes/LoveIt/layouts/partials/plugin/h-card.html +++ /dev/null @@ -1,15 +0,0 @@ -{{- $rel := .Rel -}} -{{- $nick := .Nickname -}} -{{- $text := .Text -}} -{{- $n := .Nickname | default .Name | default .Email | default .URL | default "👀" -}} -<span class="h-card{{ with .Class }} {{ . }}{{- end -}}"> -{{- with .URL -}}<a href="{{ . }}" class="u-url url"{{ with $rel }} rel="{{ . }}"{{- end -}}{{ with $text }} title="{{ . }}"{{ end }}>{{- else -}}{{- with .Email -}}<a href="mailto:{{ . }}" class="email"{{ with $text }} title="{{ . }}"{{ end }}>{{- end -}}{{- end -}} -{{- with .Image -}}<img class="u-photo photo" src="{{ . }}" alt="{{ $n }}">{{- else -}}<i class="far fa-user-circle" aria-hidden="true"></i>{{ end -}}  -{{- with .Name -}}<span class="p-name fn">{{ . }}</span>{{ with $nick }} ({{- end -}}{{- end -}} -{{- with .Nickname -}}<span class="p-nickname nickname">{{ . }}</span>{{- end -}} -{{- with .Name -}}{{ with $nick }}){{- end -}}{{- end -}} -{{- with .URL -}}</a>{{- else -}}{{- with .Email -}}</a>{{- end -}}{{- end -}} -{{- with .Email }} - <a href="mailto:{{ . }}" class="email"><span class="u-email">{{ . }}</span></a> -{{- end -}} -</span>
\ No newline at end of file diff --git a/themes/LoveIt/layouts/partials/plugin/icon.html b/themes/LoveIt/layouts/partials/plugin/icon.html deleted file mode 100644 index c5f98db..0000000 --- a/themes/LoveIt/layouts/partials/plugin/icon.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- with .Class -}} - <i class="{{ . }}" aria-hidden="true"></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 }}" aria-hidden="true"></i> -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/img.html b/themes/LoveIt/layouts/partials/plugin/img.html deleted file mode 100644 index 8468583..0000000 --- a/themes/LoveIt/layouts/partials/plugin/img.html +++ /dev/null @@ -1,46 +0,0 @@ -{{- /* lazysizes and lightgallery */ -}} -{{- $src := .Src -}} -{{- $width := .Width -}} -{{- $height := .Height -}} -{{- with dict "Path" $src "Resources" .Resources | partial "function/resource.html" -}} - {{- $src = .RelPermalink -}} - {{- $width = $width | default .Width -}} - {{- $height = $height | default .Height -}} -{{- 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 $width }} width="{{ . }}"{{ end }} - {{- with $height }} height="{{ . }}"{{ 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 $width }} width="{{ . }}"{{ end }} - {{- with $height }} height="{{ . }}"{{ end }} /> -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/script.html b/themes/LoveIt/layouts/partials/plugin/script.html deleted file mode 100644 index 9b9fa37..0000000 --- a/themes/LoveIt/layouts/partials/plugin/script.html +++ /dev/null @@ -1,41 +0,0 @@ -{{- with .Content -}} - <script type="text/javascript">{{ . | 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 -}} - {{- $attrs := printf `src="%v"` $src -}} - {{- if .Crossorigin -}} - {{- $attrs = ` crossorigin="anonymous"` | add $attrs -}} - {{- end -}} - {{- with $integrity -}} - {{- $attrs = printf ` integrity="%v"` . | add $attrs -}} - {{- end -}} - {{- if .Async -}} - {{- $attrs = " async" | add $attrs -}} - {{- end -}} - {{- if .Defer -}} - {{- $attrs = " defer" | add $attrs -}} - {{- end -}} - {{- with .Attr -}} - {{- $attrs = add " " . | add $attrs -}} - {{- end -}} - <script type="text/javascript" {{ $attrs | safeHTMLAttr }}></script> - {{- end -}} -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/share.html b/themes/LoveIt/layouts/partials/plugin/share.html deleted file mode 100644 index fd29589..0000000 --- a/themes/LoveIt/layouts/partials/plugin/share.html +++ /dev/null @@ -1,171 +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: 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 -}} - - {{- /* 017: 微博 */ -}} - {{- 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 -}} - - {{- /* 018: 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 -}} - - {{- /* 019: 百度 */ -}} - {{- 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 -}} - - {{- /* 020: 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 -}} - - {{- /* 021: 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 -}} - - {{- /* 022: 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 -}} - - {{- /* 023: 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 -}} - - {{- /* 024: Mix */ -}} - {{- if $share.Mix -}} - <a href="//mix.com/add?url={{ .Permalink }}&description={{ .Title }}" target="_blank" title="{{ T `shareOn` }} Mix"> - {{- dict "Class" "fab fa-mix fa-fw" | partial "plugin/icon.html" -}} - </a> - {{- end -}} -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/plugin/social.html b/themes/LoveIt/layouts/partials/plugin/social.html deleted file mode 100644 index 4b74a94..0000000 --- a/themes/LoveIt/layouts/partials/plugin/social.html +++ /dev/null @@ -1,15 +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 -}} -{{- $rel := "me" -}} -{{- with .Rel -}} - {{- $rel = printf "%v %v" $rel . -}} -{{- end -}} -{{- dict "Destination" $destination "Rel" $rel | merge . | partial "plugin/a.html" -}} diff --git a/themes/LoveIt/layouts/partials/plugin/style.html b/themes/LoveIt/layouts/partials/plugin/style.html deleted file mode 100644 index cbd89d9..0000000 --- a/themes/LoveIt/layouts/partials/plugin/style.html +++ /dev/null @@ -1,46 +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 -}} - {{- $attrs := printf `href="%v"` $href -}} - {{- if .Crossorigin -}} - {{- $attrs = ` crossorigin="anonymous"` | add $attrs -}} - {{- end -}} - {{- with $integrity -}} - {{- $attrs = printf ` integrity="%v"` . | add $attrs -}} - {{- end -}} - {{- with .Attr -}} - {{- $attrs = add " " . | add $attrs -}} - {{- end -}} - {{- if .Preload -}} - <link rel="preload" {{ $attrs | safeHTMLAttr }} as="style" onload="this.onload=null;this.rel='stylesheet'"> - <noscript><link rel="stylesheet" {{ $attrs | safeHTMLAttr }}></noscript> - {{- else -}} - <link rel="stylesheet" {{ $attrs | safeHTMLAttr }}> - {{- end -}} -{{- end -}} diff --git a/themes/LoveIt/layouts/partials/rss/item.html b/themes/LoveIt/layouts/partials/rss/item.html deleted file mode 100644 index 7af54d2..0000000 --- a/themes/LoveIt/layouts/partials/rss/item.html +++ /dev/null @@ -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> diff --git a/themes/LoveIt/layouts/partials/scratch/script.html b/themes/LoveIt/layouts/partials/scratch/script.html deleted file mode 100644 index 480ad2f..0000000 --- a/themes/LoveIt/layouts/partials/scratch/script.html +++ /dev/null @@ -1,4 +0,0 @@ -{{- $this := .Scratch.Get "this" -}} -{{- $script := $this.script | default slice -}} -{{- $script = $script | append (slice .Data) -}} -{{- .Scratch.SetInMap "this" "script" $script -}} diff --git a/themes/LoveIt/layouts/partials/scratch/style.html b/themes/LoveIt/layouts/partials/scratch/style.html deleted file mode 100644 index 8989ce1..0000000 --- a/themes/LoveIt/layouts/partials/scratch/style.html +++ /dev/null @@ -1,4 +0,0 @@ -{{- $this := .Scratch.Get "this" -}} -{{- $style := $this.style | default slice -}} -{{- $style = $style | append (slice .Data) -}} -{{- .Scratch.SetInMap "this" "style" $style -}} diff --git a/themes/LoveIt/layouts/partials/single/footer.html b/themes/LoveIt/layouts/partials/single/footer.html deleted file mode 100644 index 1ce50db..0000000 --- a/themes/LoveIt/layouts/partials/single/footer.html +++ /dev/null @@ -1,85 +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 -}} - <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" aria-hidden="true"></i>{{- .AbbreviatedHash -}} - </a> - {{- end -}} - {{- end -}} - {{- end -}} - </span> - </div> - {{- with $params.license | string -}} - <div class="post-info-license"> - <span> - {{- . | safeHTML -}} - </span> - </div> - {{- end -}} - </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" aria-hidden="true"></i> - {{- range $index, $value := . -}} - {{- if gt $index 0 }}, {{ 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> | <span><a href="{{ .Site.Home.RelPermalink }}">{{ T "home" }}</a></span> - </section> - </div> - - <div class="post-nav"> - {{- $prevPage := false -}} - {{- $nextPage := false -}} - {{- if or (.Params.prev) (.Params.next) -}} - {{- with .Params.prev -}} - {{- $prevPage = $.Site.GetPage . -}} - {{- end -}} - {{- with .Params.next -}} - {{- $nextPage = $.Site.GetPage . -}} - {{- end -}} - {{- else -}} - {{- $prevPage = .PrevInSection -}} - {{- $nextPage = .NextInSection -}} - {{- end -}} - {{- with $prevPage -}} - <a href="{{ .RelPermalink }}" class="prev" rel="prev" title="{{ .Title }}"><i class="fas fa-angle-left fa-fw" aria-hidden="true"></i>{{ .Title | emojify }}</a> - {{- end -}} - {{ with $nextPage }} - <a href="{{ .RelPermalink }}" class="next" rel="next" title="{{ .Title }}">{{ .Title | emojify }}<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a> - {{- end -}} - </div> -</div> |