有史以来最难以维护的博客
- NPM
- NPM 主要用于管理项目 JavaScript 部分的依赖,同时用于获取一些代码
- CMake
- 用于维护
mkpostlists
相关代码,而且提供了一个 configure 脚本
- 用于维护
- GNU Autoconf
- 用于维护
build-post
相关代码
- 用于维护
- GNU Make
- 这是项目最核心的部分,贯穿于整个构建流程中
- Cargo
- 用于维护
new-post
相关代码
- 用于维护
- Python Pip
- 维护
build-blog
,lang-stat
,trim-wwwroot
相关代码
- 维护
- 人类
- 维护项目的所有部分,这是最重要的管理器
- 类 Unix 系统
- 如果想要开发,必须使用类 Unix 系统,优先选择 Debian GNU/Linux
- Git
- 使用 Git 进行版本控制
- GitHub
- 使用 GitHub 托管项目和静态网页
- VS Code
- IDE
- Copilot
- 用于辅助开发,其重要性仅次于人类
- MarsCode
- 用于代码补全,其重要性仅次于 Copilot
- WSL
- 提供运行环境
- Microsoft Windows
- 提供 WSL 和 VSCode 的运行环境
- Lenovo 笔记本
- 提供 Microsoft Windows 的运行环境
- Logitech 鼠标
- 使得开发更加流畅
- HTML
- 用于显示网页
- CSS
- 用于美化网页
- JavaScript
- 用于添加交互和动画
- Shell Script
- 用于自动化构建和部署
- Makefile
- 管理构建流程
- Python
- 用于编写脚本和工具
- Rust
- 用于编写脚本和工具
- C
- 用于编写脚本和工具
- C++
- 用于编写脚本和工具
- TypeScript
- 用于编写脚本和工具
- Markdown
- 用于编写文档,文章和文章
- M4
- 用于编写 Autoconf 脚本
- YAML
- 用于配置 Rubisco 工作流,GitHub Actions 等
- TOML
- 用于配置 Rust 项目
- JSON
- 用于配置 NPM 项目,TypeScript 项目,Rubisco 项目等
-
一个 POSIX Shell 和 类 Unix 环境
- 必须
- 推荐使用 Debian GNU/Linux
- 推荐使用 Bash 和 Zsh
-
Coreutils
- 必须
- 需要
arch
,uname
,basename
,cat
,chmod
,cp
,cut
,date
,dirname
,echo
,expr
,free
,head
,hostname
,install
,ln
,ls
,mkdir
,mktemp
,mv
,od
,rm
,rmdir
,sleep
,sort
,tail
,touch
,tr
,true
,uname
,wc
-
GNU Awk
- 必须
-
本地 C 和 C++ 编译器,链接器
- 必须
- 推荐使用 GCC
-
Git
- 必须
-
Gnulib
- 必须
- 必须能够提供 gnulib-tool 命令,参见 http://www.gnu.org/software/gnulib/
-
GNU Autoconf, GNU Automake, GNU M4
- 必须
-
GNU sed
- 必须
-
Grep
- 必须
-
GNU Make
- 必须
-
Cargo, rustc
- 必须
-
CMake
- 必须
-
Go
- 必须
-
Node.js, npm
- 必须
-
Python, python3-pip, python3-venv
- 必须
-
Screenfetch
- 必须
-
GNU Gettext
- 必须
-
bsdutils
- 必须,需要
script
命令
- 必须,需要
注意:Debian 原版的 Node.js 版本过低,需要手动换源安装新版本!
sudo apt update
sudo apt install -y coreutils gnulib autoconf automake m4 sed grep make cmake golang nodejs npm python3-pip python3-venv screenfetch gettext bsdutils
尽管 Debian 官方源已经提供了 Cargo,但是版本过低,需要手动安装新版本。
Debian sid 提供了 rustup 用于安装 Rust 工具链,但是有些 Debian 稳定版并未提供 rustup,需要手动安装。
sudo apt update
sudo apt install rustup
rustup install stable
rustup default stable
注意:确保你的 ~/.cargo/bin
在 PATH
中!
不同的发行版安装 cargo-make
的方式可能不同,参考 cargo-make
仓库中对于安装的描述。
这是我使用的安装方式:
cargo install --force cargo-make
由于官方源访问速度慢,或者是版本过低,需要换源。
curl -fsSL https://deb.nodesource.com/setup_23.x | sudo bash -
export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
rustup install stable
rustup default stable
首先创建 ~/.cargo/config.toml
文件
mkdir -p ~/.cargo
touch ~/.cargo/config.toml
然后编辑 ~/.cargo/config.toml
文件,添加以下内容
注意:这会更改用户全局的 Cargo 源
[source.crates-io]
replace-with = 'tuna'
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
注意:这会更改用户全局的 NPM 源
sudo npm install -g nrm
sudo nrm ls # 列出所有可用源
# npm ---------- https://registry.npmjs.org/
# yarn --------- https://registry.yarnpkg.com/
#* tencent ------ https://mirrors.cloud.tencent.com/npm/
# cnpm --------- https://r.cnpmjs.org/
# taobao ------- https://registry.npmmirror.com/
# npmMirror ---- https://skimdb.npmjs.com/registry/
# huawei ------- https://repo.huaweicloud.com/repository/npm/
nrm use tencent # 使用腾讯源
注意:这会更改用户全局的 Pip 源
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
git clone https://github.com/ChenPi11/ChenPi11.github.io --depth 1
go mod tidy
cd ChenPi11.github.io
./scripts/build.sh
make run