Upgrade Theme

This commit is contained in:
FlintyLemming
2024-07-31 17:10:56 +08:00
parent d09d2ccf7f
commit 47b3d30137
57 changed files with 1330 additions and 958 deletions

View File

@@ -23,9 +23,12 @@
{{ end }}
</div>
{{ if or (not .Date.IsZero) (.Site.Params.article.readingTime) }}
{{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }}
{{ $showDate := not .Date.IsZero }}
{{ $showFooter := or $showDate $showReadingTime }}
{{ if $showFooter }}
<footer class="article-time">
{{ if not .Date.IsZero }}
{{ if $showDate }}
<div>
{{ partial "helper/icon" "date" }}
<time class="article-time--published">
@@ -34,7 +37,7 @@
</div>
{{ end }}
{{ if .Site.Params.article.readingTime }}
{{ if $showReadingTime }}
<div>
{{ partial "helper/icon" "clock" }}
<time class="article-time--reading">
@@ -55,4 +58,4 @@
</div>
</footer>
{{ end }}
</div>
</div>

View File

@@ -16,8 +16,12 @@
</div>
{{ with $link.image }}
{{ $permalink := . }}
{{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }}
{{ $permalink = .RelPermalink }}
{{ end }}
<div class="article-image">
<img src="{{ . }}" loading="lazy">
<img src="{{ $permalink }}" loading="lazy">
</div>
{{ end }}
</a>

View File

@@ -1,12 +1,13 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}}
<script>
window.addEventListener("DOMContentLoaded", () => {
renderMathInElement(document.querySelector(`.article-content`), {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: true }
]
],
ignoredClasses: ["gist"]
});})
</script>