Writing

In Kecare, articles are stored in the theme directory/.kecare/articles/ directory, and currently only Markdown files are supported.

Create Article

  1. Create .md files in the .kecare/articles/ directory
  2. Write content

Article Structure

The article consists of Front Matter and Body Content:

---
title: Hello Kecare
date: 2026-01-22 12:00:00
tags:
  - kecare
  - blog
desc: 文章摘要
author: Pamper
menu: test
translate: ['zh-CN', 'en-US', 'ja-JP']
---

# Hello Kecare

正文内容...

Front Matter

Each article can include a Front Matter (in YAML format) at the beginning, which is used to provide metadata for the article, such as: title, date, tags, description, author, cover image, pinning, menu, etc.

Front Matter is a YAML-formatted metadata block located at the beginning of a Markdown file, separated by ---. Kecare parses this metadata and passes it to theme components for use.

Complete Example

Here is an example of all currently supported Front Matter fields in Kecare:

---
title: 写作指南                 # 文章标题
date: 2025-11-19               # 发布日期
tags:                          # 标签列表
  - kecare
  - blog
  - 教程
desc: 这是一篇关于如何使用 Kecare 写作的指南  # 文章摘要
author: 作者名                 # 作者名称
coverSrc: "https://example.com/cover.webp"  # 封面图片
sticky: 1                      # 置顶优先级
menu: kecare-docs              # 所属菜单
translate: ['zh-CN', 'en-US', 'ja-JP']  # 翻译语言,第一个值需为当前语言
---

You don't need to include all Front Matter fields for every article. Currently, only the date field is mandatory. For other fields, if you don't provide a value, Kecare will use the default value.

Running the Generator

After writing, run the generator to preview it in the browser.

文章作者:
文章链接:kecare.me/articles/6e8c5f0b
版权声明: 博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源