Referential Integrity in TinaCMS

November 19, 2024

By Jack Pettit

We’re excited to announce a significant enhancement to TinaCMS: Referential Integrity! This new feature ensures that references between documents remain consistent and error-free, even when linked documents are renamed or deleted. Let’s dive into what’s included and what it means for your content management workflows.

Part 1: Automatic Updates for Renamed Documents

Referential Integrity ensures that when a document is renamed, all related references are updated automatically. This is a massive win for users who frequently update file names while managing complex interlinked content.

Example:

  • Renaming the document content/authors/napoleon.md to content/authors/napy.md will instantly update all posts or pages that reference “Napoleon” to point to the new name “Napy.”

This seamless synchronization eliminates the manual effort of finding and updating references across your site.

Part 2: Cleaning Up References for Deleted Documents

Deleting a document? No problem! With Referential Integrity, TinaCMS will:

  • Warn you before the deletion to prevent accidental changes.
  • Automatically remove all references to the deleted document once confirmed.

Example:

  • Deleting an author document for “Pedro” ensures that any blog post referencing “Pedro” will have the reference cleared, keeping your content consistent and free of broken links.

What’s Next?

This feature is now live in tinacms@2.5.0. If you want more features like this, please share your thoughts and feature requests on GitHub!

In the meantime, you can explore this new functionality by upgrading to the latest version and trying it in your project. Your feedback will help us continue refining TinaCMS to meet your content management needs.

Thank you for being part of the TinaCMS journey. We’re committed to making content management as efficient and enjoyable as possible.

Best,
The TinaCMS Team 🦙

Last Edited: November 19, 2024