Overview
This skill is designed for projects using the GitSite static website generator, to automate the management of website content (blogs, books, and pages). GitSite uses a specific directory structure and YAML configuration files, and it is easy to forget the correct configuration format and file locations each time content is created manually. This skill ensures consistency and correctness in content creation.
Quick Start
Use this skill when the user requests the creation of any of the following:
- Create a new blog post
- Create a new book
- Create a new book chapter
- Create a new static page
Content Creation Workflow
1. Create a Blog Post
Directory structure:
source/blogs/tech/
└── YYYY-MM-DD-post-slug/
└── README.md
Create using a Python script:
python3 .claude/skills/gitsite-content-manager/scripts/manage_content.py blog \
--title "My Blog Post Title" \
--date "2025-01-15" \
--description "A description of the post" \
--tags tech tutorial \
--author "Orangon"
Manual creation steps:
- Under
source/blogs/tech/, create a date directory, format:YYYY-MM-DD-title-slug/ - Create the
README.mdfile, containing the following frontmatter:
---
title: "Blog Post Title"
date: 2025-01-15
description: "Blog post description"
tags:
- tech
- tutorial
author: Orangon
---
# Blog Post Title
<!-- Write your blog post content here -->
## Introduction
<!-- Add your introduction -->
## Main Content
<!-- Add your main content -->
## Conclusion
<!-- Add your conclusion -->
2. Create a Book
Directory structure:
source/books/
└── book-name/
├── book.yml
├── index.md
└── 01-Chapter-One/
└── README.md
Create using a Python script:
python3 .claude/skills/gitsite-content-manager/scripts/manage_content.py book \
--name "My-Book" \
--title "My Book Title" \
--description "Book description" \
--author "Orangon"
Manual creation steps:
- Under
source/books/, create the book directory - Create the
book.ymlconfiguration file:
title: My Book Title
description: Book description
author: Orangon
- Create
index.mdas the book index page
3. Create a Book Chapter
Create using a Python script:
python3 .claude/skills/gitsite-content-manager/scripts/manage_content.py chapter \
--book "My-Book" \
--number "01" \
--title "Chapter One" \
--description "Chapter description"
Manual creation steps:
- Under the book directory, create the chapter directory, format:
XX-Chapter-Title/ - Create the
README.mdfile:
---
title: "Chapter One"
description: "Chapter description"
---
# 01. Chapter One
<!-- Write your chapter content here -->
## Overview
<!-- Add chapter overview -->
## Main Content
<!-- Add your main content -->
## Summary
<!-- Add chapter summary -->
## References
<!-- Add references if needed -->
4. Create a Static Page
Directory structure:
source/pages/
└── page-name/
└── README.md
Create using a Python script:
python3 .claude/skills/gitsite-content-manager/scripts/manage_content.py page \
--name "about" \
--title "About Us" \
--description "About page description"
Manual creation steps:
- Under
source/pages/, create the page directory - Create the
README.mdfile:
---
title: "About Us"
description: "About page description"
---
# About Us
<!-- Write your page content here -->
Templates
Use assets/templates/ the template files in as the basis for content creation:
blog_post.md- Blog post templatebook_chapter.md- Book chapter templatepage.md- Static page template
These templates contain the complete frontmatter structure and content outline.
Important Notes
Directory Naming Conventions
- Blog posts: use the date format
YYYY-MM-DD-title-slug/ - Book chapters: use a numeric prefix
XX-Chapter-Title/(such as01-Introduction/) - Book directories: use kebab-case naming (such as
AI-Coding/) - Page directories: use kebab-case naming (such as
about-me/)
Frontmatter Format
All content files must contain YAML frontmatter, basic format:
---
title: "Content Title"
description: "Content description"
---
Blog posts additionally require:
date: publication datetags: tag listauthor: author name
Configuration File Locations
- Website configuration:
source/site.yml(main configuration) - Blog configuration:
source/blogs/tech/blog.yml - Book configuration:
source/books/[book-name]/book.yml - Page configuration: no separate configuration file required
URL Generation Rules
GitSite automatically generates URLs based on the directory structure:
- Blog:
/blogs/tech/YYYY-MM-DD-title-slug/index.html - Books:
/books/book-name/XX-Chapter-Title/index.html - Pages:
/pages/page-name/index.html
Verification
After creating content, verify whether the build succeeds:
# 构建网站
gitsite-cli build -o _site -v
# 或启动开发服务器预览
gitsite-cli serve
Check whether the generated HTML file exists in the _site/ directory.
Common Pitfalls
- Forgot to create book.yml: The book directory must have a
book.ymlconfiguration file - Incorrect directory naming: Using spaces or special characters will cause the build to fail
- Missing README.md: Each content directory must have a
README.mdfile - Frontmatter format error: The YAML format must be correct; pay attention to quotation marks and indentation
- Date format error: Blog dates must use the
YYYY-MM-DDformat
Resources
scripts/manage_content.py
The Python script provides a command-line interface for creating various types of content. The following commands are supported:
blog- Create a blog postbook- Create a bookchapter- Create a book chapterpage- Create a static page
Use --help to view the complete parameter description.
assets/templates/
Contains template files for various types of content, which can be copied and used directly or used as a reference:
blog_post.md- Complete blog post templatebook_chapter.md- Complete book chapter templatepage.md- Complete static page template
Template files use {{variable}} placeholders, which need to be replaced with actual content when used.