test(发布): 测试obsidian发布功能

This commit is contained in:
心平气和 2026-03-10 14:09:42 +08:00
parent 8790057175
commit bc2f74c815
3 changed files with 145 additions and 5 deletions

View File

@ -43,7 +43,7 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "01-项目/2602-健康运动/健康运动-260305-练肩训练计划.md", "file": "Untitled 22.md",
"mode": "source", "mode": "source",
"source": false, "source": false,
"backlinks": true, "backlinks": true,
@ -58,7 +58,7 @@
} }
}, },
"icon": "lucide-file", "icon": "lucide-file",
"title": "健康运动-260305-练肩训练计划" "title": "Untitled 22"
} }
} }
] ]
@ -230,6 +230,10 @@
}, },
"active": "98086f01512f7118", "active": "98086f01512f7118",
"lastOpenFiles": [ "lastOpenFiles": [
"index.md",
"Untitled 3.md",
"Untitled 22.md",
"01-项目/2602-健康运动/健康运动-260305-练肩训练计划.md",
"auto_backup.py", "auto_backup.py",
"main.py", "main.py",
"auto_sync.bat", "auto_sync.bat",
@ -256,9 +260,6 @@
"Untitled 6.md", "Untitled 6.md",
"Untitled 5.md", "Untitled 5.md",
"Untitled 4.md", "Untitled 4.md",
"Untitled 3.md",
"Untitled 2.md",
"20260228-备忘-健身运动-腿部发力细节.md",
"01-项目/2603-小智", "01-项目/2603-小智",
"attachments/Pasted image 20260308102853.png", "attachments/Pasted image 20260308102853.png",
"attachments/Pasted image 20260308102809.png", "attachments/Pasted image 20260308102809.png",

137
Untitled 22.md Normal file
View File

@ -0,0 +1,137 @@
---
#领域/未知
#复盘/0 #临时/备忘 #状态/待处理
20260310-备忘-主题名-文件内容
## 一句话描述
[__发布obsidian______]
---
docker-compose.yaml
```yaml
volumes:
  obsidian-vault:
    external: true
services:
  # 2. Quartz 构建服务(修复目录操作)
  quartz-builder:
    image: ghcr.io/jackyzha0/quartz:latest
    container_name: quartz-builder
    restart: no
    volumes:
      - obsidian-vault:/vault
    command: |
      /bin/sh -c "
        # 只清理 public 内容,不删目录
        # 执行构建
        apt update && apt install git -y && apt clean && rm -rf /var/lib/apt/lists/*;
        cd /tmp;
        git clone https://gitea.juecha.fun/chen/juechafun.git;
        cd /usr/src/app/;
        rm -rf content;
        mv /tmp/juechafun content;
        rm -rf content/01-*;
        rm -rf content/05-*;
        rm -rf content/202602*;
        rm -rf content/Untitled*;
        rm -rf content/Untitled*;
        rm -rf content/健康运动*;
        rm -rf content/模板*;
        npx quartz build;
        mv public/* /vault
        echo 'Quartz 构建完成';
      "
  # 3. Nginx Web 服务
  web-server:
    image: nginx:alpine
    container_name: quartz-web
    restart: unless-stopped
    ports:
      - 30082:80
    volumes:
      - obsidian-vault:/usr/share/nginx/html:ro
      - ./default.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      quartz-builder:
        condition: service_completed_successfully
networks: {}
```
default.conf
```conf
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html; # 你的网站根目录(和容器挂载路径一致)
index index.html index.htm;
# 核心:自动补全 .html 后缀的配置
location / {
# 规则解读:
# 1. 先尝试访问原请求路径(如 /03-资源/xxx
# 2. 若不存在,尝试补全 .html 后缀(如 /03-资源/xxx.html
# 3. 若仍不存在,尝试作为目录访问(如 /03-资源/xxx/
# 4. 以上都不存在,返回 404
try_files $uri $uri.html $uri/ =404;
# 可选:支持中文/特殊字符路径的 URL 编码解析
charset utf-8; # 确保 Nginx 识别 UTF-8 编码的中文路径
}
}
```

2
index.md Normal file
View File

@ -0,0 +1,2 @@
测试 quartz 发布