No description
Find a file
David V. Kimball 8ea63a59fd Pre-emptively suppress Obsidian's auto-rename modal on new note; bump to 0.12.7
When both "Show inline title" and "Show tab title bar" are disabled in Appearance settings, Obsidian fires its own rename modal as soon as a new file gets focus, since the user otherwise has no way to see or edit the name. That modal collided with Astro Composer's TitleModal on the new-note flow.

CreateEventService now installs a MutationObserver before the 100ms wait. Any `.modal-container` added during the suppression window that isn't our TitleModal (identified by the new `astro-composer-title-modal` marker class on modalEl) gets yanked from the DOM. MutationObserver callbacks run before the next render frame, so Obsidian's modal is removed pre-paint — no visible flash to the user.

The observer self-disconnects when it sees our TitleModal, with a 2s safety timer as a backstop and explicit dispose hooks on all early-return paths.

Closes #9
2026-05-27 11:03:32 -07:00
.agent Skills updated. 2026-02-03 13:25:11 -08:00
.claude - Centralized string utility: Created shared toKebabCase function for consistent slugs and anchors. 2026-01-30 23:15:46 -08:00
.github Build release notes from the latest commit message. 2026-05-14 11:29:14 -07:00
scripts New obsidian-dev-skills setup. 2026-01-23 16:02:55 -08:00
src Pre-emptively suppress Obsidian's auto-rename modal on new note; bump to 0.12.7 2026-05-27 11:03:32 -07:00
.editorconfig Initial commit 2025-08-19 22:53:25 -07:00
.gitignore - Centralized string utility: Created shared toKebabCase function for consistent slugs and anchors. 2026-01-30 23:15:46 -08:00
AGENTS.md Skills updated. 2026-02-03 13:25:11 -08:00
CLAUDE.md File tracking logic for the event handler improved: creating new content from the file explorer in succession will now work more reliably. 2026-01-20 16:01:17 -08:00
CONTRIBUTING.md Bump to 0.12.3 with scorecard improvements. 2026-05-14 11:00:15 -07:00
esbuild.config.mjs Drop the inline sourcemap from production builds for reproducibility 2026-05-15 23:04:28 -07:00
eslint.config.mjs Bump to 0.12.3 with scorecard improvements. 2026-05-14 11:00:15 -07:00
LICENSE Fixed double line heading issue for older Obsidian versions. 2026-01-01 21:35:07 -08:00
manifest.json Pre-emptively suppress Obsidian's auto-rename modal on new note; bump to 0.12.7 2026-05-27 11:03:32 -07:00
package.json Pre-emptively suppress Obsidian's auto-rename modal on new note; bump to 0.12.7 2026-05-27 11:03:32 -07:00
pnpm-lock.yaml Bump to 0.12.3 with scorecard improvements. 2026-05-14 11:00:15 -07:00
README.md Replace BRAT install instructions with community-plugins search 2026-05-20 20:56:56 -07:00
styles.css Replace :has() CSS and Node builtin imports for cleaner scorecard 2026-05-14 14:29:01 -07:00
tsconfig.json Refactor: reorganize codebase into modular src/ structure with strict TypeScript config. 2025-09-10 21:24:42 -07:00
version-bump.mjs Initial commit 2025-08-19 22:53:25 -07:00
versions.json Pre-emptively suppress Obsidian's auto-rename modal on new note; bump to 0.12.7 2026-05-27 11:03:32 -07:00

Astro Composer for Obsidian

Turn your Obsidian notes into posts and pages for your Astro blog with automated content management features.

astro-composer-plugin-demo

Made for Vault CMS

Part of the Vault CMS project.

Video Guide

📺 Astro Composer Plugin for Obsidian Video Guide

