Merge branch 'master' into pr/khusika/545
# Conflicts: # exampleSite/config.toml
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<h1 id="error-emoji"></h1>
|
||||
<p class="error-text">
|
||||
{{- T "pageNotFoundText" -}}
|
||||
<a href="javascript:void(0);" title="{{ T `back` }}" onclick="window.history.back();"><i class="far fa-hand-point-left fa-fw"></i></a>
|
||||
<a href="javascript:void(0);" title="{{ T `back` }}" onclick="window.history.back();"><i class="far fa-hand-point-left fa-fw" aria-hidden="true"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{- if .Title -}}
|
||||
<figure>
|
||||
{{- dict "Src" .Destination "Title" .Text "Caption" .Title "Linked" true "Resources" .Page.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" .Destination "Title" .Text "Caption" .Title "Linked" true "Resources" .Page.Resources | partial "plugin/img.html" -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- .Title | safeHTML -}}
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- dict "Src" .Destination "Title" .Text "Resources" .Page.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" .Destination "Title" .Text "Resources" .Page.Resources | partial "plugin/img.html" -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
{{- $destination = .RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- $options := dict "Destination" $destination "Title" .Title "Content" .Text -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- partial "plugin/a.html" $options -}}
|
||||
|
||||
@@ -6,16 +6,13 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noodp" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<title>
|
||||
{{- block "title" . }}{{ .Site.Title }}{{ end -}}
|
||||
</title>
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{- partial "head/meta.html" . -}}
|
||||
{{- partial "head/link.html" . -}}
|
||||
{{- partial "head/seo.html" . -}}
|
||||
</head>
|
||||
<body header-desktop="{{ .Site.Params.header.desktopMode }}" header-mobile="{{ .Site.Params.header.mobileMode }}">
|
||||
<body data-header-desktop="{{ .Site.Params.header.desktopMode }}" data-header-mobile="{{ .Site.Params.header.mobileMode }}">
|
||||
{{- /* Check theme isDark before body rendering */ -}}
|
||||
{{- $theme := .Site.Params.defaulttheme -}}
|
||||
<script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>
|
||||
@@ -36,12 +33,12 @@
|
||||
<div id="fixed-buttons">
|
||||
{{- /* top button */ -}}
|
||||
<a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}">
|
||||
<i class="fas fa-arrow-up fa-fw"></i>
|
||||
<i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
{{- /* comment button */ -}}
|
||||
<a href="#" id="view-comments" class="fixed-button" title="{{ T `viewComments` }}">
|
||||
<i class="fas fa-comment fa-fw"></i>
|
||||
<i class="fas fa-comment fa-fw" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
<h2 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}}
|
||||
</h2>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{- $params := .Scratch.Get "params" -}}
|
||||
<div class="page single special">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animated pulse faster">
|
||||
<h1 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- .Title -}}
|
||||
</h1>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{{- with $image -}}
|
||||
<div class="featured-image-preview">
|
||||
<a href="{{ $.RelPermalink }}">
|
||||
{{- dict "Src" . "Title" $.Description "Resources" $.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" . "Title" $.Description "Resources" $.Resources | partial "plugin/img.html" -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
@@ -28,7 +28,7 @@
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- partial "plugin/a.html" $options -}}
|
||||
</span>
|
||||
|
||||
{{- with .Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format -}}
|
||||
@@ -40,7 +40,7 @@
|
||||
{{- $categories := slice -}}
|
||||
{{- range .Params.categories -}}
|
||||
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
|
||||
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
|
||||
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw" aria-hidden="true"></i>%v</a>` $category.RelPermalink $category.Title) -}}
|
||||
{{- end -}}
|
||||
{{- with delimit $categories " " -}}
|
||||
<span class="post-category">
|
||||
@@ -63,7 +63,7 @@
|
||||
<a href="{{ .RelPermalink }}">{{ T "readMore" }}</a>
|
||||
{{- with .Params.tags -}}
|
||||
<div class="post-tags">
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
<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 -}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{{- $profile := .Site.Params.home.profile -}}
|
||||
{{- $posts := .Site.Params.home.posts -}}
|
||||
|
||||
<div class="page home"{{ if ne $posts.enable false }} posts{{ end }}>
|
||||
<div class="page home"{{ if ne $posts.enable false }} data-home="posts"{{ end }}>
|
||||
{{- /* Profile */ -}}
|
||||
{{- if ne $profile.enable false -}}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
|
||||
@@ -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 -}}
|
||||
@@ -45,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" -}}
|
||||
{{- 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/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/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 -}}
|
||||
@@ -77,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 -}}
|
||||
@@ -107,6 +103,14 @@
|
||||
{{- 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 -}}
|
||||
@@ -121,16 +125,16 @@
|
||||
{{- if (.Scratch.Get "this").mermaid -}}
|
||||
{{- $source := $cdn.mermaidJS | default "lib/mermaid/mermaid.min.js" -}}
|
||||
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $options := dict "targetPath" "lib/mermaid/mermaid.min.css" "enableSourceMap" true -}}
|
||||
{{- dict "Source" "lib/mermaid/mermaid.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
|
||||
{{- $_ := (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" -}}
|
||||
{{- $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 */ -}}
|
||||
@@ -189,8 +193,7 @@
|
||||
{{- $config | jsonify | printf "window.config=%s;" | dict "Content" | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
|
||||
{{- /* Theme script */ -}}
|
||||
{{- dict "Source" "js/theme.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
|
||||
{{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}}
|
||||
{{- 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" -}}
|
||||
|
||||
@@ -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>
|
||||
@@ -104,7 +104,7 @@
|
||||
{{- /* 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>.
|
||||
@@ -114,7 +114,7 @@
|
||||
{{- /* 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 -}}
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
{{- if ne .Site.Params.footer.hugo false -}}
|
||||
<div class="footer-line">
|
||||
{{- $hugo := printf `<a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo %v">Hugo</a>` hugo.Version -}}
|
||||
{{- $theme := .Scratch.Get "version" | printf `<a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt %v"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>` -}}
|
||||
{{- $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">
|
||||
<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"></i>
|
||||
<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 -}}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{- /* Checkbox unchecked */ -}}
|
||||
{{- $old := `<input disabled="" type="checkbox">` -}}
|
||||
{{- $new := `<i class="far fa-square fa-fw"></i>` -}}
|
||||
{{- $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"></i>` -}}
|
||||
{{- $new = `<i class="far fa-check-square fa-fw" aria-hidden="true"></i>` -}}
|
||||
{{- return replace $content $old $new -}}
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
{{- $content := .Content -}}
|
||||
|
||||
{{- if .Ruby -}}
|
||||
{{- $content = partial "function/ruby.html" $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 -}}
|
||||
|
||||
{{- if .Fraction -}}
|
||||
{{- $content = partial "function/fraction.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Fontawesome -}}
|
||||
{{- $content = partial "function/fontawesome.html" $content -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $content = partial "function/checkbox.html" $content -}}
|
||||
|
||||
{{- $content = partial "function/escape.html" $content -}}
|
||||
|
||||
{{- return $content -}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- /* Font Awesome */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw"></i> */ -}}
|
||||
{{- /* :(far fa-circle): -> <i class="far fa-circle fa-fw" aria-hidden="true"></i> */ -}}
|
||||
|
||||
{{- $REin := ` (:\([\w- ]+?\):)` -}}
|
||||
{{- $REout := ` $1` -}}
|
||||
@@ -10,5 +10,5 @@
|
||||
{{- $content = replaceRE $REin $REout . -}}
|
||||
|
||||
{{- $REin = `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout = `<i class="$1"></i>` -}}
|
||||
{{- $REout = `<i class="$1" aria-hidden="true"></i>` -}}
|
||||
{{- return replaceRE $REin $REout $content -}}
|
||||
|
||||
@@ -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>
|
||||
@@ -42,7 +42,7 @@
|
||||
{{- if .Site.IsMultiLingual -}}
|
||||
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
|
||||
{{- .Language.LanguageName -}}
|
||||
<i class="fas fa-chevron-right fa-fw"></i>
|
||||
<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 */ -}}
|
||||
@@ -66,18 +66,18 @@
|
||||
<span class="menu-item search" id="search-desktop">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-desktop">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="{{ T `search` }}">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
<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"></i>
|
||||
<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"></i>
|
||||
<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"></i>
|
||||
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
|
||||
</a>
|
||||
</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>
|
||||
@@ -122,13 +122,13 @@
|
||||
<div class="search mobile" id="search-mobile">
|
||||
<input type="text" placeholder="{{ .Site.Params.search.placeholder | default (T `searchPlaceholder`) }}" id="search-input-mobile">
|
||||
<a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="{{ T `search` }}">
|
||||
<i class="fas fa-search fa-fw"></i>
|
||||
<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"></i>
|
||||
<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"></i>
|
||||
<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">
|
||||
@@ -147,12 +147,12 @@
|
||||
</a>
|
||||
{{- end -}}
|
||||
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
|
||||
<i class="fas fa-adjust fa-fw"></i>
|
||||
<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"></i>
|
||||
<i class="fas fa-chevron-right 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 */ -}}
|
||||
@@ -175,9 +175,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="search-dropdown desktop">
|
||||
<div id="search-dropdown-desktop"></div>
|
||||
</div>
|
||||
<div class="search-dropdown mobile">
|
||||
<div id="search-dropdown-mobile"></div>
|
||||
</div>
|
||||
|
||||
{{- 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 -}}
|
||||
|
||||
@@ -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 -}}
|
||||
@@ -28,7 +28,7 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- with $profile.subtitle -}}
|
||||
<h2 class="home-subtitle">
|
||||
<div class="home-subtitle">
|
||||
{{- if $profile.typeit -}}
|
||||
{{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}}
|
||||
<div id="{{ $id }}" class="typeit"></div>
|
||||
@@ -36,7 +36,7 @@
|
||||
{{- else -}}
|
||||
{{- . | safeHTML -}}
|
||||
{{- end -}}
|
||||
</h2>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if $profile.social -}}
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
{{- .Scratch.Set "version" "0.2.10" -}}
|
||||
|
||||
{{- /* LoveIt theme version detection */ -}}
|
||||
{{- $VERSION := "0.2.X" -}}
|
||||
{{- if eq .Site .Sites.First -}}
|
||||
{{- if not .Site.Params.version -}}
|
||||
{{- errorf "Configuration Error 配置文件错误\n\nYou haven't configured the LoveIt version param correctly yet. See https://hugoloveit.com/theme-documentation-basics/#basic-configuration\n你还没有正确配置 LoveIt 的版本参数. 参考 https://hugoloveit.com/zh-cn/theme-documentation-basics/#basic-configuration\n" -}}
|
||||
{{- else if ne .Site.Params.version $VERSION -}}
|
||||
{{- errorf (printf "Compatibility Error 兼容性错误\n\n%v -> %v:\nYou have an incompatible update. See https://github.com/dillonzq/LoveIt/releases\n你进行了一次不兼容的更新. 参考 https://github.com/dillonzq/LoveIt/releases\n" .Site.Params.version $VERSION) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- .Scratch.Set "version" "0.2.11" -}}
|
||||
|
||||
{{- $params := .Params | merge .Site.Params.page -}}
|
||||
|
||||
|
||||
@@ -19,4 +19,9 @@
|
||||
</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 -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- with .Class -}}
|
||||
<i class="{{ . }}"></i>
|
||||
<i class="{{ . }}" aria-hidden="true"></i>
|
||||
{{- else -}}
|
||||
{{- $src := .Src -}}
|
||||
{{- with .Simpleicons -}}
|
||||
@@ -9,5 +9,5 @@
|
||||
{{- if (urls.Parse $src).Host | not -}}
|
||||
{{- $src = (resources.Get $src | minify).RelPermalink -}}
|
||||
{{- end -}}
|
||||
<i data-svg-src="{{ $src }}"></i>
|
||||
<i data-svg-src="{{ $src }}" aria-hidden="true"></i>
|
||||
{{- end -}}
|
||||
|
||||
@@ -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 -}}
|
||||
|
||||
@@ -106,91 +106,63 @@
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 016: Digg */ -}}
|
||||
{{- if $share.Digg -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Digg" data-sharer="digg" data-url="{{ .Permalink }}">
|
||||
{{- dict "Class" "fab fa-digg fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 017: StumbleUpon */ -}}
|
||||
{{- if $share.Stumbleupon -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} StumbleUpon" data-sharer="stumbleupon" data-url="{{ .Permalink }}" data-title="{{ .Title }}">
|
||||
{{- dict "Class" "fab fa-stumbleupon fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 018: Flipboard */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 019: 微博 */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 020: 人人 */ -}}
|
||||
{{- if $share.Renren -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} 人人" data-sharer="renren" data-url="{{ .Permalink }}">
|
||||
{{- dict "Class" "fab fa-renren fa-fw" | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 021: Myspace */ -}}
|
||||
{{- if $share.Myspace -}}
|
||||
<a href="javascript:void(0);" title="{{ T `shareOn` }} Myspace" data-sharer="myspace" data-url="{{ .Permalink }}" data-title="{{ .Title }}" data-description="{{ .Description }}">
|
||||
{{- dict "Simpleicons" "myspace" "Prefix" (.Scratch.Get "cdn" | default dict).simpleIconsPrefix | partial "plugin/icon.html" -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* 022: Blogger */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 023: 百度 */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 024: OK.RU */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 025: Evernote */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 026: Skype */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 027: Trello */ -}}
|
||||
{{- /* 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 -}}
|
||||
|
||||
{{- /* 028: Mix */ -}}
|
||||
{{- /* 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" -}}
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
{{- end -}}
|
||||
{{- $destination = printf (string $template) .Id -}}
|
||||
{{- end -}}
|
||||
{{- dict "Destination" $destination "Rel" "me" | merge . | partial "plugin/link.html" -}}
|
||||
{{- dict "Destination" $destination "Rel" "me" | 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 -}}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{- .Page.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" -}}
|
||||
</pubDate>
|
||||
<author>
|
||||
{{- .params.author | default (T "author") -}}
|
||||
{{- $params.author | default (T "author") -}}
|
||||
</author>
|
||||
<guid>
|
||||
{{- .Page.Permalink -}}
|
||||
@@ -33,4 +33,4 @@
|
||||
{{- $content | replaceRE `<figure[^>]*>.*</figure>` "" | replaceRE `<img[^>]*( /)?>` "" | safeHTML -}}
|
||||
{{- "]]>" | safeHTML -}}
|
||||
</description>
|
||||
</item>
|
||||
</item>
|
||||
|
||||
@@ -10,20 +10,20 @@
|
||||
{{- 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"></i>{{- .AbbreviatedHash -}}
|
||||
<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">
|
||||
{{- with $params.license | string -}}
|
||||
<span>
|
||||
{{- . | safeHTML -}}
|
||||
</span>
|
||||
{{- end -}}
|
||||
<span>
|
||||
{{- . | safeHTML -}}
|
||||
</span>
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="post-info-line">
|
||||
<div class="post-info-md">
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="post-info-more">
|
||||
<section class="post-tags">
|
||||
{{- with .Params.tags -}}
|
||||
<i class="fas fa-tags fa-fw"></i>
|
||||
<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 -}}
|
||||
@@ -63,10 +63,10 @@
|
||||
|
||||
<div class="post-nav">
|
||||
{{- if .PrevInSection -}}
|
||||
<a href="{{ .PrevInSection.RelPermalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw"></i>{{ .PrevInSection.Title }}</a>
|
||||
<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>
|
||||
{{- end -}}
|
||||
{{ if .NextInSection }}
|
||||
<a href="{{ .NextInSection.RelPermalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw"></i></a>
|
||||
<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>
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
<article class="page single">
|
||||
{{- /* Title */ -}}
|
||||
<h1 class="single-title animated flipInX">{{ .Title }}</h1>
|
||||
<h1 class="single-title animate__animated animate__flipInX">{{ .Title }}</h1>
|
||||
|
||||
{{- /* Subtitle */ -}}
|
||||
{{- with $params.subtitle -}}
|
||||
@@ -34,13 +34,13 @@
|
||||
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
|
||||
<span class="post-author">
|
||||
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- partial "plugin/a.html" $options -}}
|
||||
</span>
|
||||
|
||||
{{- $categories := slice -}}
|
||||
{{- range .Params.categories -}}
|
||||
{{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}}
|
||||
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw"></i>%v</a>` $category.RelPermalink $category.Title) -}}
|
||||
{{- $categories = $categories | append (printf `<a href="%v"><i class="far fa-folder fa-fw" aria-hidden="true"></i>%v</a>` $category.RelPermalink $category.Title) -}}
|
||||
{{- end -}}
|
||||
{{- with delimit $categories " " -}}
|
||||
<span class="post-category">
|
||||
@@ -50,14 +50,14 @@
|
||||
</div>
|
||||
<div class="post-meta-line">
|
||||
{{- with .Site.Params.dateformat | default "2006-01-02" | .PublishDate.Format -}}
|
||||
<i class="far fa-calendar-alt fa-fw"></i> <time datetime="{{ . }}">{{ . }}</time>
|
||||
<i class="far fa-calendar-alt fa-fw" aria-hidden="true"></i> <time datetime="{{ . }}">{{ . }}</time>
|
||||
{{- end -}}
|
||||
<i class="fas fa-pencil-alt fa-fw"></i> {{ T "wordCount" .WordCount }}
|
||||
<i class="far fa-clock fa-fw"></i> {{ T "readingTime" .ReadingTime }}
|
||||
<i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i> {{ T "wordCount" .WordCount }}
|
||||
<i class="far fa-clock fa-fw" aria-hidden="true"></i> {{ T "readingTime" .ReadingTime }}
|
||||
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||
{{- if $comment.enable | and $comment.valine.enable | and $comment.valine.visitor -}}
|
||||
<span id="{{ .RelPermalink }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
|
||||
<i class="far fa-eye fa-fw"></i> <span class=leancloud-visitors-count></span> {{ T "views" }}
|
||||
<i class="far fa-eye fa-fw" aria-hidden="true"></i> <span class=leancloud-visitors-count></span> {{ T "views" }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
@@ -70,16 +70,16 @@
|
||||
{{- end -}}
|
||||
{{- with $image -}}
|
||||
<div class="featured-image">
|
||||
{{- dict "Src" . "Title" $.Description "Resources" $.Resources | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" . "Title" $.Description "Resources" $.Resources | partial "plugin/img.html" -}}
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Static TOC */ -}}
|
||||
{{- if ne $toc.enable false -}}
|
||||
<div class="details toc" id="toc-static" kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details toc" id="toc-static" data-kept="{{ if $toc.keepStatic }}true{{ end }}">
|
||||
<div class="details-summary toc-title">
|
||||
<span>{{ T "contents" }}</span>
|
||||
<span><i class="details-icon fas fa-angle-right"></i></span>
|
||||
<span><i class="details-icon fas fa-angle-right" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
<div class="details-content toc-content" id="toc-content-static">
|
||||
{{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{{- $type := .Get "type" | default "note" -}}
|
||||
<div class="details admonition {{ $type }}{{ if .Get `open` | ne false }} open{{ end }}">
|
||||
<div class="details-summary admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get "title" | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}" aria-hidden="true"></i>{{ .Get "title" | default (T $type) }}<i class="details-icon {{ $iconDetails }}" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
@@ -30,7 +30,7 @@
|
||||
{{- $type := .Get 0 | default "note" -}}
|
||||
<div class="details admonition {{ $type }}{{ if .Get 2 | ne false }} open{{ end }}">
|
||||
<div class="details-summary admonition-title">
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}"></i>{{ .Get 1 | default (T $type) }}<i class="details-icon {{ $iconDetails }}"></i>
|
||||
<i class="icon {{ index $iconMap $type | default (index $iconMap "note") }}" aria-hidden="true"></i>{{ .Get 1 | default (T $type) }}<i class="details-icon {{ $iconDetails }}" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="details-content">
|
||||
<div class="admonition-content">
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
|
||||
{{- with $caption -}}
|
||||
<figure{{ with cond $.IsNamedParams ($.Get "class") "" }} class="{{ . }}"{{ end }}>
|
||||
{{- partial "plugin/image.html" $options -}}
|
||||
{{- partial "plugin/img.html" $options -}}
|
||||
<figcaption class="image-caption">
|
||||
{{- . | safeHTML -}}
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
{{- partial "plugin/image.html" $options -}}
|
||||
{{- partial "plugin/img.html" $options -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
{{- $options = dict "Content" (.Get 1 | default (.Get 0)) | merge $options -}}
|
||||
{{- $options = dict "Title" (.Get 2) | merge $options -}}
|
||||
{{- end -}}
|
||||
{{- partial "plugin/link.html" $options -}}
|
||||
{{- partial "plugin/a.html" $options -}}
|
||||
|
||||
2
layouts/shortcodes/raw.html
Normal file
2
layouts/shortcodes/raw.html
Normal file
@@ -0,0 +1,2 @@
|
||||
{{- $id := dict "Content" .Inner "Scratch" .Page.Scratch | partial "function/id.html" -}}
|
||||
<data id="{{ $id }}" data-raw></data>
|
||||
@@ -1,18 +1,21 @@
|
||||
{{- $content := trim .Inner "\n" -}}
|
||||
{{- $classList := .Get "class" | slice -}}
|
||||
{{- $classList := slice -}}
|
||||
{{- with .Get "class" -}}
|
||||
{{- $classList = $classList | append . -}}
|
||||
{{- end -}}
|
||||
{{- $tag := .Get "tag" | default "div" -}}
|
||||
|
||||
{{- with .Get "code" -}}
|
||||
{{- if .Get "code" -}}
|
||||
{{- /* highlight code content without line number */ -}}
|
||||
{{- $content = highlight $content . "linenos=false" -}}
|
||||
{{- $content = highlight $content (.Get "code") "lineNos=false, noClasses=false" -}}
|
||||
{{- /* delete outer label */ -}}
|
||||
{{- $content = replaceRE `<div class="highlight"><pre class="chroma"><code[^<>]*>(?s)(.*)</code></pre></div>` "$1" $content -}}
|
||||
{{- /* parsing markdown links */ -}}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content -}}
|
||||
{{- /* replace " " to " " and replace "\n" to "<br />" */ -}}
|
||||
{{- $content = replaceRE ` ` " " $content | replaceRE `(<\w+) ` "$1 " | replaceRE `\n` "<br />" -}}
|
||||
{{- /* fix "<br />" location error which is a bug of Typeit HTML parser */ -}}
|
||||
{{- $content = replaceRE `<br /></span>` "</span><br />" $content -}}
|
||||
{{- $content = replaceRE `.*<code[^<>]*>(?s)(.*)</code>.*` "$1" $content -}}
|
||||
{{- if .Get "code-link" -}}
|
||||
{{- /* parsing code links */ -}}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=\"$4\">$3</a>$1$5$6" $content -}}
|
||||
{{- end -}}
|
||||
{{- /* split multiline string */ -}}
|
||||
{{- $content = split $content "\n" -}}
|
||||
{{- $classList = $classList | append "highlight" -}}
|
||||
{{- else -}}
|
||||
{{- $content = $content | .Page.RenderString -}}
|
||||
@@ -26,6 +29,11 @@
|
||||
{{- $group = $group | default slice | append $id -}}
|
||||
{{- dict $key $group | merge $typeitMap | .Page.Scratch.SetInMap "this" "typeitMap" -}}
|
||||
|
||||
{{- $attrs := printf `id="%v"` $id -}}
|
||||
{{- with $classList -}}
|
||||
{{- $attrs = delimit $classList " " | printf `%v class="%v"` $attrs -}}
|
||||
{{- end -}}
|
||||
|
||||
<div class="typeit">
|
||||
{{- printf `<%v id="%v" class="%v"></%v>` $tag $id (delimit $classList " ") $tag | safeHTML -}}
|
||||
{{- printf `<%v %v></%v>` $tag $attrs $tag | safeHTML -}}
|
||||
</div>
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
|
||||
{{- $alt := printf "LoveIt %v | %v" $label $version -}}
|
||||
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">
|
||||
{{- dict "Src" $resource.RelPermalink "Alt" $alt "Class" "version" | partial "plugin/image.html" -}}
|
||||
{{- dict "Src" $resource.RelPermalink "Alt" $alt "Class" "version" | partial "plugin/img.html" -}}
|
||||
</a>
|
||||
@@ -5,12 +5,12 @@
|
||||
{{- define "content" -}}
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
<h2 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- $taxonomy := .Data.Singular -}}
|
||||
{{- if eq $taxonomy "category" -}}
|
||||
<i class="far fa-folder-open fa-fw"></i> {{ .Title }}
|
||||
<i class="far fa-folder-open fa-fw" aria-hidden="true"></i> {{ .Title }}
|
||||
{{- else if eq $taxonomy "tag" -}}
|
||||
<i class="fas fa-tag fa-fw"></i> {{ .Title }}
|
||||
<i class="fas fa-tag fa-fw" aria-hidden="true"></i> {{ .Title }}
|
||||
{{- else -}}
|
||||
{{- printf "%v - %v" (T $taxonomy | default $taxonomy) .Title -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<div class="page archive">
|
||||
{{- /* Title */ -}}
|
||||
<h2 class="single-title animated pulse faster">
|
||||
<h2 class="single-title animate__animated animate__pulse animate__faster">
|
||||
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" -}}
|
||||
</h2>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="card-item-wrapper">
|
||||
<h3 class="card-item-title">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
<i class="far fa-folder fa-fw"></i> {{ .Page.Title }}
|
||||
<i class="far fa-folder fa-fw" aria-hidden="true"></i> {{ .Page.Title }}
|
||||
</a>
|
||||
</h3>
|
||||
{{- range first 5 $pages -}}
|
||||
|
||||
Reference in New Issue
Block a user