blob: d2e915784360e85f377fbdf6e3d8c843c609f2fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
|
はい。公式ドキュメントに沿って見直すと、前回の要求仕様にはいくつか **Zola固有の構成・命名に寄せた方がよい点**があります。
特に重要なのは、Zolaは公式に「サイト構造を決めつけない」としており、基本は `content/` 配下の **Section (`_index.md`) と Page (`*.md`)**、そして `template` / `page_template` でテンプレートを結びつける構造です。公式の初期ディレクトリも `zola.toml / content / sass / static / templates / themes` です。 ([Zola][1])
その前提で、Codex向け仕様は次のように修正するのがよいです。
````markdown
# Zola Web Site Client Implementation Requirements
## 1. 目的
自前VPS上で Caddy により配信する個人Webサイトを Zola で構築する。
本番VPSでは動的Webアプリケーションを実行せず、クライアントPC上で Zola により静的HTML/CSS/JSを生成し、生成済み成果物のみをVPSへデプロイする。
npm / Node.js に依存しない構成とし、Webサイト構築に伴うサプライチェーン攻撃面を最小化する。
---
# 2. Zola採用方針
Zola公式ドキュメントの構造・概念・標準機能に従うこと。
Zolaは以下を基本概念として使用する。
- Site configuration: `zola.toml`
- Content
- Section: `_index.md`
- Page: 通常のMarkdownファイル
- Templates: Tera
- Sass: `sass/`
- Static assets: `static/`
- Themes: `themes/`
- Build output: `public/`
独自のディレクトリ規約や別SSG由来の設計を持ち込まず、Zola標準のSection/Pageモデルを優先する。
---
# 3. 必須技術構成
| 領域 | 採用 |
|---|---|
| Static Site Generator | Zola |
| Configuration | `zola.toml` |
| Content | CommonMark Markdown |
| Content model | Zola Section / Page |
| Template engine | Tera |
| Style | Sass / SCSS |
| JavaScript | 必要最小限の vanilla JavaScript |
| Backend | なし |
| Database | なし |
| npm / Node.js | 使用しない |
| htmx | 使用しない |
| External CDN | 原則使用しない |
| Production Web server | Caddy |
---
# 4. Zola標準ディレクトリ構造
`zola init` が生成する構造を基準とする。
```text
website/
├── zola.toml
├── content/
├── sass/
├── static/
├── templates/
└── themes/
````
build後には以下が生成される。
```text
public/
```
`public/` は生成物でありGit管理しない。
`themes/` はZola標準ディレクトリとして保持してよいが、本プロジェクトでは外部themeを原則使用しない。
---
# 5. 初期サイト構造
以下のコンテンツ領域を実装する。
```text
/
├── about/
├── projects/
└── notes/
```
想定URL:
```text
https://www.takashi-2521.com/
https://www.takashi-2521.com/about/
https://www.takashi-2521.com/projects/
https://www.takashi-2521.com/notes/
```
ZolaのSection/Pageモデルに従い、以下を基本構造とする。
```text
content/
├── about.md
│
├── projects/
│ ├── _index.md
│ ├── project-a.md
│ └── project-b.md
│
└── notes/
├── _index.md
├── note-a.md
└── note-b.md
```
`projects/_index.md` と `notes/_index.md` は Zola Section とする。
`projects/*.md` および `notes/*.md` は Zola Page とする。
About は単独Pageとして扱う。
必要な理由がある場合のみPage Bundle等の別構造を採用してよい。
---
# 6. Section設計
## 6.1 Projects Section
`content/projects/_index.md` を作成する。
例:
```toml
+++
title = "Projects"
sort_by = "date"
template = "projects.html"
page_template = "project-page.html"
+++
```
Zola標準のSection変数を使用する。
Projects一覧はTera側で、
```text
section.pages
```
を利用して生成する。
独自JSON index等を作成しない。
---
## 6.2 Notes Section
`content/notes/_index.md` を作成する。
例:
```toml
+++
title = "Notes"
sort_by = "date"
template = "notes.html"
page_template = "note-page.html"
+++
```
新しいNoteは `content/notes/*.md` を追加するだけで一覧へ反映されること。
---
# 7. Page設計
## 7.1 Project Page
Projectは1 Markdown = 1 Zola Pageとする。
例:
```toml
+++
title = "Example Project"
date = 2026-08-21
description = "Project description"
[extra]
status = "active"
repository = "https://example.invalid/"
+++
```
Zola標準front matterで直接扱えないプロジェクト固有metadataは `[extra]` を使用する。
最低限以下を扱えるようにする。
* `title`
* `date`
* `description`
Project固有情報:
* `extra.status`
* `extra.repository`
必要なら以下も追加可能。
* `extra.homepage`
* `extra.language`
* `extra.license`
metadataを過剰に増やさないこと。
---
## 7.2 Note Page
例:
```toml
+++
title = "Example Note"
date = 2026-08-21
description = "Note description"
+++
本文...
```
本文はZolaの `page.content` としてtemplateから表示する。
---
# 8. Templates
Zola公式ドキュメントのtemplate inheritanceを利用する。
最低限以下を構成する。
```text
templates/
├── base.html
├── index.html
├── projects.html
├── project-page.html
├── notes.html
├── note-page.html
└── page.html
```
必要であれば以下を追加する。
```text
templates/
└── partials/
├── header.html
├── navigation.html
└── footer.html
```
`base.html` を共通レイアウトとし、各templateはTeraの
```text
{% extends "base.html" %}
```
およびblockを使用する。
---
# 9. Internal Link方針
サイト内部リンクは、可能な限りURL文字列をハードコードせず、Zolaの `get_url` と `@/` internal link記法を使用する。
例:
```tera
<a href="{{ get_url(path='@/projects/_index.md') }}">Projects</a>
```
これによりcontent path変更時のリンク破損を減らす。
---
# 10. Home Page
Homeは `templates/index.html` で生成する。
最低限以下を表示可能にする。
* サイト名
* 簡単な説明
* Aboutへのリンク
* Projectsへのリンク
* Notesへのリンク
Home用の不要なCMS的データ構造は作らない。
必要なら `zola.toml` の `extra` をサイト全体metadataとして使用してよい。
---
# 11. Sass / SCSS
Zola標準Sass compilationを使用する。
`zola.toml`:
```toml
compile_sass = true
```
構成例:
```text
sass/
├── main.scss
├── _variables.scss
├── _base.scss
├── _typography.scss
├── _layout.scss
└── _components.scss
```
npm Sass / Dart Sass / PostCSS等は追加しない。
---
# 12. Static assets
Zolaの `static/` はbuild時に出力先へそのままコピーされる前提で使用する。
例:
```text
static/
├── favicon.svg
├── robots.txt
├── images/
└── js/
└── site.js
```
外部CDN依存を原則禁止する。
JavaScriptが必要な場合は `static/js/site.js` 等として自前配信する。
---
# 13. JavaScript
JavaScriptは必要最小限の vanilla JavaScript のみ使用する。
以下の原則に従う。
1. HTML標準機能で実現可能ならJSを使用しない。
2. CSSのみで実現可能ならJSを使用しない。
3. 外部frontend frameworkを導入しない。
4. inline event handlerを使用しない。
5. `eval()` を使用しない。
6. JavaScript無効でも主要コンテンツを閲覧可能にする。
---
# 14. Syntax Highlighting
技術記事用のコードブロックsyntax highlightingにはZola標準機能を使用する。
独自のPrism.js / highlight.js等は初期実装では導入しない。
設定は採用するZola versionの公式configuration仕様に従うこと。
---
# 15. Feeds
NotesについてRSS/Atom等のfeedを生成する。
Zola標準feed生成機能を使用する。
独自feed generatorは実装しない。
採用するZola versionにおける推奨設定を確認して実装すること。
---
# 16. Sitemap
Zola標準のsitemap生成機能を使用する。
独自 `sitemap.xml` generatorは作らない。
---
# 17. robots.txt
Zolaの標準 `robots.txt` template機能または `static/robots.txt` のうち、公式ドキュメントに沿った単純な方法を採用する。
不要な独自処理を作らない。
---
# 18. 404 Page
Zola標準の404 template仕様に従って実装する。
想定:
```text
templates/404.html
```
Caddyから静的404として扱える成果物を生成する。
---
# 19. Search
初期実装では検索を無効とする。
`zola init` / configuration上もsearch indexを生成しない設定とする。
将来必要になった場合のみZola標準search indexを再検討する。
外部検索libraryは現時点では導入しない。
---
# 20. Themes
Zolaは `themes/` を標準で持つが、本プロジェクトでは外部themeを原則使用しない。
理由:
* supply-chain面積を増やさない
* upstream theme更新への依存を避ける
* CSS/templateを完全に管理可能にする
* 不要なJavaScriptを取り込まない
したがって自前template + 自前SCSSを基本とする。
---
# 21. Zola Configuration
設定ファイル名は公式構成に合わせて、
```text
zola.toml
```
を使用する。
最低限:
```toml
base_url = "https://www.takashi-2521.com"
compile_sass = true
build_search_index = false
```
実際のsyntax highlighting、feed、taxonomy等については、使用するZola versionの公式documentationを確認して正しいconfiguration keyを使用すること。
推測で設定名を追加しないこと。
---
# 22. Development
ローカル開発ではZola標準development serverを使用する。
```bash
zola serve
```
Zolaは `zola.toml`, `content`, `sass`, `static`, `templates` の変更を監視し、local live reloadに使用できる。
追加のdev serverは作成しない。
---
# 23. Validation / Build
実装中は以下を使用する。
```bash
zola check
zola build
```
local preview:
```bash
zola serve
```
build output:
```text
public/
```
`public/` のみでサイトが成立すること。
---
# 24. Git
sourceのみGit管理する。
`.gitignore`:
```gitignore
/public/
```
Zolaが実際に生成しない独自cache directoryを推測で追加しないこと。
Editor / OS固有ファイルは必要に応じて追加可能。
---
# 25. Deployment境界
本仕様ではVPS側の配信基盤は変更しない。
既存:
```text
/srv/www/takashi-2521.com/
├── releases/
└── current -> releases/<release-id>
```
Caddy:
```text
root * /srv/www/takashi-2521.com/current
```
クライアント側では将来、
```text
zola check
→ zola build
→ public/
→ archive
→ SSH transfer
→ releases/<release-id>
→ current切替
```
を行う。
本Client Phaseでは `public/` が自己完結したbuild artifactになることを保証する。
---
# 26. Security Requirements
必須:
* npmを使用しない
* Node.js dependencyを使用しない
* React/Vue/Svelteを使用しない
* htmxを使用しない
* Tailwindを使用しない
* 外部CDNを使用しない
* external themeを原則使用しない
* backendを実装しない
* DBを使用しない
* buildをVPSで実行しない
可能な限り以下のCSPと互換な構造にする。
```text
default-src 'self';
script-src 'self';
style-src 'self';
img-src 'self' data:;
font-src 'self';
object-src 'none';
base-uri 'self';
frame-ancestors 'none';
```
inline script / inline event handlerは避ける。
---
# 27. Accessibility
最低限以下を満たす。
* semantic HTML
* 正しいheading hierarchy
* keyboard navigation
* visible focus
* alt text
* color contrast
* `prefers-reduced-motion` を考慮
* JSなしでも主要navigationが利用可能
---
# 28. Client Phase
## Client-1: Zola initialization
* Zola version確認
* `zola init` 相当の標準構成を確認
* `zola.toml`
* 標準directory作成
* `zola check`
* `zola build`
PASS:
```text
zola check PASS
zola build PASS
public/index.html exists
```
---
## Client-2: Section / Page architecture
* Home
* About Page
* Projects Section
* Project Pages
* Notes Section
* Note Pages
PASS:
```text
/
/about/
/projects/
/projects/<page>/
/notes/
/notes/<page>/
```
が生成される。
---
## Client-3: Tera templates / UI
* `base.html`
* template inheritance
* navigation
* header/footer
* SCSS
* responsive layout
PASS:
* Desktop正常
* Mobile正常
* internal navigation正常
---
## Client-4: Content model
Projects/NotesをZola Pageとして管理する。
PASS:
Markdownを1件追加すると、
```text
Section listing
+
individual Page
```
の両方へ自動反映される。
---
## Client-5: Zola static features
* syntax highlighting
* feed
* sitemap
* robots.txt
* 404
* favicon
Zola標準機能を優先する。
PASS:
`zola build` の成果物に必要な静的ファイルが生成される。
---
## Client-6: Git / final validation
* `.gitignore`
* sourceのみGit管理
* external dependenciesなし
* final `zola check`
* final `zola build`
---
# 29. Final Acceptance Criteria
以下をすべて満たすこと。
* [ ] Zola公式のSection/Pageモデルを使用している
* [ ] `zola.toml` を使用している
* [ ] `content/` を使用している
* [ ] Sectionは `_index.md` で定義されている
* [ ] ProjectはZola Pageとして実装されている
* [ ] NoteはZola Pageとして実装されている
* [ ] Section `template` / `page_template` を適切に使用している
* [ ] Tera template inheritanceを使用している
* [ ] internal linkにZola標準機能を利用している
* [ ] Sass compilationはZola標準機能
* [ ] syntax highlightingはZola標準機能
* [ ] feedはZola標準機能
* [ ] sitemapはZola標準機能
* [ ] 404はZola標準機能
* [ ] `zola serve` が動作
* [ ] `zola check` が成功
* [ ] `zola build` が成功
* [ ] `public/` 単独で静的サイトとして成立
* [ ] npm dependencyなし
* [ ] Node.js dependencyなし
* [ ] frontend frameworkなし
* [ ] htmxなし
* [ ] external CDNなし
* [ ] external theme依存なし
* [ ] backendなし
* [ ] DBなし
* [ ] `public/` はGit管理外
[1]: https://www.getzola.org/documentation/getting-started/overview/ "Overview | Zola"
|