From e76b6c6e3dc4500647d3dabf5f05f214b020ca19 Mon Sep 17 00:00:00 2001 From: yingyu5658 Date: Mon, 2 Feb 2026 23:19:02 +0800 Subject: Initial commit --- .gitignore | 1 + README.org | 34 +++++++++++++++++++++++++++++ notes/how-do-i-build-this-site.org | 5 +++++ notes/index.org | 16 ++++++++++++++ notes/radical-minimalist-web-design.org | 24 +++++++++++++++++++++ notes/tags/minimalism.org | 3 +++ notes/tags/philosophy.org | 3 +++ notes/tags/web.org | 3 +++ scripts/niwa.sh | 34 +++++++++++++++++++++++++++++ scripts/publish.el | 38 +++++++++++++++++++++++++++++++++ template/setup/minimal.setup | 13 +++++++++++ template/template.org | 2 ++ 12 files changed, 176 insertions(+) create mode 100644 .gitignore create mode 100644 README.org create mode 100644 notes/how-do-i-build-this-site.org create mode 100644 notes/index.org create mode 100644 notes/radical-minimalist-web-design.org create mode 100644 notes/tags/minimalism.org create mode 100644 notes/tags/philosophy.org create mode 100644 notes/tags/web.org create mode 100644 scripts/niwa.sh create mode 100644 scripts/publish.el create mode 100644 template/setup/minimal.setup create mode 100644 template/template.org diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/README.org b/README.org new file mode 100644 index 0000000..d511287 --- /dev/null +++ b/README.org @@ -0,0 +1,34 @@ +#+title: niwa +#+AUTHOR: Verdant +#+LANGUAGE: zh-CN + +** niwa 是什么 +niwa(庭 / にわ)是我的 *极简数字花园实现方式* 。 _[[https://www.glowisle.me/][映屿]]的一部分_ 。 + +它不是博客框架,也不是 CMS,而是一套基于(doom) Emacs 的朴素的约定: + +- 使用 Org mode 写作 +- 使用 bash 和 elisp 脚本实现导出为静态 HTML +- 不依赖任何数据库、后端、Javascript 或复杂构建工具 +- 关注内容本身 + +[[https://niwa.glowisle.me/][在线演示]] + +** 使用方式 +*** 新建内容 +#+begin_src +$ cd ~/niwa +$ bash ./script/niwa new my-post +#+end_src +*** 导出为 HTML 文件 +#+begin_src +$ mkdir -p ~/niwa/public +$ bash ./script/niwa.sh build +#+end_src + +** 设计理念 +- 简单轻量 +- 内容优先,而非主题或样式 +- 纯文本 +- 构建过程可理解、可修改 +- 能用 bash 脚本解决的事情,不引入额外框架 diff --git a/notes/how-do-i-build-this-site.org b/notes/how-do-i-build-this-site.org new file mode 100644 index 0000000..d2a3422 --- /dev/null +++ b/notes/how-do-i-build-this-site.org @@ -0,0 +1,5 @@ +#+title: 我是如何构建这个站点的 +#+SETUPFILE: ~/niwa/template/setup/minimal.setup +#+EXPORT_FILE_NAME: /home/yingyu5658/niwa/public/how-do-i-build-this-site.html + +这个站点只用到了两样东西:Emacs 和 bash。 diff --git a/notes/index.org b/notes/index.org new file mode 100644 index 0000000..a9101cb --- /dev/null +++ b/notes/index.org @@ -0,0 +1,16 @@ +#+title: Verdant的杂物间 +#+SETUPFILE: ~/niwa/template/setup/minimal.setup +#+EXPORT_FILE_NAME: ~/niwa/public/index.html + +----- + +This is a [[https://motherfuckingwebsite.com/][motherfucking-website]]. + +这里是 Verdant 的杂物间,也是我「[[./radical-minimalist-web-design.org][激进极简主义网页设计]]」的实验田。内容的风格上更像数字花园。会发布一些半成品文章、某些问题的解决方案或笔记。 + +** 最近更新 +- [[./radical-minimalist-web-design.org][激进极简主义网页设计]] + +** 小径 +*** 技术 +- [[./tags/web.org][网页]] diff --git a/notes/radical-minimalist-web-design.org b/notes/radical-minimalist-web-design.org new file mode 100644 index 0000000..8bf62e5 --- /dev/null +++ b/notes/radical-minimalist-web-design.org @@ -0,0 +1,24 @@ +#+title: 激进极简主义网页设计 +#+date: <2026-02-02 Mon> +#+filetags: :web:minimalism:philosophy: +#+SETUPFILE: ~/niwa/template/setup/minimal.setup +#+EXPORT_FILE_NAME: ~/niwa/public/radical-minimalist-web-design.html + +** 极简主义 +极简主义(英语:Minimalism),是第二次世界大战之后的 1960 年代所兴起的一个艺术派系,又可称为“Minimal Art”,作为对抽象表现主义的反动而走向极致,以最原初的物自身或形式展示于观者面前为表现方式,意图消弥作者借着作品对观者意识的压迫性,极少化作品作为文本或符号形式出现时的暴力感,开放作品自身在艺术概念上的意像空间,让观者自主参与对作品的建构,最终成为作品在不特定限制下的作者。 + +** 激进极简主义网页设计 +*** 纯静态 +作为由个人撰写的博客、资料、笔记展示页面,不需要任何后端代码,以内容为核心,保持简单、轻量、可维护。读者不需要在这个页面上有任何互动,唯一需要的就是用眼睛阅读文字。 +*** 仅必要的 CSS 且无 JS +由于读者只需要做一件事:阅读,所以这个页面不需要任何花里胡哨的装饰,包括但不限于:鼠标指针、艺术字体、背景图片。也不需要任何表单交互、以及弹窗广告、悬浮广告,并且引入 Javascript 代码会带来网页的性能问题,哪怕加载慢了 0.01ms。 +*** 以文字为中心 +言简意赅地阐述观点,尽可能减少图片出现的比重,对服务器带宽和读者的流量都友好。 +*** 其他 +我见过不少「功能丰富」的博客站点,比如 Live2D 看板娘、音乐播放器、天气时间显示、读完一篇文章还没加载出来的开屏图……我认为这和信息的传播 *完全没有任何关系* 。当然,适当的装饰是锦上添花,但 *别太过了* 。 + +这个网站就是把简单做到极致的尝试,也许在不少人眼中看来这是「简陋」「低技术力」的表现,但要先弄清楚一个站点是在为什么而服务。 + +** 参考 +- [[https://zh.wikipedia.org/zh-cn/%E6%A5%B5%E7%B0%A1%E4%B8%BB%E7%BE%A9][极简主义 - 维基百科]] +- [[https://motherfuckingwebsite.com/][motherfuck website]] diff --git a/notes/tags/minimalism.org b/notes/tags/minimalism.org new file mode 100644 index 0000000..9633f8c --- /dev/null +++ b/notes/tags/minimalism.org @@ -0,0 +1,3 @@ +#+title: #minimalism + +- [[file:../radical-minimalist-web-design.org][激进极简主义网页设计]] diff --git a/notes/tags/philosophy.org b/notes/tags/philosophy.org new file mode 100644 index 0000000..675b398 --- /dev/null +++ b/notes/tags/philosophy.org @@ -0,0 +1,3 @@ +#+title: 哲学 + +- [[file:../radical-minimalist-web-design.org][激进极简主义网页设计]] diff --git a/notes/tags/web.org b/notes/tags/web.org new file mode 100644 index 0000000..07847ad --- /dev/null +++ b/notes/tags/web.org @@ -0,0 +1,3 @@ +#+title: 网页 + +- [[file:../radical-minimalist-web-design.org][激进极简主义网页设计]] diff --git a/scripts/niwa.sh b/scripts/niwa.sh new file mode 100644 index 0000000..623763d --- /dev/null +++ b/scripts/niwa.sh @@ -0,0 +1,34 @@ +#!/usr/bin/bash + +# 配置变量 +GARDEN_DIR="$HOME/niwa" # 项目根目录 +NOTES_DIR="$GARDEN_DIR/notes" # 每篇笔记的目录 +SCRIPTS_DIR="$GARDEN_DIR/scripts" # 脚本文件目录 +PUBLIC_DIR="$GARDEN_DIR/public" # html文件目录 +TEMPLATE_FILE="$GARDEN_DIR/template/template.org" # 模板文件目录 + +# 命令 +COMMAND_NEW="new" # 新建笔记 +COMMAND_BUILD="build" + + +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" +} + +build() { + emacs --batch \ + -l ~/.config/emacs/lisp/doom.el \ + -l "${SCRIPTS_DIR}/publish.el" \ + --eval "(org-publish-project \"niwa\" t)" +} + +if test $1 = $COMMAND_NEW; then + new_note $2 +fi + +if test $1 = $COMMAND_BUILD; then + build +fi diff --git a/scripts/publish.el b/scripts/publish.el new file mode 100644 index 0000000..3db900f --- /dev/null +++ b/scripts/publish.el @@ -0,0 +1,38 @@ +;;; publish.el +;;; export notes to html +;;;-*- lexical-binding: t; -*- +;; +;; Copyright (C) 2026 Verdant +;; +;; Author: Verdant +;; Maintainer: Verdant +;; Created: February 02, 2026 +;; Modified: February 02, 2026 +;; Version: 0.0.1 +;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp +;; Package-Requires: ((emacs "24.3")) +;; +;; This file is not part of GNU Emacs. +;; +;;; Code: + +(require 'ox-html) +(require 'org) + +(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")))) + +(provide 'publish) + +;;; publish.el ends here diff --git a/template/setup/minimal.setup b/template/setup/minimal.setup new file mode 100644 index 0000000..1a8fe86 --- /dev/null +++ b/template/setup/minimal.setup @@ -0,0 +1,13 @@ +#+AUTHOR: Verdant +#+EMAIL: i@glowisle.me +#+LANGUAGE: zh-CN +#+OPTIONS: num:nil +#+HTML_HEAD: diff --git a/template/template.org b/template/template.org new file mode 100644 index 0000000..a963ea2 --- /dev/null +++ b/template/template.org @@ -0,0 +1,2 @@ +#+title: +#+SETUPFILE: ~/niwa/template/setup/minimal.setup -- cgit v1.2.3