Revert "Merge branch 'canary' into master" (#712)

Revert "Merge branch 'canary' into master (#711)"

This reverts commit 8a597a5c9c.
This commit is contained in:
Jimmy Cai
2022-10-29 17:14:19 +02:00
committed by GitHub
parent 8a597a5c9c
commit b03390d237
73 changed files with 1976 additions and 892 deletions
@@ -1,20 +0,0 @@
{{- $class := .Attributes.class | default "" -}}
{{- $lang := .Attributes.lang | default .Type -}}
<div class="codeblock">
<header>
<span class="codeblock-lang">{{ $lang }}</span>
<button
class="codeblock-copy"
data-id="codeblock-id-{{ .Ordinal }}"
data-copied-text="{{ T `article.codeblock.copied` }}"
>
{{ T `article.codeblock.copy` }}
</button>
</header>
<code id="codeblock-id-{{ .Ordinal }}" style="display:none;">{{- .Inner -}}</code>
{{- if transform.CanHighlight $lang -}}
<div class="{{ $class }}">{{- highlight .Inner $lang -}}</div>
{{- else -}}
<pre><code class="{{ $class }}">{{- .Inner -}}</code></pre>
{{- end -}}
</div>
+1 -1
View File
@@ -17,7 +17,7 @@
{{- $Height = $image.Height -}}
{{- $galleryImage = true -}}
{{- if .Page.Site.Params.imageProcessing.content.enabled -}}
{{- 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 -}}
+4 -2
View File
@@ -16,8 +16,10 @@
</header>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ range $pages.GroupByDate "2006" }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ range $filtered.GroupByDate "2006" }}
{{ $id := lower (replace .Key " " "-") }}
<div class="archives-group" id="{{ $id }}">
<h2 class="archives-date section-title"><a href="{{ $.RelPermalink }}#{{ $id }}">{{ .Key }}</a></h2>
+1 -1
View File
@@ -25,7 +25,7 @@
{{- $Width := $image.resource.Width -}}
{{- $Height := $image.resource.Height -}}
{{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $Permalink = $thumbnail.RelPermalink -}}
{{- $Width = $thumbnail.Width -}}
+1
View File
@@ -6,6 +6,7 @@
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $pages := where $pages "Params.hidden" "!=" true -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
+4 -1
View File
@@ -1,6 +1,9 @@
{{ define "main" }}
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $pag := .Paginate ($pages) }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $pag := .Paginate ($filtered) }}
<section class="article-list">
{{ range $index, $element := $pag.Pages }}
{{ partial "article-list/default" . }}
+5 -2
View File
@@ -1,13 +1,16 @@
{{- $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections -}}
{{- $notHidden := where .Site.RegularPages "Params.hidden" "!=" true -}}
{{- $filtered := ($pages | intersect $notHidden) -}}
{{- $result := slice -}}
{{- range $pages -}}
{{- range $filtered -}}
{{- $data := dict "title" .Title "date" .Date "permalink" .Permalink "content" (.Plain) -}}
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
{{- if $image.exists -}}
{{- $imagePermalink := "" -}}
{{- if and $image.resource .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- if and $image.resource (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $imagePermalink = (absURL $thumbnail.Permalink) -}}
{{- else -}}
+1 -1
View File
@@ -19,7 +19,7 @@
{{- $Width := $image.resource.Width -}}
{{- $Height := $image.resource.Height -}}
{{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
{{- $thumbnail := $image.resource.Fill "120x120" -}}
{{- $Permalink = $thumbnail.RelPermalink -}}
{{- $Width = $thumbnail.Width -}}
@@ -9,7 +9,7 @@
{{- $Height := $image.resource.Height -}}
{{- $Srcset := "" -}}
{{- if .Page.Site.Params.imageProcessing.cover.enabled -}}
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
{{- $thumbnail := $image.resource.Resize "800x" -}}
{{- $thumbnailRetina := $image.resource.Resize "1600x" -}}
{{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}}
@@ -1,20 +1,68 @@
{{- $opts := dict "minify" hugo.IsProduction "format" "esm" -}}
{{- $galleryScript := resources.Get "ts/gallery.ts" | js.Build $opts -}}
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@5.2.7/dist/photoswipe.css"
integrity="sha256-olf9rfn3AG8zR6lkPXkN3PZq63z8tElx7Ela6T4eklo=" crossorigin="anonymous">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<script type="module">
import StackGallery from '{{ $galleryScript.RelPermalink }}';
import PhotoSwipeLightbox from 'https://cdn.jsdelivr.net/npm/photoswipe@5.2.7/dist/photoswipe-lightbox.esm.min.js';
console.log(StackGallery)
StackGallery(document.querySelector('.article-content'));
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
const lightbox = new PhotoSwipeLightbox({
gallery: '.article-content',
children: '.gallery-image a',
pswpModule: () => import('https://cdn.jsdelivr.net/npm/photoswipe@5.2.7/dist/photoswipe.esm.min.js')
});
lightbox.init();
</script>
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo https://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
{{- partial "helper/external" (dict "Context" . "Namespace" "PhotoSwipe") -}}
@@ -1,4 +1,4 @@
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }}
{{ with $related }}
<aside class="related-content--wrapper">
<h2 class="section-title">{{ T "article.relatedContent" }}</h2>
+5 -2
View File
@@ -6,7 +6,9 @@
<!-- Build paginator -->
{{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
{{ $pag := .Paginate ($pages) }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $pag := .Paginate ($filtered) }}
{{ if .Paginator.HasPrev }}
<!-- Paginated. Append page number to title -->
@@ -18,7 +20,8 @@
<!-- Taxonomy page -->
<!-- Build paginator -->
{{ $pag := .Paginate .Pages }}
{{ $notHidden := where .Pages "Params.hidden" "!=" true }}
{{ $pag := .Paginate ($notHidden) }}
<!-- {TAXONOMY_TYPE}: {TAXONOMY_TERM} -->
{{ $title = slice (title .Data.Singular) ": " $title }}
@@ -1,3 +1,5 @@
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
{{- $opts := dict "minify" hugo.IsProduction -}}
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $ThemeVersion := "4.0.0-alpha.0" -}}
{{- $ThemeVersion := "3.16.0" -}}
<footer class="site-footer">
<section class="copyright">
&copy;
+2 -2
View File
@@ -1,5 +1,5 @@
{{- $defaultColorScheme := .Site.Params.colorScheme.default -}}
{{- if not .Site.Params.colorScheme.toggle -}}
{{- $defaultColorScheme := default "auto" .Site.Params.colorScheme.default -}}
{{- if not (default false .Site.Params.colorScheme.toggle) -}}
{{/* If toggle is disabled, force default scheme */}}
<script>
(function() {
+1 -6
View File
@@ -19,12 +19,7 @@
{{- end -}}
{{ with .Site.Params.favicon }}
{{ $favicon := resources.Get . }}
{{ if $favicon }}
<link rel="shortcut icon" href="{{ $favicon.RelPermalink }}" />
{{ else }}
{{ errorf "Failed loading favicon from %q" . }}
{{ end }}
<link rel="shortcut icon" href="{{ . }}" />
{{ end }}
{{- template "_internal/google_analytics.html" . -}}
@@ -11,6 +11,6 @@
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}}
{{- if $image.exists -}}
<meta name="twitter:card" content="{{ .Site.Params.opengraph.twitter.card }}">
<meta name="twitter:card" content="{{ default `summary_large_image` .Site.Params.opengraph.twitter.card }}">
<meta name="twitter:image" content='{{ absURL $image.permalink }}' />
{{- end -}}
+2 -2
View File
@@ -7,7 +7,7 @@
<header>
{{ with .Site.Params.sidebar.avatar }}
{{ if .enabled }}
{{ if (default true .enabled) }}
<figure class="site-avatar">
<a href="{{ .Site.BaseURL | relLangURL }}">
{{ if not .local }}
@@ -89,7 +89,7 @@
</li>
{{ end }}
{{ if .Site.Params.colorScheme.toggle }}
{{ if (default false .Site.Params.colorScheme.toggle) }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
+3 -1
View File
@@ -10,7 +10,9 @@
<h2 class="widget-title section-title">{{ T "widget.archives.title" }}</h2>
{{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }}
{{ $archives := $pages.GroupByDate "2006" }}
{{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }}
{{ $filtered := ($pages | intersect $notHidden) }}
{{ $archives := $filtered.GroupByDate "2006" }}
<div class="widget-archive--list">
{{ range $index, $item := first (add $limit 1) ($archives) }}