obsidian-publish-customize
Obsidian Publish customization
Obsidian Publish hosts a vault as a website. Two root files are the only hooks for changing it beyond the built-in site options: publish.css (custom styles) and publish.js (custom scripts). Both are supported insertion points, but almost everything past basic theming is undocumented — you script against Publish's rendered DOM and private globals, which can change without notice.
- Both files live at the vault root (
/publish.css,/publish.js). Hidden from the file explorer by default; publish them from the Publish changes dialog. publish.jsonly runs on a custom domain. On the defaultpublish.obsidian.md/<site-id>URL it's inert.publish.cssworks everywhere.
Scope. Theming via Publish CSS variables, and scripting the rendered page via publish.js. Out of scope, kept separate as three documentation domains:
- Normal Publish operation — publishing notes, custom-domain setup, the Publish CLIs.
- Obsidian desktop-app theming — themes and CSS snippets inside the app.
- Plugin development — the developer API for community plugins.
CSS variables overlap between app and Publish (see Theming), but the app's theming workflow and the plugin API are separate references — don't conflate them.
Pushing and iterating
Publishing the root files needs an active Publish subscription and one of two CLIs, depending on the environment: