docs: update theme guide

This commit is contained in:
radishzzz 2025-05-29 00:11:01 +01:00
parent 67e745332e
commit aff6e0c4f2
6 changed files with 68 additions and 14 deletions

View file

@ -282,10 +282,19 @@ body{color:oklch(25% 0.005 298)} /* Font color */
## Creating a New Post
Create a new file with `.md` or `.mdx` extension in the `src/content/posts/` directory, and add `Front Matter` metadata at the top of the file.
Run `pnpm new-post <filename>` to create a new post, which can then be edited in the `src/content/posts/` directory.
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
Only `title` and `published` are required fields, all other configurations can be safely omitted.
```markdown
---
# Required

View file

@ -282,10 +282,19 @@ body{color:oklch(25% 0.005 298)} /* Color de fuente */
## Creación de un Nuevo Artículo
Crea un nuevo archivo con extensión `.md` o `.mdx` en el directorio `src/content/posts/`, y añade los metadatos `Front Matter` en la parte superior del archivo.
Ejecuta `pnpm new-post <filename>` para crear un nuevo artículo, que luego puede editarse en el directorio `src/content/posts/`.
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
Solo los campos `title` y `published` son obligatorios, todas las demás configuraciones pueden omitirse de forma segura.
```markdown
---
# Obligatorio

View file

@ -282,10 +282,19 @@ body{color:oklch(25% 0.005 298)} /* フォントカラー */
## 新しい記事の作成
`src/content/posts/` ディレクトリに `.md` または `.mdx` 拡張子を持つ新しいファイルを作成し、ファイルの先頭に `Front Matter` メタデータを追加します。
`pnpm new-post <filename>` を実行して新しい記事を作成し、`src/content/posts/` ディレクトリで編集できます。
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
`title``published` のみが必須フィールドで、他のすべての設定は安全に省略できます。
```markdown
---
# 必須

View file

@ -282,10 +282,19 @@ body{color:oklch(25% 0.005 298)} /* Цвет шрифта */
## Создание новой статьи
Создайте новый файл с расширением `.md` или `.mdx` в директории `src/content/posts/`, и добавьте метаданные `Front Matter` в верхней части файла.
Выполните команду `pnpm new-post <filename>` для создания новой статьи, которую затем можно редактировать в директории `src/content/posts/`.
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
Только поля `title` и `published` являются обязательными, все остальные конфигурации можно безопасно опустить.
```markdown
---
# Обязательные
@ -332,15 +341,15 @@ abbrlink: theme-guide
# moreLocales: ['es', 'ru']
# lang: ''
src/content/posts/apple.md -> example.com/posts/apple/
-> example.com/es/posts/apple/
-> example.com/ru/posts/apple/
src/content/posts/apple.md -> example.com/posts/apple/
-> example.com/es/posts/apple/
-> example.com/ru/posts/apple/
# lang: en
src/content/posts/apple.md -> example.com/posts/apple/
src/content/posts/apple.md -> example.com/posts/apple/
# lang: es
src/content/posts/apple.md -> example.com/es/posts/apple/
src/content/posts/apple.md -> example.com/es/posts/apple/
# lang: ru
src/content/posts/apple.md -> example.com/ru/posts/apple/
src/content/posts/apple.md -> example.com/ru/posts/apple/
```
#### abbrlink

View file

@ -282,11 +282,20 @@ body{color:oklch(25% 0.005 298)} /* 字體顏色 */
## 創建新文章
`src/content/posts/` 目錄中新建以 `.md``.mdx` 為後綴的文件,並在文件頂部添加 `Front Matter` 元數據。
執行 `pnpm new-post <filename>` 創建新文章,可在 `src/content/posts/` 目錄中編輯。
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
```markdown
`title``published` 為必填項,其餘配置均可安全刪除。
```md
---
# 必填
title: 主題上手指南

View file

@ -282,11 +282,20 @@ body{color:oklch(25% 0.005 298)} /* 字体颜色 */
## 创建新文章
`src/content/posts/` 目录中新建以 `.md``.mdx` 为后缀的文件,并在文件顶部添加 `Front Matter` 元数据。
执行 `pnpm new-post <filename>` 创建新文章,可在 `src/content/posts/` 目录中编辑。
```bash
pnpm new-post -> src/content/posts/new-post.md
pnpm new-post first-post -> src/content/posts/first-post.md
pnpm new-post 2025/03/first-post -> src/content/posts/2025/03/first-post.md
pnpm new-post first-post.mdx -> src/content/posts/first-post.mdx
```
### Front Matter
```markdown
`title``published` 为必填项,其余配置均可安全删除。
```md
---
# 必填
title: 主题上手指南