安装
git clone https://ghfast.top/https://github.com/jackyzha0/quartz.git
cd quartz
git remote set-url upstream https://ghfast.top/https://github.com/jackyzha0/quartz.git
npm i
npx quartz create
npx quartz build --serve # 运行
sudo npx quartz update # 更新
宝塔面板
-
在网站页面,添加 HTML项目,
-
输入域名建立网站
-
设置里伪静态里添加以下内容:
location / { try_files $uri $uri.html $uri/ /404.html;
-
优化路径重定向 若希望
/123
自动补全斜杠访问/123/
,添加规则:location / { try_files $uri $uri.html $uri/ @rewrite; } location @rewrite { rewrite ^/(.*)/$ /$1 permanent; # 自动补全斜杠 try_files $uri $uri/ /index.html; }
文章过滤
- 可以用 obsidian 管理 md 文件,在 frontmatter 加入以下(选一个)
- quartz. config. ts 文件中
filters: [Plugin.ExplicitPublish()],
ExplicitPublish frontmatterpublish: true
. RemoveDrafts frontmatterdraft: true
. (默认的是这个)
在底部加入备案号
- 可参考 Add ICP license to the buttom of the website by ArenaDruid · Pull Request #512 · jackyzha0/quartz · GitHub
- 备案编号图标:
与 obsidian 联用
mklink /J content E:\obsidian\public\