Features

  • New Post Dialog: When enabled, prompts for a title when creating a new Markdown file via Obsidian's "New note" action, auto-generating a kebab-case filename (e.g., "My Blog Post" → my-blog-post.md) and optionally inserting properties with title, date, etc.
  • MDX Support: Full .mdx file support including file creation (per content type via the useMdxExtension setting), link conversion, and property standardization.
  • Property Standardization: Updates a note's properties to match a customizable template using the "Standardize Properties" command. Preserves existing property values, adds missing properties from the template in the specified order, and appends unrecognized properties at the end.
  • Draft Management: Optionally adds an underscore prefix (e.g., _my-post.md) to hide drafts from Astro, configurable via settings.
  • Internal Link Conversion: Converts Obsidian wikilinks and markdown internal links ([[My Post]] or [My Post](my-post)) to Astro-friendly Markdown links ([My Post](/blog/my-post/)), supporting both file-based and folder-based post structures.
  • Configurable Workflow: Customize posts folder, link base path, creation mode (file-based or folder-based with index.md), date format, and excluded directories. Enable or disable automation for new notes and properties insertion independently.
  • Robust Automation: Only triggers the title dialog for user-initiated new notes (e.g., via "New note" command), avoiding unwanted prompts during vault loading or file imports (e.g., via git pull).
  • Rename Post Command: easily rename your notes by updating the title property with the desired post name, and get a kebab-case file or folder update afterward.

Installation

  1. In Obsidian, go to Settings > Community plugins (enable it if you haven't already).
  2. Search for Astro Composer and click Install and then Enable.

Manual

  1. Download the latest release from the Releases page and navigate to your Obsidian vault's .obsidian/plugins/ directory.
  2. Create a new folder called astro-composer and ensure manifest.json, main.js, and styles.css are in there.
  3. In Obsidian, go to Settings > Community plugins (enable it if you haven't already) and then enable "Astro Composer."

Usage

  1. Customize Settings: In Settings > Astro Composer, configure:
    • Automate post creation: Toggle to enable the title dialog for new files created via Obsidian's "New note" action (ensure your default new note location matches your post location in Obsidian settings). Each content type can be configured to create .mdx files instead of .md via the useMdxExtension setting.
    • Auto-insert properties: Enable to automatically apply the properties template when creating new files (requires "Automate post creation" to be enabled).
    • Posts folder: Set the folder for blog posts (leave blank to use the vault root). Specify the default location for new notes in Obsidian's Settings > Files and links.
    • Ignore subfolders: Restrict automation to the specified posts folder and its subfolders.
    • Excluded directories: List directories to exclude from automation (e.g., pages|posts/example), separated by |, when not restricted to the posts folder.
    • Use underscore prefix for drafts: Add a prefix (e.g., _my-post.md) to hide drafts from Astro.
    • Creation mode: Choose file-based (my-post.md) or folder-based (my-post/index.md) structure.
    • Index file name: Name the main file in folder-based mode (e.g., index).
    • Date format: Set the properties date format (e.g., YYYY-MM-DD or MMMM D, YYYY).
    • Properties template: Define the template for new posts and standardization. Supports {{title}}, {{date}}, and {{slug}} placeholders (e.g., ---\ntitle: "{{title}}"\ndate: {{date}}\nslug: {{slug}}\ndescription: ""\ntags: []\n---).
  2. Enable More Content Type Automation: With "Enable pages" enabled and by creating custom content types, you can do the same automation behavior for any other content type, like pages, documentation, projects, etc. Wildcard patterns are supported: use * in folder paths to match any folder name (e.g., docs/* matches docs/anything/, docs/*/* matches docs/anything/anything/). This allows you to create separate content types for different folder depths.
  3. Standardize Properties: Use the Astro Composer: Standardize Properties command to update a note's properties to the relevant content type, preserving existing values, adding missing properties, and maintaining the template's order with unrecognized properties at the end.
  4. Convert Internal Links: Use the Astro Composer: Convert internal links for Astro command to transform Obsidian wikilinks and internal Markdown links into Astro-compatible Markdown links.
  5. Rename Content: Using the Astro Composer: Rename Current Note command, set the title of your content and have the file or parent folder get automatically renamed with the kebab-case version.

Contributing

Submit issues or pull requests on the GitHub repository. Contributions to enhance features, improve documentation, or fix bugs are welcome!