From 4bffe7be039f58529f9feb87eec93bcecbad7524 Mon Sep 17 00:00:00 2001 From: verdant Date: Fri, 6 Feb 2026 16:47:02 +0800 Subject: fix: note link --- public/generate-tag-pages.html | 257 +++++++++++++++++ public/generate-tag-pages.html~ | 257 +++++++++++++++++ public/how-do-i-build-this-site.html | 2 +- public/how-do-i-build-this-site.html~ | 431 +++++++++++++++++++++++++++++ public/index.html | 2 +- public/index.html~ | 250 +++++++++++++++++ public/radical-minimalist-web-design.html | 2 +- public/radical-minimalist-web-design.html~ | 288 +++++++++++++++++++ public/tags/emacs.html | 2 +- public/tags/emacs.html~ | 214 ++++++++++++++ public/tags/minimalism.html | 2 +- public/tags/minimalism.html~ | 213 ++++++++++++++ public/tags/philosophy.html | 2 +- public/tags/philosophy.html~ | 213 ++++++++++++++ public/tags/technology.html | 2 +- public/tags/technology.html~ | 214 ++++++++++++++ public/tags/web.html | 2 +- public/tags/web.html~ | 213 ++++++++++++++ public/test.html | 224 +++++++++++++++ public/test.html~ | 224 +++++++++++++++ 20 files changed, 3006 insertions(+), 8 deletions(-) create mode 100644 public/generate-tag-pages.html create mode 100644 public/generate-tag-pages.html~ create mode 100644 public/how-do-i-build-this-site.html~ create mode 100644 public/index.html~ create mode 100644 public/radical-minimalist-web-design.html~ create mode 100644 public/tags/emacs.html~ create mode 100644 public/tags/minimalism.html~ create mode 100644 public/tags/philosophy.html~ create mode 100644 public/tags/technology.html~ create mode 100644 public/tags/web.html~ create mode 100644 public/test.html create mode 100644 public/test.html~ (limited to 'public') diff --git a/public/generate-tag-pages.html b/public/generate-tag-pages.html new file mode 100644 index 0000000..5926052 --- /dev/null +++ b/public/generate-tag-pages.html @@ -0,0 +1,257 @@ + + + + + + + +生成标签页面 + + + + + +
+

生成标签页面

+

+为niwa生成一个标签页面。 +

