New plugin: File Title Updater, synchronizes titles between filename, frontmatter, and first heading in your notes

Hi,

I developed a plugin for synchronizing titles between filename, frontmatter, and first heading in your notes.

It has now been submitted to the community plugin store and is currently under review. Welcome to test it and provide feedback!

Features

This plugin helps maintain consistency between the three places where a note’s title can appear:

  1. The filename
  2. The title field in the frontmatter
  3. The first level 1 heading (#) in the note

The plugin provides four commands:

  • Sync titles using default source: Uses the default source (configurable in settings) to update all other title locations
  • Sync titles using filename as source: Uses the filename to update frontmatter title and first heading
  • Sync titles using frontmatter as source: Uses the frontmatter title to update filename and first heading
  • Sync titles using first heading as source: Uses the first level 1 heading to update filename and frontmatter title

Why use this plugin?

Having the same title in multiple places provides redundancy and makes your notes more accessible:

  • Consistent filenames make it easier to find notes in your file system
  • Frontmatter titles enable better metadata management and can be used with plugins like Dataview
  • First-level headings provide visual context when reading the note

Nice idea, I often have issues with this. A suggestion for an enhancement: For all three to be in sync, they need to align with file system naming restrictions. Assuming it doesn’t already do this, perhaps you could have an option to ensure the name is ‘legal’ before making any changes. I know in some of my files, the Heading and Frontmatter might contain a symbol (eg. ‘/’) that can’t be used in the filename. If I force a ‘sync using frontmatter’ I’d run into a problem. Having a setting or settings to specify how to handle those issues (replace illegal symbol with a different character or just remove and collapse illegal symbol?) would be handy.

1 Like

You didn’t like GitHub - dvcrn/obsidian-filename-heading-sync: Obisdian.md plugin to keep the filename and the first header of the file in sync or one of the other exiting ways to do this?

Thank you for pointing it out.

That’s a nice plugin, and I once tried it. According to my previous tests, that plugin automatically updates file names and the first header at a very high frequency, which can be a bit overwhelming for me.

For me, I would prefer a manual and less disruptive way of updating titles in the file name, first header, and front matter. Sometimes, I would like to update them based on different sources. That’s why I developed this plugin.

However, the existing plugins can also be very useful for different use cases.

Thanks for the feedback! A new version has been released to address the illegal filename issue:

Improve illegal character handling

  • Allow several methods of handling illegal characters
    • Remove illegal characters
    • Replace with space
    • Replace with dash (-)
    • Replace with underscore (_)
    • Custom replacement
  • Allow updating all titles with santized version

All of these can be configured in settings.

Welcome to test it and provide feedback!

1 Like