Merge branch 'jpanther:dev' into lazy-load-image-by-default

This commit is contained in:
Tomy Hsieh
2023-05-27 05:17:50 +08:00
committed by GitHub
26 changed files with 3315 additions and 1550 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
{{- $section := .Site.GetPage "section" .Section -}}
{{- $showDate := .Params.showDate | default .Site.Params.article.showDate -}}
{{- $index = $index | append (dict
"date" (cond (and .IsPage $showDate) (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long")) nil)
"date" (cond (and .IsPage $showDate) (.Date | time.Format (site.Params.dateFormat | default ":date_long")) nil)
"title" (.Title | emojify | safeJS)
"section" ($section.Title | emojify | safeJS)
"summary" (.Summary | emojify | safeJS)
+1 -1
View File
@@ -3,7 +3,7 @@
{{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ $authorImage := $authorImage.Fill "192x192" }}
{{ $authorImage := $authorImage.Fill "192x192 Center" }}
<img
class="!mb-0 !mt-0 me-4 h-24 w-24 rounded-full"
width="96"
+1 -1
View File
@@ -1 +1 @@
{{ return time.Format (site.Language.Params.dateFormat | default ":date_long") . }}
{{ return time.Format (site.Params.dateFormat | default ":date_long") . }}
+3 -3
View File
@@ -1,9 +1,9 @@
{{ if ne .Site.Params.showAppearanceSwitcher nil }}
{{ if ne .Params.showAppearanceSwitcher nil }}
{{ warnf "[CONGO] Theme parameter `showAppearanceSwitcher` has been renamed to `footer.showAppearanceSwitcher`. Please update your site configuration." }}
{{ end }}
{{ if ne .Site.Params.showScrollToTop nil }}
{{ if ne .Params.showScrollToTop nil }}
{{ warnf "[CONGO] Theme parameter `showScrollToTop` has been renamed to `footer.showScrollToTop`. Please update your site configuration." }}
{{ end }}
{{ if ne .Site.Params.logo nil }}
{{ if ne .Params.logo nil }}
{{ warnf "[CONGO] Theme parameter `logo` has been renamed to `header.logo`. Please update your site configuration." }}
{{ end }}
+6 -5
View File
@@ -1,6 +1,6 @@
<head>
<meta charset="utf-8" />
{{ with .Site.Language.Params.htmlCode | default .Site.LanguageCode }}
{{ with site.Params.htmlCode | default .Site.LanguageCode }}
<meta http-equiv="content-language" content="{{ . }}" />
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -31,6 +31,7 @@
{{ end -}}
{{/* Asset bundles */}}
{{ $assets := newScratch }}
{{ $algorithm := .Site.Params.fingerprintAlgorithm | default "sha256" }}
{{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (lower .Site.Params.colorScheme | default "congo")) }}
{{ if not $cssScheme }}
{{ $cssScheme = resources.Get "css/schemes/congo.css" }}
@@ -42,7 +43,7 @@
{{ if $cssCustom }}
{{ $assets.Add "css" (slice $cssCustom) }}
{{ end }}
{{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint "sha512" }}
{{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint $algorithm }}
<link
type="text/css"
rel="stylesheet"
@@ -50,7 +51,7 @@
integrity="{{ $bundleCSS.Data.Integrity }}"
/>
{{ $jsAppearance := resources.Get "js/appearance.js" }}
{{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint "sha512" }}
{{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint $algorithm }}
<script type="text/javascript" src="{{ $jsAppearance.RelPermalink }}" integrity="{{ $jsAppearance.Data.Integrity }}"></script>
{{ if .Site.Params.enableSearch | default false }}
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
@@ -66,7 +67,7 @@
{{ $assets.Add "js" (slice $jsRTL) }}
{{ end }}
{{ if $assets.Get "js" }}
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint $algorithm }}
<script defer type="text/javascript" id="script-bundle" src="{{ $bundleJS.RelPermalink }}" integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n "code.copy" }}" data-copied="{{ i18n "code.copied" }}"></script>
{{ end }}
{{/* Icons */}}
@@ -111,4 +112,4 @@
{{ if templates.Exists "partials/extend-head.html" }}
{{ partial "extend-head.html" .Site }}
{{ end }}
</head>
</head>
+1 -1
View File
@@ -7,7 +7,7 @@
{{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ $authorImage := $authorImage.Fill "288x288" }}
{{ $authorImage := $authorImage.Fill "288x288 Center" }}
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
+11 -1
View File
@@ -1,14 +1,24 @@
{{- if .Site.Params.header.logo }}
{{- $logo := resources.Get .Site.Params.header.logo }}
{{- $logo_dark := resources.Get .Site.Params.header.logoDark }}
{{- if $logo }}
<a href="{{ "" | relLangURL }}" class="mr-2">
<img
src="{{ $logo.RelPermalink }}"
width="{{ div $logo.Width 2 }}"
height="{{ div $logo.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left{{ if $logo_dark }} hidden dark:flex{{ end }}"
alt="{{ .Site.Title }}"
/>
{{- if $logo_dark }}
<img
src="{{ $logo_dark.RelPermalink }}"
width="{{ div $logo_dark.Width 2 }}"
height="{{ div $logo_dark.Height 2 }}"
class="max-h-[10rem] max-w-[10rem] object-scale-down object-left dark:hidden"
alt="{{ .Site.Title }}"
/>
{{- end}}
</a>
{{- end }}
{{- end }}
+2
View File
@@ -8,6 +8,8 @@
href="{{ printf .url $.Permalink $.Title }}"
title="{{ i18n .title }}"
aria-label="{{ i18n .title }}"
target="_blank"
rel="noopener noreferrer"
>{{ partial "icon.html" .icon }}</a
>
{{ end }}
+2 -2
View File
@@ -1,11 +1,11 @@
{{ if .IsTranslated }}
<ul class="flex flex-row list-none">
<ul class="flex list-none flex-row">
{{ range .AllTranslations }}
<li class="ml-2">
<a
href="{{ .RelPermalink }}"
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
>{{ .Language.Params.displayName | emojify }}</a
>{{ site.Params.displayName | emojify }}</a
>
</li>
{{ end }}