Writing Posts
girok-md makes it easy to write posts in your favorite markdown editor and publish them to your blog.
Frontmatter
Every post needs frontmatter to define its metadata. Add publish: true to include it on your blog.
---title: My First Postpublish: truedate: 2024-01-15tags: [astro, blog, tutorial]description: This is my first post on my new blog---
Your post content starts here...Required Fields
| Field | Description |
|---|---|
title | The title of your post |
publish | Set to true to publish, false to hide |
Optional Fields
| Field | Description | Default |
|---|---|---|
date | Publication date | File creation date |
tags | Array of tags | [] |
description | Short description for SEO | First 150 characters |
aliases | Alternative slugs/paths | [] |
Publishing Workflow
- Write your post in your markdown editor (e.g., Obsidian)
- Add
publish: trueto the frontmatter - Run
npm run syncto sync your posts - Run
npm run devto preview locally - Commit and push to deploy
Sync Behavior
The sync process:
- Scans
source_root_pathfor markdown files - Only includes files with
publish: true - Compares
modifiedtime withpublish_sync_at - Copies changed files to
src/content/posts/ - Removes deleted or unpublished files
Forcing a Full Sync
To re-sync all files regardless of modification time:
rm -rf src/content/posts && npm run syncSlug Generation
The URL slug is generated from:
- The
titlefield in frontmatter (primary) - The filename (fallback)
Examples:
| Title | Generated Slug |
|---|---|
My First Post | /posts/my-first-post |
안녕하세요 World | /posts/안녕하세요-world |
Post (2024) | /posts/post-2024 |
Images
Place images in the same folder as your markdown files. They will be synced automatically to public/assets/.
See Markdown Syntax for image embed syntax.
Next Steps
- Markdown Syntax - Learn about Wikilinks, Callouts, and more
- Deployment - Deploy your blog