Commit 036f01c663
Verified · cmc
Layout: unified · split
README.md +22
| @@ -99,6 +99,28 @@ ENV=prod uv run build.py | ||
| 99 | 99 | uv run build.py |
| 100 | 100 | ``` |
| 101 | 101 | |
| 102 | ## Deployment | |
| 103 | ||
| 104 | Production builds emit root-relative URLs (`/styles.min.css`, | |
| 105 | `/img/blog/...`) instead of absolute `https://` ones so the site renders | |
| 106 | standalone on the onion service without fetching assets off-onion. | |
| 107 | ||
| 108 | This means the web server must serve the image store at `/img/` on the | |
| 109 | `cleberg.net` vhost. The images live at `/var/www/img/` (their own host, | |
| 110 | `img.cleberg.net`); expose them under `cleberg.net/img/` with a symlink: | |
| 111 | ||
| 112 | ``` shell | |
| 113 | ln -s /var/www/img /var/www/cleberg.net/img | |
| 114 | ``` | |
| 115 | ||
| 116 | Without this, images 404 in production. Development builds keep the | |
| 117 | absolute `img.cleberg.net` URLs, so local previews load images from the | |
| 118 | live host and need no symlink. | |
| 119 | ||
| 120 | Once assets are same-origin, the vhost CSP can tighten `img-src`, | |
| 121 | `style-src`, and `font-src` back to `'self'`. After deploying, purge the | |
| 122 | Cloudflare cache (responses carry a 31-day `max-age`). | |
| 123 | ||
| 102 | 124 | ## Creating New Blog Posts |
| 103 | 125 | |
| 104 | 126 | To add new blog content, follow this procedure within Emacs: |