summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/css/_markdown.scss42
-rw-r--r--content/linkroll.md31
-rw-r--r--layouts/_partials/stats/external-link-rank.html10
-rw-r--r--layouts/_shortcodes/linkrank.html2
-rw-r--r--layouts/stats.html6
5 files changed, 40 insertions, 51 deletions
diff --git a/assets/css/_markdown.scss b/assets/css/_markdown.scss
index cb70c1e4..82269dac 100644
--- a/assets/css/_markdown.scss
+++ b/assets/css/_markdown.scss
@@ -107,26 +107,28 @@ $block-background-color: var(--block-background-color);
}
// icons for specific domains
- &[href*="wikipedia.org"]::before {
- content: '';
- background-color: #fff;
- background-image: url('/icons/wikipedia.svg');
- }
- &[href*="wiktionary.org"]::before {
- content: '';
- background-color: #fff;
- background-image: url('/icons/enwiktionary.svg');
- }
- &[href*="etymonline.com"]::before {
- content: '';
- background-image: url('/icons/etymonline.jpg');
- }
- &[href*="github.com"]::before {
- content: '';
- background-image: url('/icons/github.svg');
- .dark & {
- filter: invert(1);
- }
+ &:not(.no-icon) {
+ &[href*="wikipedia.org"]::before {
+ content: '';
+ background-color: #fff;
+ background-image: url('/icons/wikipedia.svg');
+ }
+ &[href*="wiktionary.org"]::before {
+ content: '';
+ background-color: #fff;
+ background-image: url('/icons/enwiktionary.svg');
+ }
+ &[href*="etymonline.com"]::before {
+ content: '';
+ background-image: url('/icons/etymonline.jpg');
+ }
+ &[href*="github.com"]::before {
+ content: '';
+ background-image: url('/icons/github.svg');
+ .dark & {
+ filter: invert(1);
+ }
+ }
}
}
diff --git a/content/linkroll.md b/content/linkroll.md
index 50753436..2d52d51a 100644
--- a/content/linkroll.md
+++ b/content/linkroll.md
@@ -1,12 +1,9 @@
----
-date: 2025-05-06 11:12:12
-title: 林卷
-aliases:
- - /cards/links/
- - /links/
- - /blogroll/
-
----
++++
+date = 2025-05-06 11:12:12
+title = "林卷"
+aliases = ['links', 'blogroll']
+toc = true
++++
「林卷」是 Linkroll 的半音译,受到了 [Hsins](https://hsins.me/) 的启发,他把 Blogroll 译作「波卷」。这个页面收录我常看的链接,包括一些博客、播客和有意思的网站,由于内容不限于博客,所以取名 Linkroll。
@@ -26,17 +23,11 @@ aliases:
{{< linkding-bookmarks >}}
-## 我常听的中文播客
-
-<div class="flex flex-wrap gap-4">
-{{< link type="podcast" title="独树不成林" link="https://podcasts.apple.com/cn/podcast/%E7%8B%AC%E6%A0%91%E4%B8%8D%E6%88%90%E6%9E%97/id1711052890" image="https://r2.eltr.ac/uPic/2025/06/Fp3PROfjHhWN5OjBQf6Y8lUh3KkB.png%40small.png" >}}
-{{< link type="podcast" title="酒神的注脚" link="https://www.xiaoyuzhoufm.com/podcast/693a70e0da106fa4a9454469" image="https://r2.eltr.ac/uPic/2025/12/FsfHEy-lubntgUkkvs6liSfbokNy.jpg" >}}
-{{< link type="podcast" title="碳基生物生存指南" link="https://r2.eltr.ac/uPic/2025/06/Fj8-4YU1LHRuvPF76MLRlxPjzOON.png%40small.png" image="https://r2.eltr.ac/uPic/2025/06/Fj8-4YU1LHRuvPF76MLRlxPjzOON.png%40small.png" >}}
-{{< link type="podcast" title="没理想编辑部" link="https://podcasts.apple.com/cn/podcast/%E6%B2%A1%E7%90%86%E6%83%B3%E7%BC%96%E8%BE%91%E9%83%A8/id1494093522" image="https://r2.eltr.ac/uPic/2025/06/aHR0cHM6Ly9jZG4udmlzdG9waWEuY29tLmNuL2ltZy9wb2RjYXN0LW1seGZtLXYxLmpwZw==.jpg" image="https://r2.eltr.ac/uPic/2025/06/aHR0cHM6Ly9jZG4udmlzdG9waWEuY29tLmNuL2ltZy9wb2RjYXN0LW1seGZtLXYxLmpwZw%3D%3D.jpg%40small.jpeg" >}}
-{{< link type="podcast" title="不把天聊死" link="https://podcasts.apple.com/cn/podcast/%E4%B8%8D%E6%8A%8A%E5%A4%A9%E8%81%8Asi/id1577896182" image="https://r2.eltr.ac/uPic/2025/07/CKwRIJEFWqYLAADICQDz_43R.jpeg" >}}
-{{< link type="podcast" title="狐说巴道烫" link="https://podcasts.apple.com/cn/podcast/%E7%8B%90%E8%AF%B4%E5%B7%B4%E9%81%93%E7%83%AB/id1785346634" image="https://r2.eltr.ac/uPic/2025/07/Fmz_fSwNZsndOSHbFpsmFapsff3C.jpg%40small.jpeg" >}}
-{{< link type="podcast" title="出逃在即" link="https://podcasts.apple.com/cn/podcast/%E5%87%BA%E9%80%83%E5%9C%A8%E5%8D%B3/id1533388375" image="https://r2.eltr.ac/uPic/2025/07/wKgLeVzROzDj4lIuAABIzF2QcC0323.jpg" >}}
-</div>
+## 外部链接排行
+
+以下是博客的外部链接统计,也就是文章中所引用的来自其他网域的链接数量排名。引用次数少于 3 的已被排除。
+
+{{< linkrank >}}
---
diff --git a/layouts/_partials/stats/external-link-rank.html b/layouts/_partials/stats/external-link-rank.html
index ce0bf2ea..8aa6c64b 100644
--- a/layouts/_partials/stats/external-link-rank.html
+++ b/layouts/_partials/stats/external-link-rank.html
@@ -15,17 +15,17 @@
{{ $sorted = sort $sorted "count" "desc" }}
<ol id="external-link-rank"
- class="p-0 m-0 max-h-[700px] overflow-y-auto box-border">
+ class="p-0! m-0 box-border">
{{ range $sorted }}
{{ $label := .domain }}
{{ $count := .count }}
{{ if gt $count 2 }}
{{ $percent := div (mul $count 100) $max }}
<li class="list-none w-full my-2 box-border py-[0.1rem] px-2 relative">
- <div class="mb-1 flex justify-between items-center">
- <a class="inline-flex items-center gap-2" href="https://{{ $label }}/" target="_blank">
- <img src="https://favicone.com/{{ $label }}?s=50"
- class="w-4 h-4"/>
+ <div class="mx-2 flex justify-between items-center">
+ <a class="inline-flex items-center gap-2 no-icon" href="https://{{ $label }}/" target="_blank">
+ <img src="https://favicone.com/{{ $label }}?s=20"
+ class="w-4 h-4 m-0!" loading="lazy" />
{{ $label }}
</a>
<span class="text-secondary font-mono">{{ $count }}</span>
diff --git a/layouts/_shortcodes/linkrank.html b/layouts/_shortcodes/linkrank.html
new file mode 100644
index 00000000..19de1fe6
--- /dev/null
+++ b/layouts/_shortcodes/linkrank.html
@@ -0,0 +1,2 @@
+{{ partial "stats/external-link-rank" . }}
+
diff --git a/layouts/stats.html b/layouts/stats.html
index 7dd82717..82f8e675 100644
--- a/layouts/stats.html
+++ b/layouts/stats.html
@@ -28,12 +28,6 @@
</div>
</section>
<hr>
-
- <section>
- <h2>外部链接排行</h2>
- <p>我在页面中嵌入的外部链接主要来自以下域名,引用次数少于 3 的已被排除。</p>
- {{ partial "stats/external-link-rank" . }}
- </section>
</article>
{{ partial "footer.html" . }}
{{ end }}