Unlike other headless CMS, articles of this website are edited in and posted from local, in the VSCode editor. I believe this is especially beneficial to developers who build and run their own tech blog or the likes.
Here, I'm walking you through the beautiful harmony between Astro and Front Matter CMS taking my website's example. For more information about it, see this article.
Compatible with directory-based internationalization(i18n)
Especially the first one is what makes it different from other headless CMS and makes me decide using it.
Plus, it also offers an AI assistance feature where you can ask them whatever via the VSCode command. So you don't even have to have an internet connection to look up something, which is pretty cool coupled with the capability of editing articles offline.
Thanks to the Astro Content Collections API, content management is very easy. You can manage contents and data collections under the src/content directory.
Below is my project's structural overview. For brevity, most irrelevant parts are omitted from the directory tree.
As you can see, the Content Collections work with the config.ts file, in which all the contents' types & fields are defined.
In the astro.config.ts, within the scope of this article, I topped up the i18n feature. You're going to have to make Front Matter CMS settings consistent with this later.
When it comes to the setup, consult the Front Matter official doc. You cannot get lost with the doc and support of the AI assistance.
After the setup, you're supposed to tweak the frontmatter.json to make it consistent with your contents and data configurations.
In my case, the framework is Astro, but you can do this with other frameworks too as long as you have Markdown/MDX contents in it.
The thing is how correctly and accurately you can specify your contents' locations in the config file. Here is mine.
Some are automatically added during the setup process and some are not. Here are some important items that I manually added:
frontMatter.content.publicFolder: Specify your assets directory if needed
In my case, I wanted to modify it for leveraging the Astro's assets optimization. It's set to the public directory by default
frontMatter.content.pageFolders: Specify your content collections here
In my case, there are three content types: blog, news, and page
frontMatter.content.i18n: Specify as many languages as you use
This is fully compatible with every directory-based internationalization(i18n)
frontMatter.content.draftField: Not necessary
I just wanted to have three article statuses rather than the default true or false flag.
frontMatter.data.types: Specify your data collections here
In my case, there are two content types: categories and tags
frontMatter.data.files: Associate your data collections with specific paths and file formats
In my case, each data is aggregated in one file. (e.g., "src/content/tags/en/tags.yml") Here, each one of file path is specified. By the same token as contents, there should be as many directories as languages you use
frontMatter.content.snippets: Customize your snippets here
In my case, I had to customize the media snippet since I modify the assets directory.
Why did I have to create the media snippet on my own?
The path specified in the publicFolder is automatically reflected on that of the media snippet.
That said, the original media snippet has the image path like /src/assets/images/image.png, which is an invalid path. (Correctly, ../../../assets/images/image.png)
Front Matter CMS is a VSCode extension. Even if it stops developing, migrating to other CMS is easy, which I think would be one of the most important factors considering the pace as which modern technology is advancing.
For the same reason, I've been using Obsidian as my knowledge base and Astro as a meta framework of this website. The common ground is "portability".
Obsidian: All contents are written in Markdown and managed in local unlike Notion
All you need to do for migration is move all the .md files
Astro: In .astro files, HTML, CSS, and vanilla JS can be used and all contents are written in Markdown/MDX.
Even if Astro reaches its end of life, still you'll be able to reuse them(HTML, CSS, etc..) since those basic technologies aren't supposed to be deprecated that rapidly