オンデマンドレンダリングアダプター
オンデマンドレンダリングアダプター favicon https://docs.astro.build/ja/guides/server-side-rendering/
オンデマンドレンダリングアダプター

Unknown Content Collection Error

90 - Ratchagitja.md - Setup Astro
My notes & stuff
90 - Ratchagitja.md - Setup Astro favicon https://garden.narze.live/100daysofcode-r3-90-ratchagitja-md-setup-astro/
90 - Ratchagitja.md - Setup Astro

gatsby の contents/blog を src/content/blog にシンボリックリンクしたのがよくなかった。

Content entry frontmatter does not match schema

元記事にあわせて pubDate を date に変えたが、不整合ではまる。

わりとあっさり動いた

gatsby と比べるとだいぶシンプル。

gatsbymd => GraphQL => html なのに対して、 astromd => html なのでシンプル。

theme: astro-ink を導入してみる

よくわからなかったのでコピペでやった。

新規にコピー元になるサイトを作る。 npm create astro@latest -- --template one-aalam/astro-ink src や各種設定をコピーした。

追加の依存を解決するべく、npm install するとエラーになったので、 npm-check-updates した。

alias path の解決。 https://docs.astro.build/ja/guides/aliases/

schema 調整。 optional 付けて、date を調整するというので動きそう。

const blogCollection = defineCollection({
schema: z.object({
title: z.string().max(100, 'The title length must be less than or equal to 100 chars'),
description: z.string().optional(), // <= optional
tags: z.array(z.string()),
author: z.string().optional(), // <= optional
authorImage: z.string().optional(), // <= optional
authorTwitter: z.string().optional(), // <= optional
date: z.coerce.date(), // <= これ
image: z.string().optional(), // <= optional
category: z.string().optional(), // <= optional
})
})

結果、 sveltetailwind といった知らないライブラリーが入ったが、 動いた。 のだが gh-pages に deploy したら動いてなかった。 どうも SSR 向けの theme らしい。

astron.config.mjs
output: 'server',
adapter: vercel(),
> npm run build
`getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.
ルーティング
Astroのルーティングの紹介
ルーティング favicon https://docs.astro.build/ja/core-concepts/routing/#静的ssgモード
ルーティング

なんとなく動いた。

astro の blog template に戻した

改めて、

初めてのAstroブログ
プロジェクトベースのチュートリアルでAstroの基本を学びましょう。始めるために必要なすべての前提知識をお届けします!
初めてのAstroブログ favicon https://docs.astro.build/ja/tutorial/0-introduction/
初めてのAstroブログ
コンテンツコレクション
コンテンツコレクションは、Markdownを整理し、フロントマターをスキーマで型チェックするのに役立ちます。
コンテンツコレクション favicon https://docs.astro.build/ja/guides/content-collections/
コンテンツコレクション

に目を通してシンプル化した。

nvim 設定

neoformat で prettier-plugin-astro が動くように npx prettier になるようした。

-- astro
vim.g.neoformat_astro_prettier = {
exe = 'npx',
args = { "prettier", "--stdin-filepath", '"%:p"' },
stdin = 1,
try_node_exe = 1,
}