mirror of
https://github.com/idanoo/m2.nz
synced 2025-07-03 05:42:15 +00:00
Update Theme
This commit is contained in:
parent
a212477863
commit
d47be661bd
212 changed files with 13069 additions and 8406 deletions
|
@ -3,10 +3,6 @@
|
|||
{{- $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 -}}
|
||||
|
@ -37,8 +33,6 @@
|
|||
{{- /* lazysizes */ -}}
|
||||
{{- $source := $cdn.lazysizesJS | default "lib/lazysizes/lazysizes.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $source := $cdn.lazysizesParentFitJS | default "lib/lazysizes/ls.parent-fit.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
|
||||
{{- /* twemoji */ -}}
|
||||
{{- if $params.twemoji -}}
|
||||
|
@ -47,17 +41,17 @@
|
|||
{{- $config = dict "twemoji" true | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* lightgallery.js */ -}}
|
||||
{{- /* lightgallery */ -}}
|
||||
{{- if $params.lightgallery -}}
|
||||
{{- $source := $cdn.lightgalleryCSS | default "lib/lightgallery/lightgallery.min.css" -}}
|
||||
{{- $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/lg-thumbnail.min.js" -}}
|
||||
{{- $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/lg-zoom.min.js" -}}
|
||||
{{- $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 "selector" ".lightgallery" "speed" 400 "hideBarsDelay" 2000 "thumbnail" true "exThumbImage" "data-thumbnail" "thumbWidth" 80 "thumbContHeight" 80 "actualSize" false | dict "lightGallery" | merge $config -}}
|
||||
{{- $config = dict "lightgallery" true | merge $config -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $code := $params.code | default dict -}}
|
||||
|
@ -79,7 +73,7 @@
|
|||
{{- /* TypeIt */ -}}
|
||||
{{- with (.Scratch.Get "this").typeitMap -}}
|
||||
{{- $typeit := $.Site.Params.typeit -}}
|
||||
{{- $source := $cdn.typeitJS | default "lib/typeit/typeit.min.js" -}}
|
||||
{{- $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 -}}
|
||||
|
@ -96,16 +90,14 @@
|
|||
{{- 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" -}}
|
||||
{{- $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.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" -}}
|
||||
{{- $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/mhchem.min.js" -}}
|
||||
{{- $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) -}}
|
||||
|
@ -138,8 +130,9 @@
|
|||
{{- 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" -}}
|
||||
{{- $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 */ -}}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
{{- 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 -}}
|
||||
{{- $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>
|
||||
|
@ -77,51 +77,73 @@
|
|||
{{- /* 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>
|
||||
<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"></div>
|
||||
<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 System */ -}}
|
||||
{{- $utterances := $comment.utterances | default dict -}}
|
||||
{{- if $utterances.enable -}}
|
||||
<div id="utterances"></div>
|
||||
<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>.
|
||||
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>
|
||||
|
|
|
@ -29,23 +29,18 @@
|
|||
<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 -}}
|
||||
{{- $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" -}}
|
||||
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
|
||||
{{- partial "plugin/style.html" $style -}}
|
||||
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
|
||||
{{- partial "plugin/style.html" $options -}}
|
||||
|
||||
{{- /* Animate.css */ -}}
|
||||
{{- $source := $cdn.animateCSS | default "lib/animate/animate.min.css" -}}
|
||||
{{- $style := dict "Source" $source "Fingerprint" $fingerprint -}}
|
||||
{{- partial "plugin/style.html" $style -}}
|
||||
{{- $options := dict "Source" $source "Fingerprint" $fingerprint "Preload" true -}}
|
||||
{{- partial "plugin/style.html" $options -}}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
||||
{{- with .Site.Params.header.title -}}
|
||||
{{- with .logo -}}
|
||||
{{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" . "Class" "logo" | partial "plugin/img.html" -}}
|
||||
{{- end -}}
|
||||
{{- with .pre -}}
|
||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||
|
@ -39,29 +39,7 @@
|
|||
{{- 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" 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 -}}
|
||||
|
||||
{{- 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">
|
||||
|
@ -79,6 +57,28 @@
|
|||
<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>
|
||||
|
@ -92,7 +92,7 @@
|
|||
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
|
||||
{{- with .Site.Params.header.title -}}
|
||||
{{- with .logo -}}
|
||||
{{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" . "Class" "logo" | partial "plugin/img.html" -}}
|
||||
{{- end -}}
|
||||
{{- with .pre -}}
|
||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||
|
@ -150,9 +150,9 @@
|
|||
<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" }}">
|
||||
{{- .Language.LanguageName -}}
|
||||
<i class="fas fa-chevron-right fa-fw" aria-hidden="true"></i>
|
||||
<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 */ -}}
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
{{- $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" -}}
|
||||
{{- dict "Src" $avatar | partial "plugin/img.html" -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" $avatar | partial "plugin/img.html" -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -34,7 +34,7 @@
|
|||
<div id="{{ $id }}" class="typeit"></div>
|
||||
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
||||
{{- else -}}
|
||||
{{- . -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
@ -71,6 +71,9 @@
|
|||
{{- 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 -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- .Scratch.Set "version" "0.2.10" -}}
|
||||
{{- .Scratch.Set "version" "0.2.11" -}}
|
||||
|
||||
{{- $params := .Params | merge .Site.Params.page -}}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{{- $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 }}>
|
||||
<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>
|
||||
</a>
|
|
@ -19,4 +19,25 @@
|
|||
</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 -}}
|
||||
|
|
15
themes/LoveIt/layouts/partials/plugin/h-card.html
Normal file
15
themes/LoveIt/layouts/partials/plugin/h-card.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{- $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>
|
|
@ -1,7 +1,11 @@
|
|||
{{- /* lazysizes and lightgallery.js */ -}}
|
||||
{{- /* lazysizes and lightgallery */ -}}
|
||||
{{- $src := .Src -}}
|
||||
{{- with dict "Path" .Src "Resources" .Resources | partial "function/resource.html" -}}
|
||||
{{- $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 -}}
|
||||
|
@ -21,18 +25,22 @@
|
|||
<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-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 }} />
|
||||
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-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 }} />
|
||||
title="{{ .Title | default $alt }}"
|
||||
{{- with $width }} width="{{ . }}"{{ end }}
|
||||
{{- with $height }} height="{{ . }}"{{ end }} />
|
||||
{{- end -}}
|
|
@ -1,25 +1,41 @@
|
|||
{{- if .Content -}}
|
||||
<script type="text/javascript">
|
||||
{{- .Content | safeJS -}}
|
||||
</script>
|
||||
{{- else if strings.HasPrefix .Source "<script" -}}
|
||||
{{- safeHTML .Source -}}
|
||||
{{- with .Content -}}
|
||||
<script type="text/javascript">{{ . | safeJS }}</script>
|
||||
{{- else -}}
|
||||
{{- $src := .Source -}}
|
||||
{{- $integrity := .Integrity -}}
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $resource := resources.Get $src -}}
|
||||
{{- with .Template -}}
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate . $.Context -}}
|
||||
{{- 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 -}}
|
||||
{{- if .Minify -}}
|
||||
{{- $resource = $resource | minify -}}
|
||||
{{- $attrs := printf `src="%v"` $src -}}
|
||||
{{- if .Crossorigin -}}
|
||||
{{- $attrs = ` crossorigin="anonymous"` | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- with .Fingerprint -}}
|
||||
{{- $resource = $resource | fingerprint . -}}
|
||||
{{- $integrity = $resource.Data.Integrity -}}
|
||||
{{- with $integrity -}}
|
||||
{{- $attrs = printf ` integrity="%v"` . | add $attrs -}}
|
||||
{{- end -}}
|
||||
{{- $src = $resource.RelPermalink -}}
|
||||
{{- 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 -}}
|
||||
<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 -}}
|
||||
|
|
|
@ -8,4 +8,8 @@
|
|||
{{- end -}}
|
||||
{{- $destination = printf (string $template) .Id -}}
|
||||
{{- end -}}
|
||||
{{- dict "Destination" $destination "Rel" "me" | merge . | partial "plugin/link.html" -}}
|
||||
{{- $rel := "me" -}}
|
||||
{{- with .Rel -}}
|
||||
{{- $rel = printf "%v %v" $rel . -}}
|
||||
{{- end -}}
|
||||
{{- dict "Destination" $destination "Rel" $rel | merge . | partial "plugin/a.html" -}}
|
||||
|
|
|
@ -27,5 +27,20 @@
|
|||
{{- end -}}
|
||||
{{- $href = $resource.RelPermalink -}}
|
||||
{{- end -}}
|
||||
<link rel="stylesheet" href="{{ $href }}"{{ if .Crossorigin }} crossorigin="anonymous"{{ end }}{{ with $integrity }} integrity="{{ . }}"{{ end }}{{ with .Attr }} {{ . | safeHTMLAttr }}{{ 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 -}}
|
||||
|
|
|
@ -62,11 +62,24 @@
|
|||
</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" aria-hidden="true"></i>{{ .PrevInSection.Title }}</a>
|
||||
{{- $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 -}}
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{ .NextInSection.RelPermalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw" aria-hidden="true"></i></a>
|
||||
{{- 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue