Folder Workflow
About 539 wordsAbout 2 min
2025-10-10
The recommended approach for authoring posts that include many images or supporting assets.
Create a Post
- Under
src/content/posts, create a new folder with a descriptive name, e.g.my-complex-post. - Inside the folder, add an
index.mdfile. - Add frontmatter metadata to
index.md(include at leasttitleanddescription):
---
title: Markdown Tutorial
published: 2025-01-20
pinned: true
description: A simple example of a Markdown blog post.
tags: [Markdown, Blogging]
category: Examples
licenseName: "Unlicensed"
author: emn178
sourceLink: "https://github.com/emn178/markdown"
draft: false
date: 2025-01-20
image:
url: './cover.jpg'
alt: 'Cover image'
pubDate: 2025-01-20
---Write the article content below the frontmatter using Markdown.
Frontmatter Field Reference
Supported fields mirror the single-file workflow:
Required
titledescription
Publishing
publishedpubDatedatedraft
Taxonomy & Positioning
tagscategorypinned
Author & Licensing
authorlicenseNamesourceLink
Images
image(recommended to use relative paths like./cover.jpg)urlalt
Markdown Learning Resources
đ Recommended reading: Runoob Markdown Tutorial
Covers:
- Markdown basics
- Headings, paragraphs, line breaks
- Emphasis (bold/italic)
- Lists, links, images
- Code blocks, tables
- Advanced features
Frontmatter Best Practices
Date Formats
published: 2025-01-20
date: 2025-01-20
pubDate: 2025-01-20Tags & Categories
tags: [Vue.js, JavaScript, Frontend, Tutorial]
category: Web DevelopmentDraft Management
draft: truekeeps the post hidden in production.draft: falsepublishes it.
Licenses
Common values: MIT, Apache-2.0, CC BY 4.0, CC BY-SA 4.0, Unlicensed.
Image Paths
Use relative paths to keep assets with the article:
image:
url: './cover.jpg'
alt: 'Cover illustration'Full Example
---
title: "React Hooks Deep Dive"
published: 2025-01-20
pinned: true
description: "Comprehensive guide to React Hooks with detailed explanations and visuals."
tags: [React, JavaScript, Hooks, Frontend]
category: "Web Development"
licenseName: "MIT"
author: "Chris Lee"
sourceLink: "https://github.com/chris/react-hooks-guide"
draft: false
date: 2025-01-20
image:
url: './react-hooks-cover.png'
alt: 'React Hooks cover'
pubDate: 2025-01-20
---
# React Hooks Deep Dive

...Previewing Posts
After saving, preview via the folder name appended to your dev URL. If the folder is my-complex-post, open http://localhost:4321/posts/my-complex-post.
Missing content or incorrect paths will result in 404s; check the browser console for debugging info.
Linking to Posts
Add links from other pages using standard anchors:
<a href="/posts/my-complex-post/">My complex article</a>Managing Assets
All related resources live inside the folder, e.g.:
src/content/posts/my-complex-post/
âââ index.md
âââ image1.png
âââ image2.jpg
âââ data.jsonReference images with simple relative paths:
This ensures RSS can resolve image paths correctly.
Multiple Posts
Create multiple folders, one per post:
src/content/posts/
âââ my-first-post/
â âââ index.md
â âââ cover.jpg
âââ my-second-post/
â âââ index.md
â âââ image1.png
â âââ image2.png
âââ my-third-post/
âââ index.md
âââ data.jsonEach folder keeps materials organized and easy to manage.
Linking Multiple Posts
Create lists that reference each post:
<ul>
<li><a href="/posts/my-first-post/">My first post</a></li>
<li><a href="/posts/my-second-post/">My second post</a></li>
<li><a href="/posts/my-third-post/">My third post</a></li>
</ul>Advantages
- Centralizes all assets per article.
- Simplifies relative image references.
- Creates a clean structure for complex content.
- Simplifies migration and backups.
- Prevents asset conflicts by isolating each article.
