Markdown Editor

Static Site Blog Post Template (Front Matter)

Blog post with YAML front matter (title, date, draft, tags, description, slug) and Hugo, Jekyll and Astro differences

ライティング・コンテンツ軽量Hugo, Jekyll and Astro front matter conventions (checked October 2026)staticsitepost

使い方: Use when writing a post for a static site generator. Fill the front matter first and keep draft true until ready. The main pitfall is generator-specific rules, such as Jekyll's dated file names or Astro's schema validation.

プレビュー

title"[Post title]"
dateYYYY-MM-DD
drafttrue
tags["[tag-one]", "[tag-two]"]
description"[One-sentence summary for search results and social cards, key point first]"
slug"[post-slug]"

[Post title]

Blog post template for static site generators (Hugo, Jekyll, Astro and similar). It starts with YAML front matter, explains how the three generators differ, then gives a post body structure. Based on the documented conventions of each generator. Replace every [bracketed] value; delete the notes sections before publishing.

Front matter reference

The same fields, shown on their own so you can copy and adapt them:

---
title: "How we cut our build time in half"
date: 2026-10-21T09:00:00+07:00
draft: false
tags: ["ci", "performance", "github-actions"]
description: "Caching, parallel jobs and smaller images took our CI from 18 to 8 minutes."
slug: "cut-build-time-in-half"
---
FieldPurposeNotes
titlePage title and headingQuote it if it contains a colon
datePublication date for sorting and feedsFuture dates may be hidden until that date
draftExclude from production buildsRemove or set false to publish
tagsTaxonomy pages and related postsUse lowercase, hyphenated tags consistently
descriptionMeta description and social previewNo fixed limit in Google Search; snippets are truncated to fit the screen, so lead with the key point
slugURL segmentLowercase, hyphens, no dates unless your permalinks need them

Generator differences

TopicHugoJekyllAstro
Where posts livecontent/posts/ (or any section)_posts/Anywhere: a collection defined in src/content.config.ts points a glob() loader at a folder (for example src/content/blog/)
File nameAny, for example my-post.md or a page bundle my-post/index.mdMust be YYYY-MM-DD-title.mdAny; glob() derives the entry ID from the file name
Draftsdraft: true, built only with --buildDrafts (-D)Put the file in _drafts/, or published: false; preview with --draftsNo built-in rule; filter draft yourself in getCollection()
Front matter formatsYAML, TOML (+++) or JSONYAML onlyYAML (TOML also supported in current versions); fields are validated by the collection schema
Slugslug overrides the last URL segmentslug used with the permalink pattern in _config.ymlThe content collections guide says a slug field overrides the glob() entry ID; generateId() gives full control. Routes come from your page code
TagsBuilt-in taxonomies (tags, categories)tags and categories are built inDefine tags in the schema; build tag pages yourself
Summarydescription or summary, or text before <!--more-->excerpt or the first paragraphAny field you define, usually description

Version note: checked in October 2026 against the official Hugo front matter page, the Jekyll posts and front matter pages, and the Astro content collections guide (Astro 5 and later use the content layer API with src/content.config.ts; older Astro versions used src/content/config.ts and required posts inside src/content/). Check the documentation for the version your site runs.

Post body

Introduction

[Two or three sentences: the problem or question, who it is for, and what the reader will get from the post.]

[Main section 1]

[Explain the first key point with an example, code block or image.]

[Main section 2]

[Second key point. Keep headings descriptive so readers can skim.]

[Main section 3]

[Third key point, or a step-by-step walkthrough.]

Conclusion

[Summarise the takeaway in two sentences and suggest one next step, such as a related post or a link to the code.]

Before publishing

  • draft set to false (Hugo, Astro) or file moved to _posts/ (Jekyll).
  • Images stored next to the post or in the static folder, with alt text.
  • The local preview build shows the post at the expected URL.
  • Description reads well as a search snippet.

References

Related: writing/blog-post, writing/technical-article, marketing/seo-brief.

Standard and licence note

Based on the documented front matter conventions of Hugo, Jekyll and Astro as published in October 2026. Generator behaviour changes between versions; check your version's documentation. Original text written for this collection. Template licence: MIT.

関連テンプレート