An Astro template for creating posts from local markdown files in another project.
Isolate your content from your website code. Use file-first tools for writing your content, like (Obsidian, iA Writer).
Copy the .env.example file as .env and add your variables.
| VAR | Action |
|---|---|
CONTENT_DIR |
Location of your notes / content |
POSTS_DIR |
Location of copied collection, synced with your content |
WATCH_INTERVAL_MINUTES |
Minutes for background sync (explained below) |
| Command | Action |
|---|---|
bun install |
Install dependencies |
bun dev |
Runs Astro server on http://localhost:4321 |
bun content:dev |
Syncs content on changes for local dev |
bun content:copy |
Copy from your vault to site |
bun content:assets |
Copy images from your vault to site |
bun content:watch |
Start background watch + sync service |
On the go? Within any file in your content directory, simply add the following front matter at the top of your markdown file.
---
title: Title of Post
slug: url-for-post
published: true
---If you are running the bun content:watch process locally, this will:
- look for any changes to files with this front matter (markdown only)
- commit and push to main branch
If you want to control when to publish, simply run the bun content:sync command.
- Astro documentation
- Inspired by the file over app philosophy and Vault Technique by Steph Ango