Mastering Your Content Workflow: Publishing Articles with Obsidian and Astro
- April 22, 2025
- 7 mins
- Programming Writing
- astro gemini_2_5_flash obsidian
Hey there! So, you’re looking to team up Obsidian and Astro.js to make writing articles and getting them online a breeze? Awesome choice! It’s like having your own super-organized writing studio (Obsidian) connected directly to a rocket-fast delivery service for your articles (Astro). Let’s chat about how to set up this cool partnership, especially focusing on how to make that connection happen smoothly on your Mac or Linux machine.
Why This Duo is a Winner
First off, why this combo? Obsidian is amazing for just writing and thinking. It uses plain old Markdown files, lets you link ideas together like building your own personal Wikipedia, and you can make it look and feel just how you like it with themes and plugins. It’s your brain dump and writing haven all in one.
Astro, on the flip side, is a super speedy website builder that’s perfect for blogs and content sites. It’s built to be fast because it sends very little JavaScript to the browser by default. And guess what? Astro loves Markdown! It can easily take your Markdown files and turn them into slick, static web pages.
See the connection? You write your heart out in Obsidian using Markdown, and Astro is perfectly set up to grab those files and publish them to the web, fast.
Making the Connection: Enter the Symlink!
Okay, so your articles are chilling in your Obsidian vault, and your Astro project is waiting to publish them. How do we bridge that gap without constantly copying files back and forth? The magic word is symlink, short for symbolic link.
Think of a symlink as a really smart shortcut. Instead of copying your article files from your Obsidian vault into your Astro project, you create a symlink inside your Astro project that points back to the folder where your articles live in Obsidian. When Astro goes to look in the folder where the symlink is, your computer just redirects it to the actual location of the files in your Obsidian vault. It’s like setting up a secret door!
This is super handy because you can keep your main Obsidian vault organized however you like, maybe with notes, project files, and blog posts all mixed together, while your Astro project only needs access to that specific “articles” or “blog” folder within your vault.
Setting Up Symlinks on Mac or Linux
This is where we dip into the command line a little, but don’t worry, it’s not scary! We’ll be using the ln -s
command in your Terminal.
ln
: This is the command to create links.-s
: This flag is key – it tells the command to make a symbolic link.
The command structure looks like this:
ln -s /path/to/the/real/folder /path/where/you/want/the/shortcut
Let’s translate that for your setup:
/path/to/the/real/folder
: This is the source or target. It’s the actual location of the folder inside your Obsidian vault where you keep the articles you want to publish./path/where/you/want/the/shortcut
: This is the destination or the link name. It’s the path inside your Astro project where you want the symlink to appear. Astro will look here for your articles.
Step-by-Step Example:
Let’s use a common setup:
- Your Astro project is in:
/Users/yourusername/web/my-astro-blog
- You want Astro to find your articles in this folder within the project:
/Users/yourusername/web/my-astro-blog/src/content/articles
(This is a standard place for content in Astro). - Your Obsidian vault is in:
/Users/yourusername/Documents/ObsidianVault
- Inside your vault, your articles are in a folder named
Published Articles
:/Users/yourusername/Documents/ObsidianVault/Published Articles
Okay, here’s how you create the symlink:
-
Open your Terminal application.
-
Navigate to the directory within your Astro project where you want the symlink to live. In our example, that’s the
src/content/
folder.cd /Users/yourusername/web/my-astro-blog/src/content/
(Remember to replace
/Users/yourusername/web/my-astro-blog
with the actual path to your Astro project). -
Now, run the
ln -s
command. The first path is the real location of your articles in Obsidian, and the second path is the name you want the link to have in the current folder (src/content/
).ln -s "/Users/yourusername/Documents/ObsidianVault/Published Articles" articles
(Make sure to replace
/Users/yourusername/Documents/ObsidianVault/Published Articles
with the actual path to your articles folder in Obsidian. Pro tip: If your folder name has spaces, wrap the path in double quotes like I did with"Published Articles"
to avoid errors).
What Happens After?
Go look inside your Astro project’s src/content/
folder. You should see a new entry called articles
. It might look slightly different from a regular folder (sometimes a different icon or color) to show it’s a link.
Now, whenever you open that articles
folder in your Astro project (or when Astro processes it), you’re actually looking directly at the files in your Published Articles
folder inside your Obsidian vault! Any changes you make in Obsidian will be instantly reflected in the articles
folder from Astro’s perspective.
You can use this same method to symlink a folder for images or other assets if you include them in your articles. Just link a folder in your Astro project’s public
or src
directory to your Obsidian asset folder.
Writing Your Articles (Markdown & Frontmatter)
With the symlink set up, you just write your articles as standard Markdown files (.md
) inside that linked folder within your Obsidian vault.
Make sure to include frontmatter at the very top of each article file. This is a block of information between two sets of three dashes (---
). It’s where you put important details Astro can read:
---
title: My First Astro-Obsidian Article
date: 2023-10-27
tags:
- writing
- webdev
- markdown
description: Setting up a smooth workflow with Obsidian and Astro.
draft: false # Change to true if you're still working on it
---
Hey everyone! This is the start of my article content...
You can write with regular Markdown stuff like **bold text**, *italics*, lists:
* Item 1
* Item 2
And even [links!](https://astro.build)
Astro is built to understand this frontmatter, making it easy to automatically show the title, date, or tags on your blog index and article pages.
Astro Picks Up the Slack
In your Astro project, you’ll write some code (using Astro’s components) to tell it to find all the Markdown files in that src/content/articles
folder (which, remember, is just a link to your Obsidian folder!). Astro makes this super easy with features like Astro.glob()
or, even better, Content Collections.
Astro reads the frontmatter and gives you access to the article’s content, which it can render into HTML for you automatically. You just need to create the templates for how your blog index and individual article pages should look.
Building and Sharing
When you’re ready to share your latest masterpiece, you just run Astro’s build command: astro build
. Astro will follow the symlink, process all your Markdown files, build your static HTML pages, and put everything into a dist
or build
folder. You can then upload this folder to any static hosting service (like Netlify, Vercel, GitHub Pages, Cloudflare Pages, etc.), and boom! Your fast, new article is live.
Why This Workflow Rocks
- Write Comfortably: Use all of Obsidian’s features without worrying about web stuff.
- Stay Organized: Keep your articles neatly in your Obsidian vault, connected to your other notes if you like.
- Blazing Fast Site: Astro ensures your published articles load incredibly quickly.
- Simple Content: Markdown is easy to write and read.
- Future-Proof Content: Your articles are just plain text files, easy to move or convert anytime.
By using symlinks to connect your Obsidian writing space with your Astro project, you create a really powerful and pleasant flow from idea to published article. Give it a shot!
This article was written with assistance through Gemini 2.5 Flash to combine thoughts and rewrite into a more casual style based on my notes. While there is room for improvement, it did capture my work pretty effectively.