Commit 053bde1d26

053bde1d2637ae8043936a0437bda980205acfbf

parent: b46938462d

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-05 22:37 UTC

Rewrap README.org

Layout: unified · split

README.org +59 −63
@@ -15,14 +15,13 @@ The main site components are:
1515
1616- Org source files in =content/=, containing blog posts and pages. That directory
1717 is the site's URL root: =content/blog/post.org= publishes at =/blog/post.html=.
18- A configuration file (=content/orgo.toml=) that specifies the base
19 URL, navigation, templates, and the generated pages (home, blog and
20 garden indexes, tags, and the RSS feed).
18- A configuration file (=content/orgo.toml=) that specifies the base URL,
19 navigation, templates, and the generated pages (home, blog and garden indexes,
20 tags, and the RSS feed).
2121- HTML templates in =content/templates/=.
22- Assets such as images and style sheets, located in designated
23 subdirectories. =theme/static/= is published at =/=.
24- Utility scripts (e.g., =build.py=) to facilitate building and
25 deployment.
22- Assets such as images and style sheets, located in designated subdirectories.
23 =theme/static/= is published at =/=.
24- Utility scripts (e.g., =build.py=) to facilitate building and deployment.
2625
2726** Dependencies
2827
@@ -35,22 +34,22 @@ The publishing system depends on:
3534
3635** Configuration
3736
38You can customize site settings within the =content/orgo.toml= file.
39This file establishes key variables such as:
37You can customize site settings within the =content/orgo.toml= file. This file
38establishes key variables such as:
4039
4140- The base URL for links.
4241- Which pages appear in the navigation, and in what order.
4342- Per-directory template rules.
4443- The collections that generate the indexes, tag pages, and feed.
4544
46Users intending to modify site parameters should review and edit this
47file accordingly. The orgo documentation contains extensive details on
48configuration options and expected formats.
45Users intending to modify site parameters should review and edit this file
46accordingly. The orgo documentation contains extensive details on configuration
47options and expected formats.
4948
5049** Setup Instructions
5150
52To obtain a working copy of this repository, execute the following
53commands within a shell environment or Emacs shell interface:
51To obtain a working copy of this repository, execute the following commands
52within a shell environment or Emacs shell interface:
5453
5554#+begin_src shell
5655git clone https://gitbay.org/cmc/cleberg.net
@@ -58,35 +57,35 @@ cd cleberg.net
5857emacs -nw
5958#+end_src
6059
61For users employing Doom Emacs, open any repository Org file using
62=SPC f f= to access the content.
60For users employing Doom Emacs, open any repository Org file using =SPC f f= to
61access the content.
6362
6463** Building and Publishing the Site
6564
66The =build.py= script wraps the build: it runs orgo, rewrites the footer's
67orgo version to match the orgo that ran, and then either deploys the result
68or serves it locally.
65The =build.py= script wraps the build: it runs orgo, rewrites the footer's orgo
66version to match the orgo that ran, and then either deploys the result or serves
67it locally.
6968
7069Environment variables control what it does, and all default to off:
7170
7271- =BUILD=true= performs the build.
73- =DEPLOY=true= deploys in production, or starts a development server
74 on port 8000 otherwise.
75- =ENV=prod= selects production: image URLs are rewritten to be
76 root-relative (see Deployment below) and the =ruff= pass is skipped.
77 Anything else builds for development.
78- =DRY_RUN=true= turns a production deploy into a report. Production
79 only; ignored everywhere else.
72- =DEPLOY=true= deploys in production, or starts a development server on port 8000
73 otherwise.
74- =ENV=prod= selects production: image URLs are rewritten to be root-relative (see
75 Deployment below) and the =ruff= pass is skipped. Anything else builds for
76 development.
77- =DRY_RUN=true= turns a production deploy into a report. Production only; ignored
78 everywhere else.
8079
8180Exactly one combination writes to the server:
8281
83| =ENV= | =BUILD= | =DEPLOY= | =DRY_RUN= | What happens | Output | Server |
84|--------+---------+----------+-----------+---------------------------------------+--------------+-------------------|
85| unset | =true= | — | — | Development build, =ruff= first | =.build-dev/=| Untouched |
86| unset | =true= | =true= | — | Development build, then serve on :8000| =.build-dev/=| Untouched |
87| =prod= | =true= | — | — | Production build and image rewrite | =.build/= | Untouched |
88| =prod= | — | =true= | =true= | Reports what a deploy would change | — | Read only |
89| =prod= | =true= | =true= | — | Production build, then deploy | =.build/= | *Overwritten* |
82| =ENV= | =BUILD= | =DEPLOY= | =DRY_RUN= | What happens | Output | Server |
83|-------+-------+--------+---------+----------------------------------------+-------------+-------------|
84| unset | =true= | — | — | Development build, =ruff= first | =.build-dev/= | Untouched |
85| unset | =true= | =true= | — | Development build, then serve on :8000 | =.build-dev/= | Untouched |
86| =prod= | =true= | — | — | Production build and image rewrite | =.build/= | Untouched |
87| =prod= | — | =true= | =true= | Reports what a deploy would change | — | Read only |
88| =prod= | =true= | =true= | — | Production build, then deploy | =.build/= | *Overwritten* |
9089
9190#+begin_src shell
9291# Development build:
@@ -105,20 +104,19 @@ ENV=prod DEPLOY=true DRY_RUN=true uv run build.py
105104ENV=prod BUILD=true DEPLOY=true uv run build.py
106105#+end_src
107106
108Generated site files reside in =.build/= for production and
109=.build-dev/= for development.
107Generated site files reside in =.build/= for production and =.build-dev/= for
108development.
110109
111The deploy is =rsync --delete-before=, so files the build no longer
112produces are removed from the server. That is what makes the dry run
113worth having: a build that silently produced fewer pages would quietly
114delete the rest. Lines beginning =*deleting= in the dry-run output are
115what the real deploy would remove.
110The deploy is =rsync --delete-before=, so files the build no longer produces are
111removed from the server. That is what makes the dry run worth having: a build
112that silently produced fewer pages would quietly delete the rest. Lines
113beginning =*deleting= in the dry-run output are what the real deploy would remove.
116114
117Builds are incremental: orgo keeps an =.orgo-cache.json= inside the
118output directory and re-renders only what changed, so the directory is
119left in place between runs. Delete it for a clean build. The two
120environments use separate directories because production rewrites image
121URLs in the output and development does not.
115Builds are incremental: orgo keeps an =.orgo-cache.json= inside the output
116directory and re-renders only what changed, so the directory is left in place
117between runs. Delete it for a clean build. The two environments use separate
118directories because production rewrites image URLs in the output and development
119does not.
122120
123121orgo can also build and preview on its own, without =build.py=:
124122
@@ -128,28 +126,27 @@ orgo serve content -o /tmp/preview
128126
129127** Deployment
130128
131Production builds rewrite image URLs to root-relative ones
132(=/img/blog/...=) instead of absolute =https://img.cleberg.net/= ones so
133the site renders standalone on the onion service without fetching assets
134off-onion. The stylesheet is already same-origin.
129Production builds rewrite image URLs to root-relative ones (=/img/blog/...=)
130instead of absolute =https://img.cleberg.net/= ones so the site renders standalone
131on the onion service without fetching assets off-onion. The stylesheet is
132already same-origin.
135133
136This means the web server must serve the image store at =/img/= on the
137=cleberg.net= vhost. The images live at =/var/www/img/= (their own host,
138=img.cleberg.net=); expose them under =cleberg.net/img/= with a symlink:
134This means the web server must serve the image store at =/img/= on the =cleberg.net=
135vhost. The images live at =/var/www/img/= (their own host, =img.cleberg.net=);
136expose them under =cleberg.net/img/= with a symlink:
139137
140138#+begin_src shell
141139ln -s /var/www/img /var/www/cleberg.net/img
142140#+end_src
143141
144Without this, images 404 in production. Development builds keep the
145absolute =img.cleberg.net= URLs, so local previews load images from the
146live host and need no symlink.
142Without this, images 404 in production. Development builds keep the absolute
143=img.cleberg.net= URLs, so local previews load images from the live host and need
144no symlink.
147145
148Once assets are same-origin, the vhost CSP can tighten =img-src=,
149=style-src=, and =font-src= back to ='self'=, and drop =bubbles.town=
150from =script-src=/=connect-src= (the vote widget was removed; only a
151plain link to Bubbles remains). After deploying, purge the Cloudflare
152cache (responses carry a 31-day =max-age=).
146Once assets are same-origin, the vhost CSP can tighten =img-src=, =style-src=, and
147=font-src= back to ='self'=, and drop =bubbles.town= from =script-src=/=connect-src=
148(the vote widget was removed; only a plain link to Bubbles remains). After
149deploying, purge the Cloudflare cache (responses carry a 31-day =max-age=).
153150
154151** Creating New Blog Posts
155152
@@ -157,8 +154,7 @@ To add new blog content, follow this procedure within Emacs:
157154
1581551. Open a new Org file (via =C-x C-f= or Doom\'s =SPC f f=).
1591562. Insert the contents of the post template with =C-x i=, sourcing from
160 =utils/template.org=.
157 =utils/template.org=.
1611583. Modify the new file as needed to add post content and metadata.
162159
163This method streamlines content creation by reusing a preformatted
164template.
160This method streamlines content creation by reusing a preformatted template.