Pages

Monday, 18 November 2024

搭建基于python2的静态博客程序mdblog-by-c4pt0r

 登录linux vps.

root@racknerd-626f077:~# git clone https://github.com/c4pt0r/mdblog mdblog-by-c4pt0r

root@racknerd-626f077:~# cd mdblog-by-c4pt0r
root@racknerd-626f077:~/mdblog-by-c4pt0r# mkdir gen

root@racknerd-626f077:~/mdblog-by-c4pt0r#  python2 build.py build (  此即更新静态网站的根目录的命令)

root@racknerd-626f077:~/mdblog-by-c4pt0r# cd gen
root@racknerd-626f077:~/mdblog-by-c4pt0r/gen# ls
cstring.html  first_post.html  index.html  macvim_fullsize.html

(可见~/mdblog-by-c4pt0r/gen就是静态网站的根目录)

新建源帖:
root@racknerd-626f077:~/mdblog-by-c4pt0r/gen# cd ../blogs

root@racknerd-626f077:~/mdblog-by-c4pt0r/blogs# ls
cstring.md  first_post.md  macvim_fullsize.md
root@racknerd-626f077:~/mdblog-by-c4pt0r/blogs# nano pg.md

root@racknerd-626f077:~/mdblog-by-c4pt0r/blogs# cat pg.md

显示:

<!-- 美丽的草原,我的家 -->
<!-- 2024-11-18 20:44:13 -->
<!-- write markdown text below -->

## 美丽的草原,我的家

此处写正文或html codes.

root@racknerd-626f077:~/mdblog-by-c4pt0r/blogs# cd ..
root@racknerd-626f077:~/mdblog-by-c4pt0r# python2 build.py build 

演示网站:https://mb-c.netlify.app/

项目地址:https://github.com/c4pt0r/mdblog



No comments:

Post a Comment