From 0d2166cc8da8d6c7940c2fe1d7a626d962b4ee37 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 23 May 2025 19:48:12 +0800 Subject: feat: change links to stats, add to postnav, and better style --- assets/css/components/_postlist.scss | 16 +++++- content/links.md | 4 -- content/stats.md | 4 ++ layouts/_default/links.html | 75 --------------------------- layouts/_default/stats.html | 89 ++++++++++++++++++++++++++++++++ layouts/partials/components/postnav.html | 4 +- 6 files changed, 110 insertions(+), 82 deletions(-) delete mode 100644 content/links.md create mode 100644 content/stats.md delete mode 100644 layouts/_default/links.html create mode 100644 layouts/_default/stats.html diff --git a/assets/css/components/_postlist.scss b/assets/css/components/_postlist.scss index a5d38ba8..022f97bd 100644 --- a/assets/css/components/_postlist.scss +++ b/assets/css/components/_postlist.scss @@ -86,12 +86,26 @@ li { flex-shrink: 0; flex-grow: 0; + &.active { font-weight: bolder } - a:not(.no-button) { + a:not(.icon-link) { @include small-button; } + + .icon-link { + opacity: 0.5; + transition: opacity 0.3s; + } + .icon-link:hover, + &.active .icon-link { + opacity: 1; + } + &.active .icon-link { + display: inline-block; + transform: scale(1.1) rotate(90deg); + } } #search-instruction { diff --git a/content/links.md b/content/links.md deleted file mode 100644 index 5f20a381..00000000 --- a/content/links.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: 链接 -layout: links ---- diff --git a/content/stats.md b/content/stats.md new file mode 100644 index 00000000..cc23db72 --- /dev/null +++ b/content/stats.md @@ -0,0 +1,4 @@ +--- +title: 链接 +layout: stats +--- diff --git a/layouts/_default/links.html b/layouts/_default/links.html deleted file mode 100644 index d25566ba..00000000 --- a/layouts/_default/links.html +++ /dev/null @@ -1,75 +0,0 @@ -{{ define "main" }} - - -
- {{ partial "header.html" . }} - -
- {{ .Content }} -
- -

内部链接图谱

-
- -
- -

外部链接排行

- - {{/* Find the maximum link count */}} - {{ $max := 0 }} - {{ range .Site.Data.externallinks }} - {{ if gt (index . 1) $max }} - {{ $max = index . 1 }} - {{ end }} - {{ end }} - - -
-{{ end }} diff --git a/layouts/_default/stats.html b/layouts/_default/stats.html new file mode 100644 index 00000000..2d80ca05 --- /dev/null +++ b/layouts/_default/stats.html @@ -0,0 +1,89 @@ +{{ define "main" }} + + +
+ {{ partial "header.html" . }} + {{ partial "components/postnav.html" . }} + +
+ {{ .Content }} +
+ +

内部链接图谱

+
+ +
+ +

外部链接排行

+ + {{/* Find the maximum link count */}} + {{ $max := 0 }} + {{ range .Site.Data.externallinks }} + {{ if gt (index . 1) $max }} + {{ $max = index . 1 }} + {{ end }} + {{ end }} + + +
+ {{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/partials/components/postnav.html b/layouts/partials/components/postnav.html index ff78ddb7..5ada95e2 100644 --- a/layouts/partials/components/postnav.html +++ b/layouts/partials/components/postnav.html @@ -17,8 +17,8 @@
  • {{ T "searchInstruction" }}
  • -
  • - +
  • +
  • -- cgit v1.2.3