Update Cake.Wyam to Cake 3.0 by pascalberger · Pull Request #29 · Wyamio/Wyam
Update Cake.Wyam to reference Cake 3.0 and target net6.0 and net7.0.
https://github.com/Wyamio/Wyam/issues/29
調べる
ローカルにファイルを配置することでテーマをオーバーライドできると書いてあるのだが、 どのように配置するか正確なところがわからん。
試行錯誤したところ、
input
にテーマのファイルを直接コピーしたら反映された。
theme
フォルダでもよさそうなのだけど、 input
しか --watch
の対象にならないので、
input
に入れてしまうのがよさそう。
レイアウトの構成
ASP.Net のtemplateエンジン、 Razor で構成されていて拡張子は、 cshtml
。
ファイル名は、Blog Recipeが規定している。
サイトのルート(index), 各記事(post), 記事一覧(archive, tag), タグ一覧(tags)などがある。単純な例はこれ。
テーマを作ってみる
をクローンして、themes/Blog/BlogTemplate/*
を input
にコピーする。
config.yml も #theme BlogTemplate
とする。
共通のレイアウトが _Layout.cshtml
。 その中の、 @RenderBody()
にルート(_Index.cshtml), 記事(_PostLayout.cshtml), 記事一覧(_Archive.cshtml, _Tag.cshtml), タグ一覧(_Tags.cshtml)がはめ込まれる様子。
_PostIndex.cshtml
は廃止されたので使われない。
- [Breaking Change][Refactoring] Moved Blog recipe theme file
/_PostIndex.cshtml
to/_Archive.cshtml
, no other changes should be needed to this file in themes other than to move it - sorry for the rename (again), the first name was kind of dumb, this one is better
日本語が文字化けするので、 _Layout.cshtml
に <meta charset="UTF-8">
だけ足す。
あとは適当にやってみる。
cshtml からアクセスできる変数
- Model
- Context
作業メモ
- scss(wyamが対応している)
- highlight.js (phantom themeからコピー)
- 旧記事を雑に復旧
- locale https://wyam.io/docs/advanced/setting-the-culture
ToDo
- 404頁
- 一覧をpageで分割
- 記事内のTOC
- https://konpa.github.io/devicon/
- http://fizzed.com/oss/font-mfizz
- https://www.digitaltapestry.net/posts/poshwyam
動作
複数のパイプラインが登録してあって(Recipe)、ひとつずつ実行する