SuperAPI AI Directory

gitsite-content-manager

Coding & development

View repository

Updated 10-15 16:44

About this skill

GitSite Content Manager

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:

  1. Under source/blogs/tech/ , create a date directory, format:YYYY-MM-DD-title-slug/
  2. Create the README.md file, 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:

  1. Under source/books/ , create the book directory
  2. Create the book.yml configuration file:
title: My Book Title
description: Book description
author: Orangon
  1. Create index.md as 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:

  1. Under the book directory, create the chapter directory, format:XX-Chapter-Title/
  2. Create the README.md file:
---
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:

  1. Under source/pages/ , create the page directory
  2. Create the README.md file:
---
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 template
  • book_chapter.md - Book chapter template
  • page.md - Static page template

These templates contain the complete frontmatter structure and content outline.

Important Notes

Directory Naming Conventions

  1. Blog posts: use the date format YYYY-MM-DD-title-slug/
  2. Book chapters: use a numeric prefix XX-Chapter-Title/ (such as 01-Introduction/)
  3. Book directories: use kebab-case naming (such as AI-Coding/)
  4. 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 date
  • tags: tag list
  • author: 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

  1. Forgot to create book.yml: The book directory must have a book.yml configuration file
  2. Incorrect directory naming: Using spaces or special characters will cause the build to fail
  3. Missing README.md: Each content directory must have a README.md file
  4. Frontmatter format error: The YAML format must be correct; pay attention to quotation marks and indentation
  5. Date format error: Blog dates must use the YYYY-MM-DD format

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 post
  • book - Create a book
  • chapter - Create a book chapter
  • page - 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 template
  • book_chapter.md - Complete book chapter template
  • page.md - Complete static page template

Template files use {{variable}} placeholders, which need to be replaced with actual content when used.