{"id":50289735,"url":"https://github.com/windyakin/note","last_synced_at":"2026-05-28T05:04:11.269Z","repository":{"id":354581300,"uuid":"1183860840","full_name":"windyakin/note","owner":"windyakin","description":"Notion + Astro + Cloudflare Pages","archived":false,"fork":false,"pushed_at":"2026-05-18T02:15:16.000Z","size":321,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-18T02:38:39.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://note.windyakin.net","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windyakin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T02:41:06.000Z","updated_at":"2026-05-18T02:11:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/windyakin/note","commit_stats":null,"previous_names":["windyakin/note"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/windyakin/note","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windyakin%2Fnote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windyakin%2Fnote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windyakin%2Fnote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windyakin%2Fnote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windyakin","download_url":"https://codeload.github.com/windyakin/note/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windyakin%2Fnote/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33594859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-28T05:04:06.457Z","updated_at":"2026-05-28T05:04:11.256Z","avatar_url":"https://github.com/windyakin.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"public/favicon.svg\" width=\"120\" height=\"120\" alt=\"note\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003enote\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Notion を CMS として、Astro (Vue) で静的ビルドし Cloudflare Pages にデプロイする短文ブログ。\n\u003c/p\u003e\n\n---\n\n## 特徴\n\n- **Notion ブロック構造をそのままレンダリング** — Markdown 変換を挟まず、Notion API のブロックデータを Vue コンポーネントで再帰的に描画する\n- **ビルド時に外部リソースをローカル化** — bookmark / link_preview の OGP 取得、Notion 画像と OGP 画像のダウンロード ([src/lib/enrichBlocks.ts](src/lib/enrichBlocks.ts))\n- **oEmbed エンドポイント** — 各記事の埋め込みメタデータを `/oembed/\u003cid\u003e.json` で配信\n- **自動ビルドトリガー** — Notion DB の変更を検知して Cloudflare Pages のビルドを叩く Cloudflare Worker を同梱 ([worker/](worker/))\n\n---\n\n## セットアップ\n\n### 1. Notion Integration の作成\n\n1. [Notion Integrations](https://www.notion.so/my-integrations) にアクセス\n2. 「新しいインテグレーション」を作成し、**Internal Integration Token** を控える\n3. 作成したインテグレーションに **コンテンツの読み取り** 権限があることを確認\n\n### 2. Notion Database の準備\n\nブログ記事を管理するデータベースを作成し、以下のプロパティを設定する:\n\nプロパティ名 | タイプ | 説明\n--- | --- | ---\nTitle | Title | 記事タイトル\nPublished | Checkbox | 公開フラグ\nFirst published at | Date | 公開日 (一覧のソートキー)\n\n`Last edited time` は Notion が自動付与するため設定不要。\n\nデータベース ID は URL から取得:\n\n```\nhttps://www.notion.so/\u003cworkspace\u003e/\u003cDATABASE_ID\u003e?v=...\n                                  ^^^^^^^^^^^^\n```\n\n### 3. プロジェクトのセットアップ\n\n```bash\nnpm install\n\n# .env を作成\ncp .env.example .env\n# NOTION_TOKEN と NOTION_DATABASE_ID を設定\n```\n\n#### 開発サーバー\n\n```bash\nnpm run dev\n```\n\n#### ビルドとプレビュー\n\n```bash\nnpm run build\nnpm run preview\n```\n\n### 4. サイト情報の設定\n\nサイト情報は環境変数で上書きできる ([astro.config.mjs](astro.config.mjs))。\n\n環境変数 | デフォルト値 | 用途\n--- | --- | ---\n`SITE_NAME` | `note` | サイト名\n`SITE_DESCRIPTION` | `Notionをブログのように公開するためのサイト` | サイト説明文\n`SITE_AUTHOR` | `author` | 著者名 (フッター / oEmbed の `author_name`)\n`SITE_COPYRIGHT_YEAR` | ビルド実行年 | フッターの著作権表示年\n`SITE_URL` | `https://your-blog.pages.dev` | 公開ドメイン (canonical URL / OGP / oEmbed の URL に使用)\n\n### 5. Cloudflare Pages へのデプロイ\n\n1. リポジトリを GitHub に push\n2. [Cloudflare Dashboard](https://dash.cloudflare.com/) → Pages → 「プロジェクトを作成」\n3. Git リポジトリを接続\n4. ビルド設定:\n   - **フレームワークプリセット**: Astro\n   - **ビルドコマンド**: `npm run build`\n   - **ビルド出力ディレクトリ**: `dist`\n5. 環境変数に `NOTION_TOKEN` / `NOTION_DATABASE_ID` を設定\n6. デプロイ\n\n---\n\n## 記事の更新を自動でビルドに反映する\n\n`worker/` 以下に Cloudflare Worker を同梱している。Cron Trigger (デフォルト 5 分間隔) で Notion DB を覗き、ページ集合か `last_edited_time` に差分があれば Pages の Deploy Hook を叩いてビルドを起動する。\n\n詳細は [worker/README.md](worker/README.md) を参照。\n\n---\n\n## プロジェクト構成\n\n```\nnote/\n├── astro.config.mjs            # Astro 設定 (Vue 統合 / env スキーマ)\n├── public/\n│   ├── favicon.svg             # ロゴ兼ファビコン\n│   └── ogp/                    # ビルド時にダウンロードした OGP 画像置き場\n├── src/\n│   ├── site.ts                 # 環境変数からサイト情報を再エクスポート\n│   ├── lib/\n│   │   ├── notion.ts           # Notion API クライアント (一覧/ページ/ブロック取得)\n│   │   ├── enrichBlocks.ts     # bookmark/link_preview の OGP 取得 + 画像ダウンロード\n│   │   └── ogp.ts              # OGP メタデータ取得・画像処理 (cheerio + sharp)\n│   ├── components/\n│   │   ├── NotionRenderer.vue  # ブロックレンダラー (再帰)\n│   │   ├── RichText.vue        # リッチテキストレンダラー\n│   │   ├── SiteHeader.astro    # サイト共通ヘッダー\n│   │   ├── PostHeader.astro    # 記事メタ表示\n│   │   └── blocks/             # ブロック種別ごとのコンポーネント\n│   ├── layouts/\n│   │   └── Base.astro          # 共通レイアウト (head / OGP / oEmbed link)\n│   ├── pages/\n│   │   ├── [...page].astro     # 記事一覧 (10 件ごとページネーション)\n│   │   ├── posts/[id].astro    # 記事詳細 (Notion page id をそのまま URL に使用)\n│   │   └── oembed/[id].json.ts # oEmbed エンドポイント\n│   └── styles/\n│       └── global.css          # グローバルスタイル (Bootstrap 5.3 ベース)\n└── worker/                     # 自動ビルドトリガー用 Cloudflare Worker\n```\n\n## ライセンス\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindyakin%2Fnote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindyakin%2Fnote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindyakin%2Fnote/lists"}