amaharacya.one/README.md
2025-09-30 02:43:14 +08:00

88 lines
2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# amaharacya.one
本網站的主頁。
## 基本流程
首先,克隆此倉庫:
- `git clone https://git.amaharacya.one/amainait/amaharacya.one.git`
之後,選擇任一伺服方案:
### [dummy-ssg](https://codeberg.org/haydenwu/dummy-ssg)
<details>
<summary>展開閱讀</summary>
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。
2. 構建靜態頁面
- `./mk.sh`
- 結果置於 `out` 目錄。
3. 伺服
- `python3 -m http.server -d out`
- 正式部署請使用更好的靜態檔案伺服器。
</details>
### [omnisrv](https://codeberg.org/NaitLee/omnisrv)
<details>
<summary>展開閱讀</summary>
1. 準備 omnisrv 程式:
```sh
git clone https://codeberg.org/NaitLee/omnisrv.git
cd omnisrv
go build ./bin ./cmd/...
export PATH="$(pwd)/bin:$PATH"
```
若無法安裝 Go 依賴,可配置 [Goproxy](https://goproxy.cn/)。
2. **任選一個**使用方式:
```sh
cd ../amaharacya.one
omnisrv -site src -addr [::]:8080
omnisrv-ssg -site src -out out
omnisrv-9p -site src -proto unix -addr /tmp/omnisrv
```
</details>
## 小技巧
新頁面放在 `src/page`
PHP 模板在 `tpl/*.php`omnisrv 模板在 `src/tmpl.html`
一級標題在 `/page` 頁面自動列出。
與 dummy-ssg 標準不同,資源文件放在 `src/assets` 並且直接鏈接 (`<link href="/assets/..." />`),而非放入 `tpl`
同時,倉庫中的 Markdown 文檔頭部使用簡易鍵值對,而非 JSON:
```
---
title 標題
lang zh-TW
date 2025-09-29
---
# 長標題
正文...
```
## 授權
Copyright © 2025 [Amahara Oyama](https://www.amaharacya.one/) & [Nait](https://unseen-site.fun/).
除非另有宣告,所有原始碼以 [MIT/Expat 協議](./LICENSE)釋出,所有頁面內容以 [CC-BY-4.0 協議](./CC-BY-4.0)釋出。