+ +
+
(defun niwa/generate-tag-pages ()
+  "Generate tag pages under notes/tags/ from #+filetags."
+  (interactive)
+  (let* ((root (expand-file-name "~/niwa"))
+         (notes-dir (expand-file-name "notes" root))
+         (tags-dir  (expand-file-name "notes/tags" root))
+         (table (make-hash-table :test 'equal)))
+    ;; 收集 tags
+    (dolist (file (directory-files notes-dir t "\\.org$"))
+      (unless (string-match-p "/index\\.org$" file)
+        (with-temp-buffer
+          (insert-file-contents file)
+          (when (re-search-forward "^#\\+filetags:[ \t]*\\(.*\\)$" nil t)
+            (dolist (tag (split-string (match-string 1) ":" t))
+              (push file (gethash tag table)))))))
+    ;; 写入 tags/*.org
+    (make-directory tags-dir t)
+    (maphash
+     (lambda (tag files)
+       (with-temp-file (expand-file-name (concat tag ".org") tags-dir)
+         (insert "#+title: #" tag "\n")
+         (insert "#+SETUPFILE: ../../template/setup/minimal.setup\n\n")
+         (dolist (f (delete-dups files))
+           (insert
+            (format "- [[file:../%s][%s]]\n"
+                    (file-name-nondirectory f)
+                    (with-temp-buffer
+                      (insert-file-contents f)
+                      (if (re-search-forward "^#\\+title:[ \t]*\\(.*\\)$" nil t)
+                          (match-string 1)
+                        (file-name-base f))))))))
+     table)))
+
+
+ +

+Tags: +

+ +
+ + diff --git a/public/generate-tag-pages.html~ b/public/generate-tag-pages.html~ new file mode 100644 index 0000000..3893910 --- /dev/null +++ b/public/generate-tag-pages.html~ @@ -0,0 +1,257 @@ + + + + + + + +生成标签页面 + + + + + +
+

生成标签页面

+

+为niwa生成一个标签页面。 +

+ +
+
(defun niwa/generate-tag-pages ()
+  "Generate tag pages under notes/tags/ from #+filetags."
+  (interactive)
+  (let* ((root (expand-file-name "~/niwa"))
+         (notes-dir (expand-file-name "notes" root))
+         (tags-dir  (expand-file-name "notes/tags" root))
+         (table (make-hash-table :test 'equal)))
+    ;; 收集 tags
+    (dolist (file (directory-files notes-dir t "\\.org$"))
+      (unless (string-match-p "/index\\.org$" file)
+        (with-temp-buffer
+          (insert-file-contents file)
+          (when (re-search-forward "^#\\+filetags:[ \t]*\\(.*\\)$" nil t)
+            (dolist (tag (split-string (match-string 1) ":" t))
+              (push file (gethash tag table)))))))
+    ;; 写入 tags/*.org
+    (make-directory tags-dir t)
+    (maphash
+     (lambda (tag files)
+       (with-temp-file (expand-file-name (concat tag ".org") tags-dir)
+         (insert "#+title: #" tag "\n")
+         (insert "#+SETUPFILE: ../../template/setup/minimal.setup\n\n")
+         (dolist (f (delete-dups files))
+           (insert
+            (format "- [[file:../%s][%s]]\n"
+                    (file-name-nondirectory f)
+                    (with-temp-buffer
+                      (insert-file-contents f)
+                      (if (re-search-forward "^#\\+title:[ \t]*\\(.*\\)$" nil t)
+                          (match-string 1)
+                        (file-name-base f))))))))
+     table)))
+
+
+ +

+Tags: +

+ +
+ + diff --git a/public/how-do-i-build-this-site.html b/public/how-do-i-build-this-site.html index 0ff8b18..ea7a4d6 100644 --- a/public/how-do-i-build-this-site.html +++ b/public/how-do-i-build-this-site.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + 我是如何构建这个站点的 diff --git a/public/how-do-i-build-this-site.html~ b/public/how-do-i-build-this-site.html~ new file mode 100644 index 0000000..0ff8b18 --- /dev/null +++ b/public/how-do-i-build-this-site.html~ @@ -0,0 +1,431 @@ + + + + + + + +我是如何构建这个站点的 + + + + + +
+

我是如何构建这个站点的

+ +

+在Github上查看这个项目→ +

+ +
+ +
+

这个网站是怎么做的?

+
+

+仅用 Emacs 两个脚本文件: +

+ +
+$ tree scripts
+scripts
+├── niwa.sh
+└── publish.el
+
+ +
    +
  • niwa.sh: 主程序,处理命令。目前只有 new 用于新建笔记,build 用于构建。
  • +
  • publish.el: 一个 Elisp 脚本,做一些配置,批量导出 org 为 html。
  • +
+
+ +
+

niwa.sh

+
+
+
+

new_note()

+
+
+
new_note() {
+    file_name=$1
+    cp $TEMPLATE_FILE "$NOTES_DIR/${file_name}.org" && echo "创建笔记成功:$NOTES_DIR/${file_name}.org"
+    echo "#+EXPORT_FILE_NAME: $PUBLIC_DIR/${file_name}.html" >> "$NOTES_DIR/${file_name}.org"
+}
+
+
+ +

+原理非常简单,复制模板 org 文件到命令行参数给定的文件名。并且将一个导出配置重定向到这个文件,用于导出单页 html。 +

+ +

+在 template.org 中只有两行文本: +

+ +
+
#+title:
+#+SETUPFILE: ~/niwa/template/setup/minimal.setup
+
+
+ +

+第一行标题,第二行引入 setup: +

+ +
+
#+AUTHOR: Verdant
+#+EMAIL: i@glowisle.me
+#+LANGUAGE: zh-CN
+#+OPTIONS: num:nil
+#+HTML_HEAD: <style>
+#+HTML_HEAD: body {
+#+HTML_HEAD:    background-color: black;
+#+HTML_HEAD:    color: white;
+#+HTML_HEAD: }
+#+HTML_HEAD: a {
+#+HTML_HEAD:    color: white;
+#+HTML_HEAD: }
+#+HTML_HEAD: </style>
+
+
+ +

+只是信息配置和一些为了护眼的强制暗色模式。 +

+
+
+ + +
+

build()

+
+
+
build() {
+    emacs --batch \
+        -l ~/.config/emacs/lisp/doom.el \
+        -l "${SCRIPTS_DIR}/publish.el" \
+        --eval "(org-publish-project \"niwa\" t)"
+}
+
+
+ +

+通过 emacs 的 --batch 选项,将 emacs 作为 elisp 脚本解释器使用。 +

+
+
+
+ +
+

publish.el

+
+
+
(setq org-publish-project-alist
+      '(("niwa-notes"
+         :base-directory "~/niwa/notes"
+         :base-extension "org"
+         :recursive t
+         :publishing-directory "~/niwa/public"
+         :publishing-function org-html-publish-to-html
+         :with-author nil
+         :with-creator nil
+         :section-numbers nil)
+
+         ("niwa"
+          :components ("niwa-notes"))))
+
+
+ +

+配置发布信息,包括源文件、输出位置、递归等。 +

+
+
+ +
+

发布

+
+

+先构建静态文件 +

+ +
+$ bash ./script/niwa.sh build
+
+ +

+然后推送到 git 仓库,Cloudflare Pages 会自动触发构建。 +

+
+
+
+ + +
+

一点题外话

+
+

+大概在去年,我的博客的副标题包含「数字花园」这四个字,我当时并不是特别清楚数字花园意味着什么(现在可能也是)。 +

+ +

+我从 2025 年 9 月 17 日开始用手机 Obsidian的Banyan插件来写一些文章的草稿或思考过程,但写着写着就变成日记了,而且还是不太正能量的倒垃圾日记。它早期的状态很像数字花园,我也一直有做一个公开的数字花园的想法。 +

+ +

+在今年 1 月 27 日,eltrac发布了他的新站,觉得这样的形式挺有趣的,而且在网站介绍的第一行有这样一句话: +

+ +
+

+This is a mother-fucking website. +

+
+ +

+我点进了那个链接,仔细看了一下,非常认同他的观点,网页应该应该: +

+ +
    +
  • 轻量、快速
  • +
  • 可用、可读、可访问
  • +
  • 内容优先,而不是装饰优先
  • +
+ +

+于是就按照那个方向,开始着手做一个数字花园。 +

+ +

+我用起来比较方便的工具,不是 Obsidian 和 Notion,而是 Emacs,所以我就想到了用 org-mode 来做这件事。 +

+ +

+这套流程虽然不是最优解,但也许是最适合我的。 +

+ +

+嗯?你问我为什么不全在 Emacs 里做?因为我讨厌写 Elisp!!! +

+ +

+这门语言一点也不优雅,写多了之后,连语法怪异不堪的 shell 脚本都觉得无比香甜了…… +

+
+
+
+ + diff --git a/public/index.html b/public/index.html index b84f2ad..2512f30 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Verdant的杂物间 diff --git a/public/index.html~ b/public/index.html~ new file mode 100644 index 0000000..b84f2ad --- /dev/null +++ b/public/index.html~ @@ -0,0 +1,250 @@ + + + + + + + +Verdant的杂物间 + + + + + +
+

Verdant的杂物间

+
+

目录

+ +
+
+ +

+This is a motherfucking-website. +

+ +

+这里是 Verdant 的杂物间,映屿的一部分,也是「激进极简主义网页设计」的实验田。内容的风格上更像数字花园。会发布一些半成品文章、某些问题的解决方案或笔记。如果你对这个站点使用了什么技术感兴趣,可以阅读《我是如何构建这个站点的》。 +

+ + + +
+

小径

+
+ +
+
+
+ + diff --git a/public/radical-minimalist-web-design.html b/public/radical-minimalist-web-design.html index 18d793b..b7b7d7a 100644 --- a/public/radical-minimalist-web-design.html +++ b/public/radical-minimalist-web-design.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + 激进极简主义网页设计 diff --git a/public/radical-minimalist-web-design.html~ b/public/radical-minimalist-web-design.html~ new file mode 100644 index 0000000..18d793b --- /dev/null +++ b/public/radical-minimalist-web-design.html~ @@ -0,0 +1,288 @@ + + + + + + + +激进极简主义网页设计 + + + + + +
+

激进极简主义网页设计

+ + +
+

极简主义

+
+

+极简主义(英语:Minimalism),是第二次世界大战之后的 1960 年代所兴起的一个艺术派系,又可称为“Minimal Art”,作为对抽象表现主义的反动而走向极致,以最原初的物自身或形式展示于观者面前为表现方式,意图消弥作者借着作品对观者意识的压迫性,极少化作品作为文本或符号形式出现时的暴力感,开放作品自身在艺术概念上的意像空间,让观者自主参与对作品的建构,最终成为作品在不特定限制下的作者。 +

+
+
+ +
+

激进极简主义网页设计

+
+
+
+

纯静态

+
+

+作为由个人撰写的博客、资料、笔记展示页面,不需要任何后端代码,以内容为核心,保持简单、轻量、可维护。读者不需要在这个页面上有任何互动,唯一需要的就是用眼睛阅读文字。 +

+
+
+
+

仅必要的 CSS 且无 JS

+
+

+由于读者只需要做一件事:阅读,所以这个页面不需要任何花里胡哨的装饰,包括但不限于:鼠标指针、艺术字体、背景图片。也不需要任何表单交互、以及弹窗广告、悬浮广告,并且引入 Javascript 代码会带来网页的性能问题,哪怕加载慢了 0.01ms。 +

+
+
+
+

以文字为中心

+
+

+言简意赅地阐述观点,尽可能减少图片出现的比重,对服务器带宽和读者的流量都友好。 +

+
+
+
+

其他

+
+

+我见过不少「功能丰富」的博客站点,比如 Live2D 看板娘、音乐播放器、天气时间显示、读完一篇文章还没加载出来的开屏图……我认为这和信息的传播 完全没有任何关系 。当然,适当的装饰是锦上添花,但 别太过了 。 +

+ +

+这个网站就是把简单做到极致的尝试,也许在不少人眼中看来这是「简陋」「低技术力」的表现,但要先弄清楚一个站点是在为什么而服务。这种设计选择牺牲了互动性、表现力与所谓的现代感,但我认为这是值得的。 +

+
+
+
+ + +
+ + diff --git a/public/tags/emacs.html b/public/tags/emacs.html index 0508996..5505fb6 100644 --- a/public/tags/emacs.html +++ b/public/tags/emacs.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + #emacs diff --git a/public/tags/emacs.html~ b/public/tags/emacs.html~ new file mode 100644 index 0000000..0508996 --- /dev/null +++ b/public/tags/emacs.html~ @@ -0,0 +1,214 @@ + + + + + + + +#emacs + + + + + +
+

#emacs

+ +
+ + diff --git a/public/tags/minimalism.html b/public/tags/minimalism.html index c21ca87..e5bd579 100644 --- a/public/tags/minimalism.html +++ b/public/tags/minimalism.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + #minimalism diff --git a/public/tags/minimalism.html~ b/public/tags/minimalism.html~ new file mode 100644 index 0000000..c21ca87 --- /dev/null +++ b/public/tags/minimalism.html~ @@ -0,0 +1,213 @@ + + + + + + + +#minimalism + + + + + +
+

#minimalism

+ +
+ + diff --git a/public/tags/philosophy.html b/public/tags/philosophy.html index 47afff0..bbb1d0c 100644 --- a/public/tags/philosophy.html +++ b/public/tags/philosophy.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + #philosophy diff --git a/public/tags/philosophy.html~ b/public/tags/philosophy.html~ new file mode 100644 index 0000000..47afff0 --- /dev/null +++ b/public/tags/philosophy.html~ @@ -0,0 +1,213 @@ + + + + + + + +#philosophy + + + + + +
+

#philosophy

+ +
+ + diff --git a/public/tags/technology.html b/public/tags/technology.html index ffb85ba..e973b60 100644 --- a/public/tags/technology.html +++ b/public/tags/technology.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + #technology diff --git a/public/tags/technology.html~ b/public/tags/technology.html~ new file mode 100644 index 0000000..ffb85ba --- /dev/null +++ b/public/tags/technology.html~ @@ -0,0 +1,214 @@ + + + + + + + +#technology + + + + + +
+

#technology

+ +
+ + diff --git a/public/tags/web.html b/public/tags/web.html index ae7aca7..f4403bc 100644 --- a/public/tags/web.html +++ b/public/tags/web.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + #web diff --git a/public/tags/web.html~ b/public/tags/web.html~ new file mode 100644 index 0000000..ae7aca7 --- /dev/null +++ b/public/tags/web.html~ @@ -0,0 +1,213 @@ + + + + + + + +#web + + + + + +
+

#web

+ +
+ + diff --git a/public/test.html b/public/test.html new file mode 100644 index 0000000..d90933a --- /dev/null +++ b/public/test.html @@ -0,0 +1,224 @@ + + + + + + + +Title + + + + + +
+

Title

+
+

目录

+
+ +
+
+ + + +
+

Content

+
+
+ + diff --git a/public/test.html~ b/public/test.html~ new file mode 100644 index 0000000..f6cf567 --- /dev/null +++ b/public/test.html~ @@ -0,0 +1,224 @@ + + + + + + + +Title + + + + + +
+

Title

+
+

目录

+
+ +
+
+ + + +
+

Content

+
+
+ + -- cgit v1.2.3