Color mode

Configuration

Riebeckite の設定は riebeckite.config.ts に記述します。

基本的な Site では、defineConfig() を使って次のように設定します。

ts
import { defineConfig } from "@riebeckite/core";
 
export default defineConfig({
  site: {
    title: "My site",
    baseUrl: "https://example.com",
  },
 
  content: {
    directory: "content",
    exclude: ["drafts/**"],
    filters: {
      publishStrategy: "explicit",
    },
  },
 
  theme: {
    colorMode: "system",
    articleLayout: "article",
  },
 
  plugins: [],
});

必須なのは site です。

そのほかは必要に応じて設定します。

Field 用途
site Site の基本情報
content コンテンツの場所と公開条件
theme Theme の設定
plugins 使用する Plugin
cache build cache の設定

Config は Content や Plugin の処理が始まる前に Integration によって解決されます。

このセクションの構成

Config の検証

Configuration に問題がある場合は ConfigValidationError として報告されます。

不正な Configuration を無視してそのまま起動するのではなく、早い段階で失敗させます。

Config を変更した後は、

sh
npm exec riebeckite check

を実行してください。

まとめ

Configuration では、Site と Content の場所を混同しないことが重要です。

Diagram source
text
flowchart LR
    App["appRoot<br/>Siteはどこ?"]
    Config["configRoot<br/>Configはどこ?"]
    Content["contentRoot<br/>Contentはどこ?"]
 
    Config --> Resolve["Configuration Resolution"]
    App --> Resolve
    Resolve --> Content
 
    Content --> Manager["Content System"]
    Manager --> Build["Build"]

基本的には、

text
appRoot
  = Site Application の場所
 
configRoot
  = Config の場所
 
contentRoot
  = Markdown / Vault の場所

と覚えておけば十分です。

通常の Site では3つの違いを意識する必要はほとんどありません。

外部 Vault、別 repository の Content、特殊な monorepo 構成を使う場合だけ、この境界を意識してください。

Config の変更後は riebeckite check、実際にどう解決されたか確認したい場合は riebeckite inspect config を使用してください。

History

1 changesCollapseExpand
1 + ---
2 + title: Configuration
3 + sidebar:
4 + label: Configuration
5 + ---
6 + # Configuration
7 +
8 + Riebeckite の設定は `riebeckite.config.ts` に記述します。
9 +
10 + 基本的な Site では、`defineConfig()` を使って次のように設定します。
11 +
12 + ```ts id="vps2rj"
13 + import { defineConfig } from "@riebeckite/core";
14 +
15 + export default defineConfig({
16 + site: {
17 + title: "My site",
18 + baseUrl: "https://example.com",
19 + },
20 +
21 + content: {
22 + directory: "content",
23 + exclude: ["drafts/**"],
24 + filters: {
25 + publishStrategy: "explicit",
26 + },
27 + },
28 +
29 + theme: {
30 + colorMode: "system",
31 + articleLayout: "article",
32 + },
33 +
34 + plugins: [],
35 + });
36 + ```
37 +
38 + 必須なのは `site` です。
39 +
40 + そのほかは必要に応じて設定します。
41 +
42 + | Field | 用途 |
43 + | --- | --- |
44 + | `site` | Site の基本情報 |
45 + | `content` | コンテンツの場所と公開条件 |
46 + | `theme` | Theme の設定 |
47 + | `plugins` | 使用する Plugin |
48 + | `cache` | build cache の設定 |
49 +
50 + Config は Content や Plugin の処理が始まる前に Integration によって解決されます。
51 +
52 +
53 + ## このセクションの構成
54 +
55 + - [ナビゲーションの設定](./configuration/navigation.ja.md)
56 + - [Content の設定と ContentSource](./configuration/content.ja.md)
57 + - [3つの Root と外部 Vault](./configuration/roots.ja.md)
58 + - [Attachment・Media と公開](./configuration/assets.ja.md)
59 + - [Build cache](./configuration/cache.ja.md)
60 + - [Plugin の設定](./configuration/plugins.ja.md)
61 + - [Theme の設定](./configuration/theme.ja.md)
62 + - [外部 Vault のトラブルシュート](./configuration/troubleshooting.ja.md)
63 +
64 + ## Config の検証
65 +
66 + Configuration に問題がある場合は `ConfigValidationError` として報告されます。
67 +
68 + 不正な Configuration を無視してそのまま起動するのではなく、早い段階で失敗させます。
69 +
70 + Config を変更した後は、
71 +
72 + ```sh id="khhx15"
73 + npm exec riebeckite check
74 + ```
75 +
76 + を実行してください。
77 +
78 +
79 + ## まとめ
80 +
81 + Configuration では、Site と Content の場所を混同しないことが重要です。
82 +
83 + ```mermaid id="zzmq0d"
84 + flowchart LR
85 + App["appRoot<br/>Siteはどこ?"]
86 + Config["configRoot<br/>Configはどこ?"]
87 + Content["contentRoot<br/>Contentはどこ?"]
88 +
89 + Config --> Resolve["Configuration Resolution"]
90 + App --> Resolve
91 + Resolve --> Content
92 +
93 + Content --> Manager["Content System"]
94 + Manager --> Build["Build"]
95 + ```
96 +
97 + 基本的には、
98 +
99 + ```text id="htn7yn"
100 + appRoot
101 + = Site Application の場所
102 +
103 + configRoot
104 + = Config の場所
105 +
106 + contentRoot
107 + = Markdown / Vault の場所
108 + ```
109 +
110 + と覚えておけば十分です。
111 +
112 + 通常の Site では3つの違いを意識する必要はほとんどありません。
113 +
114 + 外部 Vault、別 repository の Content、特殊な monorepo 構成を使う場合だけ、この境界を意識してください。
115 +
116 + Config の変更後は `riebeckite check`、実際にどう解決されたか確認したい場合は `riebeckite inspect config` を使用してください。
117 +

Local Graph

Nearby Notes

Open in Explorer →
Configurationwriting-content.ja
CurrentOutgoingBacklink