Pages

Friday, 15 November 2024

搭建静态博客程序mdblog-by-nigulasikk

 运行 如下命令,安装nodejs环境。
curl -fsSL https://fnm.vercel.app/install | bash
source /root/.bashrc
fnm use --install-if-missing 22

root@racknerd-626f077:~# node --version
v22.11.0

git clone https://github.com/nigulasikk/mdblog mdblog-by-nigulasikk
root@racknerd-626f077:~# cd mdblog-by-nigulasikk
root@racknerd-626f077:~/mdblog-by-nigulasikk# npm install -g pnpm
root@racknerd-626f077:~/mdblog-by-nigulasikk# pnpm install
root@racknerd-626f077:~/mdblog-by-nigulasikk# pnpm build  (此即生成/更新静态网站的根目录的命令。)
root@racknerd-626f077:~/mdblog-by-nigulasikk# ls
build     deploy.sh     package.json    README.md  webpack.config.js
build.js  node_modules  pnpm-lock.yaml  src
root@racknerd-626f077:~/mdblog-by-nigulasikk# ls build
1.说明书.html  2.第二篇文章.html  assets  index.html  posts.html
root@racknerd-626f077:~/mdblog-by-nigulasikk# cd build
root@racknerd-626f077:~/mdblog-by-nigulasikk/build# ls
1.说明书.html  2.第二篇文章.html  assets  index.html  posts.html
root@racknerd-626f077:~/mdblog-by-nigulasikk/build# python3 -m http.server 1234
root@racknerd-626f077:~/mdblog-by-nigulasikk/build# cd ..
root@racknerd-626f077:~/mdblog-by-nigulasikk# ls
build     deploy.sh     package.json    README.md  webpack.config.js
build.js  node_modules  pnpm-lock.yaml  src
root@racknerd-626f077:~/mdblog-by-nigulasikk# cd src
root@racknerd-626f077:~/mdblog-by-nigulasikk/src# ls
assets  components  index.html  markdowns  uiDevelop.js
root@racknerd-626f077:~/mdblog-by-nigulasikk/src# cd markdowns
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# ls
1.说明书.md  2.第二篇文章.md
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# mv 1.说明书.md 说明书.md
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns#
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# mv 2.第二篇文章.md  第二篇文章.md
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# ls
第二篇文章.md  说明书.md
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# nano pg.md
root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# cat pg.md
显示:
<!--<img-url>buildAssetPath/default.jpeg</img-url>-->
<!--<title>美丽的草原,我的家</title>-->
<!--<intro>这是一首歌</intro>-->
<!--<tag>music</tag>-->
<!--<date>2024-11-14 14:18</date>-->

此处写正文或html codes.


root@racknerd-626f077:~/mdblog-by-nigulasikk/src/markdowns# cd ../..
root@racknerd-626f077:~/mdblog-by-nigulasikk# pnpm build

演示网站:
https://mbn-7ryp0zch9-luckypoems-projects.vercel.app
https://mbn-7ryp0zch9-luckypoems-projects.vercel.app/posts.html
项目地址:https://github.com/nigulasikk/mdblog


No comments:

Post a Comment