From 02a247ba9112ae944169c7665ba9be87e91c02dc Mon Sep 17 00:00:00 2001 From: eltrac Date: Fri, 20 Feb 2026 15:57:19 +0800 Subject: perf: render items of long list only after scrolled into view --- layouts/archive.html | 2 +- layouts/essays/section.html | 2 +- layouts/highlights.html | 4 ++-- layouts/section.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'layouts') diff --git a/layouts/archive.html b/layouts/archive.html index 3af7c9ce..764f0879 100644 --- a/layouts/archive.html +++ b/layouts/archive.html @@ -6,7 +6,7 @@
    {{ range (.Site.RegularPages | collections.Reverse) }} {{ if eq .Language .Site.Language }} -
  1. +
  2. {{ .LinkTitle }} {{ .Section }} diff --git a/layouts/essays/section.html b/layouts/essays/section.html index f5a08ace..40baea9e 100644 --- a/layouts/essays/section.html +++ b/layouts/essays/section.html @@ -16,7 +16,7 @@ )}} {{ range .Pages.GroupByDate "January" }} -
    +

    diff --git a/layouts/highlights.html b/layouts/highlights.html index 9d7c13bf..f9f9c030 100644 --- a/layouts/highlights.html +++ b/layouts/highlights.html @@ -6,12 +6,12 @@

    {{ range shuffle site.Data.highlights }} -
    +

    《{{ .title }}》

    diff --git a/layouts/section.html b/layouts/section.html index a70c6cd1..7497a217 100644 --- a/layouts/section.html +++ b/layouts/section.html @@ -25,7 +25,7 @@ )}} {{ range .Pages.GroupByDate "January" }} -
    +

    {{ .Key }} -- cgit v1.2.3 From 73f6155a40ddd3f5c8d459d03b510d696bbe5ace Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 09:26:17 +0800 Subject: fix: unwanted
    ::marker on Safari tried the solution here https://stackoverflow.com/questions/6195329/how-can-you-hide-the-arrow-that-is-displayed-by-default-on-the-html5-details-e did not work displaying as a flex container hides it somehow --- layouts/_partials/posts/action-menu.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index 215dc96a..88bb8f8b 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -16,7 +16,7 @@ {{ partial "posts/action-area" . }}
    - + {{ partial "posts/webmention-summary" (dict "likes" $likes "page" . -- cgit v1.2.3 From 1a5242df3e9e91ef69b497634080d9f9e13f64ec Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 10:59:50 +0800 Subject: docs: new archive page group by year and add pagefind search bar --- layouts/archive.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'layouts') diff --git a/layouts/archive.html b/layouts/archive.html index 764f0879..87bafab2 100644 --- a/layouts/archive.html +++ b/layouts/archive.html @@ -1,11 +1,15 @@ {{ define "main" }}
    {{ partial "header" . }} - {{ partial "home/home-nav" . }} + {{ partial "taxonomy/pagefind" . }}
    -
      - {{ range (.Site.RegularPages | collections.Reverse) }} - {{ if eq .Language .Site.Language }} + {{ range .Site.RegularPages.GroupByDate "2006" }} + {{ partial "components/section-title" (dict + "Left" .Key + "Right" (T "archivePage.pageCount" (len .Pages)) + )}} +
        + {{ range .Pages }}
      1. {{ .LinkTitle }} @@ -13,8 +17,8 @@
      2. {{ end }} - {{ end }}
      + {{ end }}
    {{ partial "footer.html" . }} -- cgit v1.2.3 From 294ad30fe625cebc41fe1927cf77f0cafc8668ba Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 11:00:14 +0800 Subject: feat: show archvied and pinned categorises --- layouts/_partials/taxonomy/all-categories.html | 14 ++++++++------ layouts/_partials/taxonomy/archived-categories.html | 16 ++++++++++++++++ layouts/taxonomy.html | 4 ++++ 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 layouts/_partials/taxonomy/archived-categories.html (limited to 'layouts') diff --git a/layouts/_partials/taxonomy/all-categories.html b/layouts/_partials/taxonomy/all-categories.html index 85a228fe..7cb5813a 100644 --- a/layouts/_partials/taxonomy/all-categories.html +++ b/layouts/_partials/taxonomy/all-categories.html @@ -1,29 +1,31 @@ +

    * 表示常驻系列,其他系列可能会在完成后停止更新


    - {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} + {{ range sort (sort .Site.Taxonomies.categories ".Count" "desc") ".Page.Params.pinned" "desc" }} + {{ if not .Page.Params.archive }}
    -

    - {{ with .Page.Params.icon }} - {{ . }} - {{ end }} - 《{{ .Page.LinkTitle }}》 +

    + 《{{ .Page.LinkTitle }}》 + {{ if .Page.Params.pinned }}*{{ end }}

    {{ .Page.Params.description | markdownify }}


    + {{ end }} {{ end }}
    +

    查看随笔 → diff --git a/layouts/_partials/taxonomy/archived-categories.html b/layouts/_partials/taxonomy/archived-categories.html new file mode 100644 index 00000000..26ed68d8 --- /dev/null +++ b/layouts/_partials/taxonomy/archived-categories.html @@ -0,0 +1,16 @@ +

    + diff --git a/layouts/taxonomy.html b/layouts/taxonomy.html index 1a00ef86..600d4d03 100644 --- a/layouts/taxonomy.html +++ b/layouts/taxonomy.html @@ -6,6 +6,10 @@

    文章系列

    {{ partial "taxonomy/all-categories.html" . }} +
    +

    尘封的系列

    +

    这些文章系列已经不再更新。

    + {{ partial "taxonomy/archived-categories.html" . }} {{ partial "footer.html" . }} {{ end }} -- cgit v1.2.3 From 66eb897d4d812a76831e6113a1a2ecce0e53be43 Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 11:48:55 +0800 Subject: docs: move /posts/weekly -> /weekly, a standalone section --- layouts/section.html | 7 ------- layouts/weekly/page.html | 3 +++ layouts/weekly/section.html | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 layouts/weekly/page.html create mode 100644 layouts/weekly/section.html (limited to 'layouts') diff --git a/layouts/section.html b/layouts/section.html index 7497a217..5b5cb33a 100644 --- a/layouts/section.html +++ b/layouts/section.html @@ -11,10 +11,6 @@ {{ partial "section-categories" $pages }} - {{ if eq .Site.Language.Lang "zh" }} -

    *稻草人周刊也属于散文集,但为了方便查阅,周刊没有列在下面,请到分类页面查看周刊。

    - {{ end }} - {{ $remainingMonthsToOpen := 3 }} {{ range $pages.GroupByDate "2006" -}} @@ -32,8 +28,6 @@
      {{ range .Pages }} - {{ $isWeekly := (eq .Params.categories "稻草人周刊") }} - {{ if not (eq .Params.categories "稻草人周刊") }}
    • + {{ partial "header.html" . }} + {{ partial "home/home-nav" . }} +
      +
      {{ .Content }}
      + + + {{ $remainingMonthsToOpen := 3 }} + {{ range $pages.GroupByDate "2006" -}} +
      + {{ partial "components/section-title" (dict + "Left" .Key + "Right" (T "archivePage.postCountAnnual" (len .Pages)) + )}} + + {{ range .Pages.GroupByDate "January" }} +
      +

      + {{ .Key }} +

      + +
      + {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} + {{ end }} +
      + {{ end }} +
      + + {{ partial "footer.html" . }} +{{ end }} -- cgit v1.2.3 From 67039bad602d8949f08a9d0f5b9c234b03b75c2c Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:13:43 +0800 Subject: remove: unused essays and posts templates --- layouts/essays/page.html | 3 --- layouts/essays/section.html | 40 ---------------------------------------- layouts/posts/page.html | 3 --- 3 files changed, 46 deletions(-) delete mode 100644 layouts/essays/page.html delete mode 100644 layouts/essays/section.html delete mode 100644 layouts/posts/page.html (limited to 'layouts') diff --git a/layouts/essays/page.html b/layouts/essays/page.html deleted file mode 100644 index e093e810..00000000 --- a/layouts/essays/page.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ define "main" }} - {{ partial "template/post-page" . }} -{{ end }} diff --git a/layouts/essays/section.html b/layouts/essays/section.html deleted file mode 100644 index 40baea9e..00000000 --- a/layouts/essays/section.html +++ /dev/null @@ -1,40 +0,0 @@ -{{ define "main" }} -
      - {{ partial "header.html" . }} - {{ partial "home/home-nav" . }} -
      -
      {{ .Content }}
      - {{ $pages := .Pages }} - {{ partial "section-categories" $pages }} - - {{ $remainingMonthsToOpen := 3 }} - {{ range $pages.GroupByDate "2006" -}} -
      - {{ partial "components/section-title" (dict - "Left" .Key - "Right" (T "archivePage.postCountAnnual" (len .Pages)) - )}} - - {{ range .Pages.GroupByDate "January" }} -
      - -

      - {{ .Key }} - {{ T "archivePage.postCountMonthly" (len .Pages) }} -

      -
      -
        - {{ range .Pages }} - {{ partial "items/post-small" . }} - {{ end }} -
      -
      - {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} - {{ end }} -
      - {{ end }} -
      -
      - {{ partial "footer.html" . }} -{{ end }} diff --git a/layouts/posts/page.html b/layouts/posts/page.html deleted file mode 100644 index e093e810..00000000 --- a/layouts/posts/page.html +++ /dev/null @@ -1,3 +0,0 @@ -{{ define "main" }} - {{ partial "template/post-page" . }} -{{ end }} -- cgit v1.2.3 From 8d0dacf29e34d27c78e3a6da9f9ac100a662792f Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:18:35 +0800 Subject: refactor: remove generic section template --- layouts/article/section.html | 52 ++++++++++++++++++++++++++++++++++++++++++++ layouts/section.html | 52 -------------------------------------------- 2 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 layouts/article/section.html delete mode 100644 layouts/section.html (limited to 'layouts') diff --git a/layouts/article/section.html b/layouts/article/section.html new file mode 100644 index 00000000..5b5cb33a --- /dev/null +++ b/layouts/article/section.html @@ -0,0 +1,52 @@ +{{ define "main" }} + + {{ $pages := .Pages }} + {{ $categories := slice }} + +
      + {{ partial "header.html" . }} + {{ partial "home/home-nav" . }} +
      +
      {{ .Content }}
      + + {{ partial "section-categories" $pages }} + + + {{ $remainingMonthsToOpen := 3 }} + {{ range $pages.GroupByDate "2006" -}} +
      + {{ partial "components/section-title" (dict + "Left" .Key + "Right" (T "archivePage.postCountAnnual" (len .Pages)) + )}} + + {{ range .Pages.GroupByDate "January" }} +
      +

      + {{ .Key }} +

      + +
      + {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} + {{ end }} +
      + {{ end }} +
      +
      + {{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/section.html b/layouts/section.html deleted file mode 100644 index 5b5cb33a..00000000 --- a/layouts/section.html +++ /dev/null @@ -1,52 +0,0 @@ -{{ define "main" }} - - {{ $pages := .Pages }} - {{ $categories := slice }} - -
      - {{ partial "header.html" . }} - {{ partial "home/home-nav" . }} -
      -
      {{ .Content }}
      - - {{ partial "section-categories" $pages }} - - - {{ $remainingMonthsToOpen := 3 }} - {{ range $pages.GroupByDate "2006" -}} -
      - {{ partial "components/section-title" (dict - "Left" .Key - "Right" (T "archivePage.postCountAnnual" (len .Pages)) - )}} - - {{ range .Pages.GroupByDate "January" }} -
      -

      - {{ .Key }} -

      - -
      - {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} - {{ end }} -
      - {{ end }} -
      -
      - {{ partial "footer.html" . }} -{{ end }} -- cgit v1.2.3 From f8bceee60220ee6e74c56328255c491372158147 Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:18:55 +0800 Subject: feat: add article page template --- layouts/article/page.html | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 layouts/article/page.html (limited to 'layouts') diff --git a/layouts/article/page.html b/layouts/article/page.html new file mode 100644 index 00000000..e093e810 --- /dev/null +++ b/layouts/article/page.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{ partial "template/post-page" . }} +{{ end }} -- cgit v1.2.3 From 3d689d9dcd7aa9e727e37c899e9bd41a30bb710a Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:19:52 +0800 Subject: remove(partial): no longer show unique section categories --- layouts/_partials/section-categories.html | 20 -------------------- layouts/article/section.html | 2 -- 2 files changed, 22 deletions(-) delete mode 100644 layouts/_partials/section-categories.html (limited to 'layouts') diff --git a/layouts/_partials/section-categories.html b/layouts/_partials/section-categories.html deleted file mode 100644 index 40e6600e..00000000 --- a/layouts/_partials/section-categories.html +++ /dev/null @@ -1,20 +0,0 @@ -{{ $categories := slice }} -{{ range . }} - {{ with .Params.categories }} - {{ if not (in $categories .) }} - {{ $categories = $categories | append . }} - {{ end }} - {{ end }} -{{ end }} - -
      - {{ range $categories }} - - {{ . }} - - {{ end }} -
      diff --git a/layouts/article/section.html b/layouts/article/section.html index 5b5cb33a..b4ccd023 100644 --- a/layouts/article/section.html +++ b/layouts/article/section.html @@ -9,8 +9,6 @@
      {{ .Content }}
      - {{ partial "section-categories" $pages }} - {{ $remainingMonthsToOpen := 3 }} {{ range $pages.GroupByDate "2006" -}} -- cgit v1.2.3 From cab20cb4ca9ae6e5fe979ad71017081f3c91320a Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:22:42 +0800 Subject: feat: change article section page style --- layouts/article/section.html | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'layouts') diff --git a/layouts/article/section.html b/layouts/article/section.html index b4ccd023..b56b30eb 100644 --- a/layouts/article/section.html +++ b/layouts/article/section.html @@ -9,7 +9,6 @@
      {{ .Content }}
      - {{ $remainingMonthsToOpen := 3 }} {{ range $pages.GroupByDate "2006" -}}
      @@ -19,27 +18,20 @@ )}} {{ range .Pages.GroupByDate "January" }} -
      -

      - {{ .Key }} -

      +
      + +

      + {{ .Key }} + {{ T "archivePage.postCountMonthly" (len .Pages) }} +

      +
      -
      + {{ $remainingMonthsToOpen = sub $remainingMonthsToOpen 1 }} {{ end }}
      -- cgit v1.2.3 From c09ffa2e5b0db615f4a4614da7d4811616afdf4f Mon Sep 17 00:00:00 2001 From: eltrac Date: Sun, 8 Mar 2026 12:49:40 +0800 Subject: fix: merge old webmentions after URLs change --- layouts/_partials/posts/action-menu.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'layouts') diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index 88bb8f8b..d3544c1f 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -1,4 +1,13 @@ {{ $webmentions := index .Site.Data.webmentions .RelPermalink }} + + +{{ $other_webmentions := index .Site.Data.webmentions (printf "/posts%s" .RelPermalink ) }} +{{ if $other_webmentions }} + {{ $webmentions = $webmentions | union $other_webmentions }} +{{ end }} + {{ $likes := slice }} {{ $replies := slice }} {{ $mentions := slice }} -- cgit v1.2.3