feat: bump theme to v4.0.3
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
{{- $Permalink := .Destination | safeURL -}}
|
||||
{{- $image := "" -}}
|
||||
|
||||
{{- if and (hasPrefix $Permalink "http") (default false .Page.Site.Params.render.image.externalLink.enabled) -}}
|
||||
{{- with resources.GetRemote $Permalink -}}
|
||||
{{- $image = . -}}
|
||||
{{- else -}}
|
||||
{{- warnf "Unable to get remote resource %q" $Permalink -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- $image = .Page.Resources.GetMatch (printf "%s" $Permalink) -}}
|
||||
{{- if $image -}}
|
||||
{{- $Permalink = $image.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $alt := .PlainText | safeHTML -}}
|
||||
{{- $Width := 0 -}}
|
||||
{{- $Height := 0 -}}
|
||||
{{- $Srcset := "" -}}
|
||||
|
||||
{{/* SVG and external images won't work with gallery layout, because their width and height attributes are unknown */}}
|
||||
{{- $galleryImage := false -}}
|
||||
|
||||
{{- if $image -}}
|
||||
{{- $notSVG := ne (path.Ext .Destination) ".svg" -}}
|
||||
|
||||
{{- if $notSVG -}}
|
||||
{{- $Width = $image.Width -}}
|
||||
{{- $Height = $image.Height -}}
|
||||
{{- $galleryImage = true -}}
|
||||
|
||||
{{- if (default true .Page.Site.Params.imageProcessing.content.enabled) -}}
|
||||
{{- $small := $image.Resize `480x` -}}
|
||||
{{- $big := $image.Resize `1024x` -}}
|
||||
{{- $Srcset = printf `%s 480w, %s 1024w` $small.RelPermalink $big.RelPermalink -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
<img src="{{ $Permalink }}"
|
||||
{{ with $Width }}width="{{ . }}"{{ end }}
|
||||
{{ with $Height }}height="{{ . }}"{{ end }}
|
||||
{{ with $Srcset }}srcset="{{ . }}"{{ end }}
|
||||
loading="lazy"
|
||||
{{ with $alt }}
|
||||
alt="{{ . }}"
|
||||
{{ end }}
|
||||
{{ if $galleryImage }}
|
||||
class="gallery-image"
|
||||
data-flex-grow="{{ div (mul $image.Width 100) $image.Height }}"
|
||||
data-flex-basis="{{ div (mul $image.Width 240) $image.Height }}px"
|
||||
{{ end }}
|
||||
>
|
||||
31
layouts/_partials/comments/provider/artalk.html
Normal file
31
layouts/_partials/comments/provider/artalk.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{{- $style := resources.Get "scss/partials/comments/artalk.scss" | toCSS | minify -}}
|
||||
{{- with .Site.Params.comments.artalk -}}
|
||||
{{- $serverUrl := default .server .serverUrl -}}
|
||||
<link href="https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
|
||||
<script src="https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.js"></script>
|
||||
|
||||
<div id="Comments" class="artalk-container"></div>
|
||||
|
||||
<script>
|
||||
function isDarkMode() {
|
||||
return document.documentElement.dataset.scheme === 'dark';
|
||||
}
|
||||
|
||||
const artalkInstance = Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: '{{ $.RelPermalink }}',
|
||||
pageTitle: '{{ $.Title }}',
|
||||
server: '{{ $serverUrl }}',
|
||||
site: '{{ .site }}',
|
||||
darkMode: isDarkMode(),
|
||||
locale: 'auto',
|
||||
});
|
||||
|
||||
window.addEventListener('onColorSchemeChange', (e) => {
|
||||
if (!artalkInstance || typeof artalkInstance.setDarkMode !== 'function') return;
|
||||
artalkInstance.setDarkMode(e.detail === 'dark');
|
||||
});
|
||||
</script>
|
||||
{{- end -}}
|
||||
@@ -31,14 +31,7 @@
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?360253efb0d8255a98cdeb8be43ef88d";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Umami Analytics -->
|
||||
<script defer src="https://umami.taurusxin.com/script.js" data-website-id="dcb0cdb7-c46e-4775-8e41-eedf72f415c8"></script>
|
||||
|
||||
<!-- Google Adsense -->
|
||||
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3791150317963204"
|
||||
crossorigin="anonymous"></script>
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<div class="article-list--compact links">
|
||||
{{ $siteResources := resources }}
|
||||
{{ range $i, $link := $.Site.Data.links }}
|
||||
{{ range $i, $link := hugo.Data.links }}
|
||||
<article>
|
||||
<a href="{{ $link.website }}" target="_blank" rel="noopener">
|
||||
<div class="article-details">
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<!-- CSS -->
|
||||
<link href="https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.css" rel="stylesheet">
|
||||
|
||||
<!-- JS -->
|
||||
<script src="https://cdn.taurusxin.com/hugo/assets/artalk/2.9.1/Artalk.min.js"></script>
|
||||
|
||||
<!-- Artalk -->
|
||||
<div id="Comments"></div>
|
||||
|
||||
<script>
|
||||
const artalkInstance = Artalk.init({
|
||||
el: '#Comments',
|
||||
pageKey: '{{ .Page.RelPermalink }}',
|
||||
pageTitle: '{{ .Title }}',
|
||||
server: '{{ $.Site.Params.comments.artalk.server }}',
|
||||
site: '{{ $.Site.Params.comments.artalk.site }}',
|
||||
darkMode: '{{ $.Site.Params.comments.artalk.darkMode }}'
|
||||
})
|
||||
|
||||
window.addEventListener('onColorSchemeChange', (e) => {
|
||||
artalkInstance.setDarkMode(e.detail == 'dark')
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user