本網站的主頁
Find a file
2025-12-23 14:37:01 +08:00
.vscode feat: initial commit 2025-09-10 19:51:13 +08:00
cc fix: page & cc lang field 2025-12-02 13:36:14 +08:00
src chore:增加了公安備案信息 2025-12-23 14:37:01 +08:00
ssg@0e919a3f7a feat: initial commit 2025-09-10 19:51:13 +08:00
tpl feat: prepare for zh-CN site 2025-11-13 13:31:58 +08:00
.gitignore feat: prepare for zh-CN site 2025-11-13 13:31:58 +08:00
.gitmodules feat: initial commit 2025-09-10 19:51:13 +08:00
CC-BY-4.0 feat: initial commit 2025-09-10 19:51:13 +08:00
cc.sh feat: prepare for zh-CN site 2025-11-13 13:31:58 +08:00
LICENSE feat: initial commit 2025-09-10 19:51:13 +08:00
mk.sh feat: prepare for zh-CN site 2025-11-13 13:31:58 +08:00
README.md fix: up to date with omnisrv 2025-11-23 17:38:29 +08:00

amaharacya.one

本網站的主頁。

基本流程

首先,克隆此倉庫:

  • git clone https://git.amaharacya.one/amainait/amaharacya.one.git

之後,選擇任一伺服方案:

omnisrv

展開閱讀
  1. 準備 omnisrv 程式:
sudo apt install golang
git clone https://codeberg.org/NaitLee/omnisrv.git
cd omnisrv
./build.sh
export PATH="$(pwd)/bin:$PATH"

若在構建時無法安裝 Go 依賴,可配置 Goproxy

  1. 任選一個使用方式:
cd ../amaharacya.one
omnisrv -site src -addr [::]:8080
omnisrv-ssg -site src -out out
omnisrv-9p -site src -proto unix -addr /tmp/omnisrv
  1. 每次更新此倉庫後也請更新 omnisrv。

  2. 若需建設 zh-CN 頁面,請安裝 OpenCC 並執行 ./cc.sh,同時使用以下指令:

omnisrv -site src_zh-CN -host amaharacya.xyz

dummy-ssg

展開閱讀

請留意dummy-ssg 對網站的新增功能支援不完整。現推薦使用 omnisrv。

  1. 準備 dummy-ssg 環境
  • 準備子模組: git submodule update --init ssg
  • 準備依賴: apt install php-cli php-mbstring php-xml
  • 對於非 Debian 系統,可直接運行 ./mk.sh,參考錯誤訊息補充缺失的 PHP 依賴。一些發行版的 PHP 自帶 php_mbstring 和 php-xml。
  1. 構建靜態頁面
  • ./mk.sh
  • 結果置於 out 目錄。
  1. 伺服
  • python3 -m http.server -d out
  • 正式部署請使用更好的靜態檔案伺服器。

小技巧

新頁面放在 src/page

omnisrv 模板在 src/tmpl.htmldummy-ssg (PHP) 模板在 tpl/*.php

一級標題在 /page 頁面自動列出。

與 dummy-ssg 標準不同,資源文件放在 src/assets 並且直接鏈接 (<link href="/assets/..." />),而非放入 tpl

同時,倉庫中的 Markdown 文檔頭部使用簡易鍵值對,而非 JSON:

---
title 標題
lang zh-TW
date 2025-09-29
---

# 長標題

正文...

授權

Copyright © 2025 Amahara Oyama & Nait.

除非另有宣告,所有原始碼以 MIT/Expat 協議釋出,所有頁面內容以 CC-BY-4.0 協議釋出。