Skip to content

ChenPi11/ChenPi11.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChenPi11's Blog

有史以来最难以维护的博客

使用到的工具

包管理器/项目管理器

NPM

  • NPM
    • NPM 主要用于管理项目 JavaScript 部分的依赖,同时用于获取一些代码

CMake

  • CMake
    • 用于维护 mkpostlists 相关代码,而且提供了一个 configure 脚本

GNU Autoconf

  • GNU Autoconf
    • 用于维护 build-post 相关代码

GNU Make

  • GNU Make
    • 这是项目最核心的部分,贯穿于整个构建流程中

Cargo

  • Cargo
    • 用于维护 new-post 相关代码

Python Pip

  • Python Pip
    • 维护 build-blog, lang-stat , trim-wwwroot 相关代码

Human

  • 人类
    • 维护项目的所有部分,这是最重要的管理器

其他工具

Debian GNU/Linux

  • 类 Unix 系统
    • 如果想要开发,必须使用类 Unix 系统,优先选择 Debian GNU/Linux

Git

  • Git
    • 使用 Git 进行版本控制

GitHub

  • GitHub
    • 使用 GitHub 托管项目和静态网页

VS Code

  • VS Code
    • IDE

Copilot

  • Copilot
    • 用于辅助开发,其重要性仅次于人类

MarsCode

  • MarsCode
    • 用于代码补全,其重要性仅次于 Copilot

WSL

  • WSL
    • 提供运行环境

Microsoft Windows

  • Microsoft Windows
    • 提供 WSL 和 VSCode 的运行环境

Lenovo Laptop

  • Lenovo 笔记本
    • 提供 Microsoft Windows 的运行环境

Logitech Mouse

  • Logitech 鼠标
    • 使得开发更加流畅

使用到的语言

HTML

  • HTML
    • 用于显示网页

CSS

  • CSS
    • 用于美化网页

JavaScript

  • JavaScript
    • 用于添加交互和动画

Shell Script

  • Shell Script
    • 用于自动化构建和部署

Makefile

  • Makefile
    • 管理构建流程

Python

  • Python
    • 用于编写脚本和工具

Rust

  • Rust
    • 用于编写脚本和工具

C

  • C
    • 用于编写脚本和工具

C++

  • C++
    • 用于编写脚本和工具

TypeScript

  • TypeScript
    • 用于编写脚本和工具

Markdown

  • Markdown
    • 用于编写文档,文章和文章

M4

  • M4
    • 用于编写 Autoconf 脚本

YAML

  • YAML
    • 用于配置 Rubisco 工作流,GitHub Actions 等

TOML

  • TOML
    • 用于配置 Rust 项目

JSON

  • 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

  • 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

安装 Cargo, rustc

尽管 Debian 官方源已经提供了 Cargo,但是版本过低,需要手动安装新版本。

Debian sid 提供了 rustup 用于安装 Rust 工具链,但是有些 Debian 稳定版并未提供 rustup,需要手动安装。

sudo apt update
sudo apt install rustup
rustup install stable
rustup default stable

安装 cargo-make

注意:确保你的 ~/.cargo/binPATH 中!

不同的发行版安装 cargo-make 的方式可能不同,参考 cargo-make 仓库中对于安装的描述。

这是我使用的安装方式:

cargo install --force cargo-make

换源

由于官方源访问速度慢,或者是版本过低,需要换源。

Nodesource 源:提供新版本的 Node.js

curl -fsSL https://deb.nodesource.com/setup_23.x | sudo bash -

Rustup 源:提供 Rustup 工具链

export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
rustup install stable
rustup default stable

Cargo 源:提供 Crate.io 上的 Rust 包

首先创建 ~/.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 源:提供 NPM 包

注意:这会更改用户全局的 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 源:提供 Python 包

注意:这会更改用户全局的 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 依赖

go mod tidy

构建

cd ChenPi11.github.io
./scripts/build.sh

运行

make run

About

website

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published