I modified an Obsidian plugin: After writing an article, it can be synchronized to my blog with one click.

Published 2026-08-01 12:01 999 words 5 min read ... Page views

Developed based on the open-source project drewlyton/sanity-obsidian-plugin, a three-way synchronization workflow has been created for Obsidian, Sanity, and blogs. This workflow supports one-click publishing, field mapping, and automatic image uploading, eliminating the cumbersome process of manual copying and pasting.

For those who enjoy blogging, a comfortable writing process is of great importance.

Many technical authors choose Obsidian as their knowledge management and writing tool because it offers:

  • Local Markdown storage
  • A robust plugin ecosystem
  • Flexible note management options
  • A platform-independent writing experience

However, when it comes to publishing articles on their own blogs, the traditional process can be quite cumbersome:

  1. Write the Markdown in Obsidian
  2. Copy the article content
  3. Log in to the CMS backend
  4. Upload the images
  5. Set the title, categories, and cover image
  6. Publish the article

Repeating these steps not only wastes time but also tends to interrupt the writing flow.

Therefore, I have made further development based on the open-source project drewlyton/sanity-obsidian-plugin and adapted it for personal blogging use.

Project URL: violet27chen/sanity-obsidian-plugin

Screenshot of the plugin
Screenshot of the plugin

Sanity for Obsidian: Creating a three-way synchronization workflow between Obsidian, Sanity, and your blog

The goal of this plugin is simple:

Complete your writing in Obsidian, synchronize it to Sanity with one click, and then have it automatically displayed on your blog.

The overall process is as follows:

Obsidian

发布同步

Sanity CMS

博客网站

This results in three interconnected components: Obsidian ↔ Sanity ↔ Blog

Why choose Obsidian + Sanity?

Obsidian: Focused on writing

The biggest advantage of Obsidian is its emphasis on Markdown and local storage. Your articles are always saved on your own device, allowing you to continue using the familiar Markdown syntax without having to adapt to complex backend editors.

Sanity: Responsible for content management

Sanity is a modern, headless CMS that handles content storage, image management, field management, API provision, and multi-platform content distribution. The blog frontend only needs to retrieve the data from Sanity to display it.

Blog: Responsible for the final display

Regardless of whether you use Astro, Next.js, Nuxt, or another front-end framework for your blog, you can retrieve the article content through Sanity. The writing, management, and display processes are completely separated.

Main features of the plugin

1. Publishing to Sanity from Obsidian

After writing an article in Obsidian, click “Publish to Sanity.” The plugin will automatically create a Sanity document, synchronize the article content, upload the image files, and save the document ID, eliminating the need for manual copying and pasting.

2. Synchronizing from Sanity back to Obsidian

In addition to publishing, the plugin also supports pulling content back. If you make changes to the article in the Sanity backend, you can synchronize it back to Obsidian for further editing.

3. Support for blog field mapping

Since different blogs have different structures, the plugin does not fix the fields in place. You can freely map fields such as the title, slug, cover image, and categories, making it suitable for technical blogs, documentation websites, knowledge bases, product sites, and more.

4. Automatic image processing

Images inserted while writing articles are automatically uploaded to Sanity and converted to CDN addresses by the plugin, eliminating the need to manually upload them through the CMS backend.

Installation and Configuration Tutorial

Preparation

Before you start, you need:

  • Obsidian
  • A Sanity project
  • A blog that supports reading from Sanity data

If you don’t have a Sanity project, go to sanity.io to register and create one.

Step 1: Install the Obsidian plugin

The plugin is not yet available in the Obsidian Community Plugins, so you need to install it manually.

Method 1: BRAT Installation (recommended)

  1. Open Obsidian → Settings → Third-Party Plugins → Browse Community Plugins, search for BRAT, and install it.
  2. Go to Settings → BRAT → Add Beta Plugin, and enter the required information (violet27chen/sanity-obsidian-plugin).
  3. Wait for the installation to complete. Then, find Sanity in Settings → Third-Party Plugins and enable it.

Method 2: Manual Installation

Go to the .obsidian/plugins directory in your Obsidian Vault and execute the following command:

git clone https://github.com/violet27chen/sanity-obsidian-plugin.git

Directory structure: .obsidian/plugins/sanity-obsidian-plugin

Reopen Obsidian and enable Sanity in Settings → Third-Party Plugins.

Step 2: Create a Sanity API Token

Go to the Sanity Dashboard → Project → API → Tokens → Add API Token. Select the “Editor” role for permissions (not “Viewer” as publishing articles requires write access). Copy the generated Token.

Step 3: Configure the plugin

Go to Obsidian → Settings → Sanity, and fill in the following information:

  • API Token: The Token generated in the previous step.
  • Project ID: Copy it from the Sanity Dashboard → Project Settings.
  • Dataset: Usually, you can leave this as production.
  • Type Name: The name of your article type, for example, post.

Step 4: Configure article fields

Assuming your blog article structure is as follows:

post:
  title
  slug
  body
  cover
  categories

Just fill in the corresponding fields in the plugin settings for the title, body, file name, and additional fields.

Step 5: Publish your first article

Create a Markdown file in Obsidian, write the content, then open the command panel (Ctrl + P), search for “Publish to Sanity”. The plugin will automatically create the article, upload the image, and save the sanity_id.

Step 6: Display the article on the blog

After the synchronization is complete, the blog will display the data from Sanity. From now on, you can simply open Obsidian, write an article, click “Publish”, and the blog will be updated.

Common Issues

Publishing fails: 403 insufficientPermissions

The Token permissions are insufficient. Re-create the Token and select the “Editor” role.

Image not uploaded

Check if the image path is correct, whether you are using a Markdown-compatible image format, and whether the Token has the necessary upload permissions.

Plugin not found

Make sure that Sanity is enabled in Settings → Third-Party Plugins.

Why undertake this project?

I have always believed that:

Writing tools should serve the authors, not make the authors adapt to the backend systems.

... Page views
© 2026 violet @qiyuan