4
Content Format
hanyixuanten edited this page 2026-10-25 11:37:28 +00:00
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

内容格式

班史文章 src/content/YYYYMMDD.md

文件名用日期(同一天多篇加 -1、-2 后缀),frontmatter 字段:

字段 必填 说明
title ✓ 标题
date ✓ 日期 YYYY-MM-DD,决定排序
summary 摘要,显示在列表页和文章页副标题
author 记录人
cover 封面图路径,如 /pages/static/xxx.png

正文支持完整 Markdown,含 <details> 折叠块。示例:

---
title: 运动会夺冠记
date: 2025-09-28
summary: 4×100 接力最后一棒逆转
author: 体育委员
cover: /pages/static/sports-day.png
---

# 运动会夺冠记

正文……

文章生成到 /pages/<文件名去扩展名>,例如 src/content/20250928.md → /pages/20250928。

歌曲 src/songs/*.json

{
  "title": "歌名",
  "artist": "歌手",
  "date": "20250901",
  "link": "https://...",
  "note": "这首歌和班级的故事",
  "author": "推荐人"
}
  • title、artist 必填;link 须以 http(s):// 开头;
  • date 用 YYYYMMDD 字符串,决定排序;
  • 文件名任意(不冲突即可),在线投稿生成的形如 20251005-a1b2c3.json。

静态资源

文章引用的图片、音视频放 public/pages/static/,正文以 /pages/static/文件名 引用。投稿表单上传的封面图也会由后端提交到该目录。

以上三类内容也都可以不经过表单、直接改文件提交——投稿表单只是给同学用的便捷入口(见 CMS-Bot)。