Pages

Tuesday, 5 November 2024

搭建基于rust的静态博客程序onepage

 如果你的本地机器是windows os,则参考此文安装rust的windows版 来安装rust的windows版。然后运行git-bash.exe,在程序窗口里输入:

cd ~

cargo install onepage

onepage init onepage-site (此命令会在当前目录下,生成子目录onepage-site)

cd onepage-site

onepage build (这就是生成/更新静态网站的根目录的命令,会在当前目录下,生成dist目录)

cd dist && python3 -m http.server 1234

新建源帖:

cd ..

cd pages/posts

nano hf.md

cat hf.md

显示:

---
title: 快乐的节日
date: 2024-11-05 23:06:39
tags:
  - life
  - music
---

此处写正文或html codes.

cd ~/onepage-site 

$ onepage build

演示网站:

https://blog.nexts.top/

https://melodic-granita-885337.netlify.app/

项目地址:https://github.com/hanpei/onepage

 
 

 

 

 

 

  

No comments:

Post a Comment