Check config
website
is a directory containing config.toml
.
$ ddpub --check --config "~/notes/website" --notes "~/notes"
Serve from the local notes directory
$ ddpub --serve --config "~/notes/website" --notes "~/notes" --port 33075
Export website config, all published and named notes and files
Exporting is useful if you want to re-publish part of your notes in public. It’s also good for automation because you can then run ddput --serve
from the export directory without any parameters.
$ ddpub --export --config "~/notes/website" --notes "~/notes" --to "~/website-export"
Further development
- Preview?
- Autoreload?
Serving from an empty state and getting pushes is not essential to launching.
Start empty and expect a push
The DDPUB_ADDRESS
environment variable is required when the --config
parameter is missing.
Without the DDPUB_TOKEN
environment variable the server cannot accept pushes.
$ DDPUB_TOKEN='ABCDEF' DDPUB_ADDRESS='ddpub.org' ddpub serve --port 33075
Push a website to server
Performs a /ddpub_push
POST request to a running DDPub server. Can use HTTP if required.
Both DDPUB_TOKEN
environment variable and address
variable in the config must match the values on the server, otherwise the push will be refused.
The server performs a diff and only requests the client to upload files it doesn’t have, to conserve traffic. The diff checks for file names, modified dates and size.
$ DDPUB_TOKEN=ABCDEF ddpub push --config "~/notes/website" --notes "~/notes"
How to allow both running from ./notes
and not overwriting local bootstrapped notes?