Total Pageviews

Wednesday, 13 November 2024

搭建基于python的静态博客程序:mdblog-by-oguma

 登录linxu vps.

 cd ~

首先编译hoedown:

git clone https://github.com/hoedown/hoedown

cd hoedown

make && make install

然后,

cd /usr/local

git clone https://github.com/oguma/mdblog mdblog-by-oguma

cd mdblog-by-oguma

root@racknerd-626f077:/usr/local/mdblog-by-oguma# ls

gen.py  md  README.md  theme
root@racknerd-626f077:/usr/local/mdblog-by-oguma# python3 gen.py (此即生成/更新静态网站的根目录的命令)

root@racknerd-626f077:/usr/local/mdblog-by-oguma# ls
gen.py  html  md  README.md  theme

(生成了html目录,内含index.html,可见html目录就是静态网站的根目录)
root@racknerd-626f077:/usr/local/mdblog-by-oguma# 

新建源帖:

root@racknerd-626f077:/usr/local/mdblog-by-oguma# cd md

root@racknerd-626f077:/usr/local/mdblog-by-oguma/md# nano 241113-20-17-pg.md 

root@racknerd-626f077:/usr/local/mdblog-by-oguma/md# cat 241113-20-17-pg.md

显示:
## 美丽的草原,我的家

此处写正文或html codes.

root@racknerd-626f077:/usr/local/mdblog-by-oguma/md# cd ..
root@racknerd-626f077:/usr/local/mdblog-by-oguma# python3 gen.py

演示网站:

https://fastidious-douhua-1197d4.netlify.app/

http://mbo.briten.top/

项目地址:

https://github.com/oguma/mdblog

https://github.com/hoedown/hoedown


 


 


 

 

 


 

 

No comments:

Post a Comment