Custom Publish

pending

by danyim

Command palette actions to manage frontmatter publish and visibility properties, with a copy-URL command for published pages.

Updated 1mo agoMITDiscovered via Obsidian Unofficial Plugins
View on GitHub

Obsidian Custom Publish

This is an Obsidian plugin that exposes command palette actions to set frontmatter properties for custom publishing workflows. It doesn't tie itself to a specific hosting provider (Obsidian Publish or otherwise); it assumes you already have a system that scans notes and publishes based on frontmatter properties.

Commands

CommandAction
Custom Publish: Publish pageSets the publish property to true
Custom Publish: Unpublish pageSets the publish property to false
Custom Publish: Toggle publish pageFlips the publish property
Custom Publish: Toggle visibilityFlips the visibility property
Custom Publish: Copy published page URLCopies the published URL to the clipboard using the configured URL template

If the target property doesn't exist on the note, it will be added automatically.

Settings

SettingDefaultDescription
Publish propertypublishFrontmatter key used to mark a page as published
Visibility propertyprivateFrontmatter key used to control page visibility
Publish URL template(empty)URL template for published pages. Use ${PAGE} as a placeholder for the page name
Slug styletitle-kebabHow the page name is converted for the ${PAGE} placeholder

Publish URL template

The ${PAGE} placeholder is replaced with the current note's filename, converted using the selected slug style. Special characters are stripped and words are split on spaces, underscores, and hyphens.

Slug styles:

StyleExample input${PAGE} output
kebab-caseMy First Postmy-first-post
Title-Kebab-CaseMy First PostMy-First-Post
TitleCaseMy First PostMyFirstPost
camelCaseMy First PostmyFirstPost

Configuration examples (using kebab-case):

Publish URL templateResult for "My First Post"
https://blog.example.com/${PAGE}https://blog.example.com/my-first-post
https://example.com/posts/${PAGE}.htmlhttps://example.com/posts/my-first-post.html
https://wiki.example.com/pages/${PAGE}/https://wiki.example.com/pages/my-first-post/

Note: The "Copy published page URL" command is only available when a Publish URL template is configured.

Development

npm install
npm run dev    # watch mode
npm run build  # production build

Installation

Copy main.js, styles.css, and manifest.json to your vault at .obsidian/plugins/obsidian-custom-publish/.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.