create-ampless 0.2.0-alpha.2 → 0.2.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +77 -0
- package/README.md +40 -1
- package/dist/index.js +2099 -47
- package/dist/templates/_shared/AGENTS.ja.md +108 -0
- package/dist/templates/_shared/AGENTS.md +108 -0
- package/dist/templates/_shared/README.ja.md +184 -0
- package/dist/templates/_shared/README.md +184 -0
- package/dist/templates/_shared/RUNBOOK.ja.md +150 -0
- package/dist/templates/_shared/RUNBOOK.md +19 -1
- package/dist/templates/_shared/amplify/auth/post-confirmation/resource.ts +6 -0
- package/dist/templates/_shared/amplify/backend.custom.ts +41 -0
- package/dist/templates/_shared/amplify/backend.ts +10 -2
- package/dist/templates/_shared/amplify/data/resource.custom.ts +33 -0
- package/dist/templates/_shared/amplify/data/resource.ts +23 -15
- package/dist/templates/_shared/amplify/events/processor-untrusted/resource.ts +4 -0
- package/dist/templates/_shared/amplify/functions/user-admin/handler.ts +4 -0
- package/dist/templates/_shared/amplify/functions/user-admin/resource.ts +12 -0
- package/dist/templates/_shared/amplify.yml +18 -0
- package/dist/templates/_shared/app/(admin)/admin/mcp-tokens/page.tsx +5 -0
- package/dist/templates/_shared/app/(admin)/admin/users/page.tsx +5 -0
- package/dist/templates/_shared/app/api/admin/mcp-tokens/route.ts +6 -0
- package/dist/templates/_shared/app/api/mcp/route.ts +9 -0
- package/dist/templates/_shared/app/globals.css +55 -39
- package/dist/templates/_shared/app/layout.tsx +22 -1
- package/dist/templates/_shared/app/site/[siteId]/[...path]/route.ts +17 -0
- package/dist/templates/_shared/lib/admin.ts +9 -7
- package/dist/templates/_shared/lib/amplify.ts +17 -6
- package/dist/templates/_shared/package.json +11 -9
- package/dist/templates/_shared/proxy.ts +19 -2
- package/dist/templates/blog/README.ja.md +22 -0
- package/dist/templates/blog/README.md +17 -47
- package/dist/templates/blog/tokens.css +26 -40
- package/dist/templates/corporate/README.ja.md +18 -0
- package/dist/templates/corporate/README.md +12 -14
- package/dist/templates/corporate/tokens.css +17 -39
- package/dist/templates/dads/README.ja.md +31 -0
- package/dist/templates/dads/README.md +13 -17
- package/dist/templates/dads/tokens.css +22 -42
- package/dist/templates/docs/README.ja.md +24 -0
- package/dist/templates/docs/README.md +10 -13
- package/dist/templates/docs/tokens.css +17 -39
- package/dist/templates/landing/README.ja.md +20 -0
- package/dist/templates/landing/README.md +14 -19
- package/dist/templates/landing/tokens.css +17 -39
- package/dist/templates/minimal/README.ja.md +14 -0
- package/dist/templates/minimal/README.md +9 -47
- package/dist/templates/minimal/tokens.css +17 -39
- package/package.json +2 -1
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Client-side Amplify SDK setup. Imported as a side-effect from
|
|
2
|
+
// `app/providers.tsx` so it runs on every page load (public + admin +
|
|
3
|
+
// login). `<AdminProviders>` (mounted by the admin layout factory)
|
|
4
|
+
// also performs this configuration, but it only runs for routes under
|
|
5
|
+
// the (admin) group; `/login` is a top-level route outside that group
|
|
6
|
+
// and would otherwise hit "Auth UserPool not configured" because no
|
|
7
|
+
// AdminProviders has bootstrapped the SDK yet.
|
|
8
|
+
//
|
|
9
|
+
// `Amplify.configure` is idempotent — calling it once at the root and
|
|
10
|
+
// again inside AdminProviders is harmless.
|
|
11
|
+
|
|
12
|
+
import { Amplify } from 'aws-amplify'
|
|
13
|
+
import outputs from '../amplify_outputs.json'
|
|
14
|
+
|
|
15
|
+
Amplify.configure(outputs, { ssr: true })
|
|
6
16
|
|
|
7
17
|
export function configureAmplify() {
|
|
8
|
-
//
|
|
18
|
+
// module-level side effect above already ran; keep this as a no-op
|
|
19
|
+
// for callers that still import it as a function for back-compat.
|
|
9
20
|
}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"build": "next build",
|
|
9
9
|
"start": "next start",
|
|
10
10
|
"lint": "next lint",
|
|
11
|
-
"sandbox": "ampx sandbox"
|
|
11
|
+
"sandbox": "ampx sandbox --once && next dev",
|
|
12
|
+
"update-ampless": "npx create-ampless@latest upgrade",
|
|
13
|
+
"copy-theme": "npx create-ampless@latest copy-theme"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {
|
|
14
16
|
"@aws-amplify/adapter-nextjs": "^1.6.0",
|
|
@@ -20,15 +22,15 @@
|
|
|
20
22
|
"@tiptap/pm": "^3.23.4",
|
|
21
23
|
"@tiptap/react": "^3.23.4",
|
|
22
24
|
"@tiptap/starter-kit": "^3.23.4",
|
|
23
|
-
"@ampless/plugin-og-image": "^0.2.0-alpha.
|
|
24
|
-
"@ampless/plugin-rss": "^0.2.0-alpha.
|
|
25
|
-
"@ampless/plugin-seo": "^0.2.0-alpha.
|
|
26
|
-
"@ampless/plugin-webhook": "^0.2.0-alpha.
|
|
27
|
-
"@ampless/admin": "^0.2.0-alpha.
|
|
28
|
-
"@ampless/backend": "^0.2.0-alpha.
|
|
29
|
-
"@ampless/runtime": "^0.2.0-alpha.
|
|
25
|
+
"@ampless/plugin-og-image": "^0.2.0-alpha.6",
|
|
26
|
+
"@ampless/plugin-rss": "^0.2.0-alpha.6",
|
|
27
|
+
"@ampless/plugin-seo": "^0.2.0-alpha.6",
|
|
28
|
+
"@ampless/plugin-webhook": "^0.2.0-alpha.6",
|
|
29
|
+
"@ampless/admin": "^0.2.0-alpha.18",
|
|
30
|
+
"@ampless/backend": "^0.2.0-alpha.8",
|
|
31
|
+
"@ampless/runtime": "^0.2.0-alpha.9",
|
|
30
32
|
"@digital-go-jp/tailwind-theme-plugin": "^0.3.4",
|
|
31
|
-
"ampless": "^0.2.0-alpha.
|
|
33
|
+
"ampless": "^0.2.0-alpha.6",
|
|
32
34
|
"aws-amplify": "^6.10.0",
|
|
33
35
|
"class-variance-authority": "^0.7.1",
|
|
34
36
|
"clsx": "^2.1.1",
|
|
@@ -10,7 +10,24 @@
|
|
|
10
10
|
// forwarding, multi-site Cache-Control override.
|
|
11
11
|
|
|
12
12
|
import cmsConfig from './cms.config'
|
|
13
|
-
import { createAmplessMiddleware
|
|
13
|
+
import { createAmplessMiddleware } from '@ampless/runtime/middleware'
|
|
14
14
|
|
|
15
15
|
export const proxy = createAmplessMiddleware({ cmsConfig })
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
// Next.js 16's Turbopack requires `config` to be a statically
|
|
18
|
+
// analysable object literal — referencing an imported variable
|
|
19
|
+
// (e.g. `defaultMatcherConfig` from @ampless/runtime/middleware)
|
|
20
|
+
// causes a build error:
|
|
21
|
+
// "Next.js can't recognize the exported `config` field in route.
|
|
22
|
+
// It needs to be a static object."
|
|
23
|
+
//
|
|
24
|
+
// So we inline the matcher here. If you change it, keep it in sync
|
|
25
|
+
// with `defaultMatcherConfig` documented in @ampless/runtime/middleware.
|
|
26
|
+
// The matcher excludes admin / api / login / static assets /
|
|
27
|
+
// amplify_outputs.json so the public-site proxy doesn't rewrite
|
|
28
|
+
// legitimate non-blog routes.
|
|
29
|
+
export const config = {
|
|
30
|
+
matcher: [
|
|
31
|
+
'/((?!admin|api|login|_next/static|_next/image|favicon\\.ico|amplify_outputs\\.json).*)',
|
|
32
|
+
],
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
> English: [README.md](./README.md)
|
|
2
|
+
>
|
|
3
|
+
# Blog テーマ
|
|
4
|
+
|
|
5
|
+
shadcn/ui のデフォルトに準じたニュートラル系モノクロ。時系列の投稿フィード、個別投稿ページ、タグ別一覧を提供します。
|
|
6
|
+
|
|
7
|
+
## カスタマイズ
|
|
8
|
+
|
|
9
|
+
`/admin/sites/<siteId>/theme` で設定:
|
|
10
|
+
|
|
11
|
+
- **プライマリカラー** — ボタン、リンク、強調表示の背景色
|
|
12
|
+
- **アクセントカラー**
|
|
13
|
+
- **フォーカスリング**
|
|
14
|
+
- **破壊的操作** — 削除等の操作色
|
|
15
|
+
- **角丸**
|
|
16
|
+
- **本文フォント** — システムサンセリフ / セリフ (Georgia) / セリフ (Iowan) / 等幅
|
|
17
|
+
- **トップに固定する記事のスラッグ** — 公開済み投稿を 1 件ホームの先頭に固定
|
|
18
|
+
- **ロゴ画像 URL**
|
|
19
|
+
- **ヘッダーナビ** — ラベル + URL のペア
|
|
20
|
+
- **フッターリンク** — ラベル + URL のペア
|
|
21
|
+
|
|
22
|
+
サイトごとのライト/ダークカラースキームは ampless の標準テーマトークン経由で反映されます。
|
|
@@ -1,52 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
# Blog theme
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Neutral monochrome with shadcn/ui defaults. Chronological post feed, single-post page, and tag listing.
|
|
4
6
|
|
|
5
|
-
##
|
|
7
|
+
## Customizing
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
In `/admin/sites/<siteId>/theme`:
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
- **Primary color** — buttons, links, accent fills
|
|
12
|
+
- **Accent color**
|
|
13
|
+
- **Focus ring**
|
|
14
|
+
- **Destructive** — color used for destructive actions
|
|
15
|
+
- **Corner radius**
|
|
16
|
+
- **Body font** — System sans / Serif (Georgia) / Serif (Iowan) / Monospace
|
|
17
|
+
- **Featured post slug** — pin one published post to the top of the home page
|
|
18
|
+
- **Logo image URL**
|
|
19
|
+
- **Header navigation** — label + URL pairs
|
|
20
|
+
- **Footer links** — label + URL pairs
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
# Requires AWS credentials configured (`aws configure`).
|
|
15
|
-
# First run takes ~5–10 min to provision resources.
|
|
16
|
-
# Generates amplify_outputs.json when ready.
|
|
17
|
-
npx ampx sandbox
|
|
18
|
-
|
|
19
|
-
# 3. Start the Next.js dev server (terminal 2)
|
|
20
|
-
npm run dev
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Then open [http://localhost:3000](http://localhost:3000).
|
|
24
|
-
|
|
25
|
-
## First admin user
|
|
26
|
-
|
|
27
|
-
Open [http://localhost:3000/login](http://localhost:3000/login) and click **Create admin account**. The first user to register is automatically added to the `ampless-admin` Cognito group.
|
|
28
|
-
|
|
29
|
-
After that, manage content from `/admin`:
|
|
30
|
-
|
|
31
|
-
- `/admin` — dashboard
|
|
32
|
-
- `/admin/posts` — list / create / edit posts (tiptap editor)
|
|
33
|
-
- `/admin/media` — upload images to S3
|
|
34
|
-
|
|
35
|
-
## Production deploy
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
git init && git add . && git commit -m "init"
|
|
39
|
-
git remote add origin <your-repo>
|
|
40
|
-
git push
|
|
41
|
-
# Then connect the repo to AWS Amplify Hosting in the AWS console.
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Customize
|
|
45
|
-
|
|
46
|
-
- `cms.config.ts` — site name, media delivery mode, plugins
|
|
47
|
-
- `app/` — Next.js App Router pages (`(public)/` for the blog, `(admin)/` for the CMS)
|
|
48
|
-
- `amplify/` — Amplify Gen 2 backend definitions (auth / data / storage)
|
|
49
|
-
|
|
50
|
-
## Plugins
|
|
51
|
-
|
|
52
|
-
Enabled: {{plugins}}
|
|
22
|
+
Per-site light/dark color scheme is honored through the standard ampless theme tokens.
|
|
@@ -7,48 +7,34 @@
|
|
|
7
7
|
* loads, so `:root` selectors trump scoped attribute selectors of
|
|
8
8
|
* equal specificity. The dispatcher emits `--primary` etc. only for
|
|
9
9
|
* fields that have an override, leaving everything else to fall back
|
|
10
|
-
* to these defaults.
|
|
10
|
+
* to these defaults.
|
|
11
|
+
*
|
|
12
|
+
* Dark mode: tokens are declared with the CSS `light-dark(L, D)`
|
|
13
|
+
* function. The active `color-scheme` (set on `:root` and optionally
|
|
14
|
+
* pinned per-site via `html[data-color-scheme]`) selects whether L or
|
|
15
|
+
* D is rendered. `globals.css` opts the document into `color-scheme:
|
|
16
|
+
* light dark` by default — visitors with `prefers-color-scheme: dark`
|
|
17
|
+
* see the dark palette automatically.
|
|
18
|
+
*/
|
|
11
19
|
|
|
12
20
|
[data-theme='blog'] {
|
|
13
|
-
--background: oklch(1 0 0);
|
|
14
|
-
--foreground: oklch(0.145 0 0);
|
|
15
|
-
--card: oklch(1 0 0);
|
|
16
|
-
--card-foreground: oklch(0.145 0 0);
|
|
17
|
-
--primary: oklch(0.205 0 0);
|
|
18
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
19
|
-
--secondary: oklch(0.97 0 0);
|
|
20
|
-
--secondary-foreground: oklch(0.205 0 0);
|
|
21
|
-
--muted: oklch(0.97 0 0);
|
|
22
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
23
|
-
--accent: oklch(0.97 0 0);
|
|
24
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
25
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
26
|
-
--destructive-foreground: oklch(0.985 0 0);
|
|
27
|
-
--border: oklch(0.922 0 0);
|
|
28
|
-
--input: oklch(0.922 0 0);
|
|
29
|
-
--ring: oklch(0.708 0 0);
|
|
21
|
+
--background: light-dark(oklch(1 0 0), oklch(0.145 0 0));
|
|
22
|
+
--foreground: light-dark(oklch(0.145 0 0), oklch(0.985 0 0));
|
|
23
|
+
--card: light-dark(oklch(1 0 0), oklch(0.145 0 0));
|
|
24
|
+
--card-foreground: light-dark(oklch(0.145 0 0), oklch(0.985 0 0));
|
|
25
|
+
--primary: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
26
|
+
--primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.205 0 0));
|
|
27
|
+
--secondary: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
28
|
+
--secondary-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
29
|
+
--muted: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
30
|
+
--muted-foreground: light-dark(oklch(0.556 0 0), oklch(0.708 0 0));
|
|
31
|
+
--accent: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
32
|
+
--accent-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
33
|
+
--destructive: light-dark(oklch(0.577 0.245 27.325), oklch(0.396 0.141 25.723));
|
|
34
|
+
--destructive-foreground: light-dark(oklch(0.985 0 0), oklch(0.985 0 0));
|
|
35
|
+
--border: light-dark(oklch(0.922 0 0), oklch(0.269 0 0));
|
|
36
|
+
--input: light-dark(oklch(0.922 0 0), oklch(0.269 0 0));
|
|
37
|
+
--ring: light-dark(oklch(0.708 0 0), oklch(0.439 0 0));
|
|
30
38
|
--radius: 0.5rem;
|
|
31
39
|
--ampless-body-font: system-ui, -apple-system, sans-serif;
|
|
32
40
|
}
|
|
33
|
-
|
|
34
|
-
@media (prefers-color-scheme: dark) {
|
|
35
|
-
[data-theme='blog'] {
|
|
36
|
-
--background: oklch(0.145 0 0);
|
|
37
|
-
--foreground: oklch(0.985 0 0);
|
|
38
|
-
--card: oklch(0.145 0 0);
|
|
39
|
-
--card-foreground: oklch(0.985 0 0);
|
|
40
|
-
--primary: oklch(0.985 0 0);
|
|
41
|
-
--primary-foreground: oklch(0.205 0 0);
|
|
42
|
-
--secondary: oklch(0.269 0 0);
|
|
43
|
-
--secondary-foreground: oklch(0.985 0 0);
|
|
44
|
-
--muted: oklch(0.269 0 0);
|
|
45
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
46
|
-
--accent: oklch(0.269 0 0);
|
|
47
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
48
|
-
--destructive: oklch(0.396 0.141 25.723);
|
|
49
|
-
--destructive-foreground: oklch(0.985 0 0);
|
|
50
|
-
--border: oklch(0.269 0 0);
|
|
51
|
-
--input: oklch(0.269 0 0);
|
|
52
|
-
--ring: oklch(0.439 0 0);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
> English: [README.md](./README.md)
|
|
2
|
+
>
|
|
3
|
+
# Corporate テーマ
|
|
4
|
+
|
|
5
|
+
企業サイト向けの落ち着いたレイアウト。明るい背景にネイビーの配色、ヒーロー + お知らせ一覧構成、ヘッダー / フッターナビ付き。
|
|
6
|
+
|
|
7
|
+
## カスタマイズ
|
|
8
|
+
|
|
9
|
+
`/admin/sites/<siteId>/theme` で設定:
|
|
10
|
+
|
|
11
|
+
- **タグライン** — ヒーロー内、サイト名の上に表示される短いフレーズ
|
|
12
|
+
- **プライマリカラー**
|
|
13
|
+
- **角丸**
|
|
14
|
+
- **トップストーリーのスラッグ** — ヒーローとお知らせ一覧の間に公開済み投稿を 1 件フィーチャー
|
|
15
|
+
- **ロゴ画像 URL**
|
|
16
|
+
- **ヘッダーナビ** — ラベル + URL のペア
|
|
17
|
+
- **フッターリンク** — ラベル + URL のペア
|
|
18
|
+
- **フッター注記** — 住所 / 会社情報 / 追加の注意書き
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
# Corporate theme
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Conservative business / company-site layout with hero and news section. Navy on near-white, header + footer navigation.
|
|
4
6
|
|
|
5
7
|
## Customizing
|
|
6
8
|
|
|
7
9
|
In `/admin/sites/<siteId>/theme`:
|
|
8
10
|
|
|
9
|
-
- Tagline
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
npm install
|
|
18
|
-
npx ampx sandbox
|
|
19
|
-
npm run dev
|
|
20
|
-
```
|
|
11
|
+
- **Tagline** — short phrase shown above the site name in the hero
|
|
12
|
+
- **Primary color**
|
|
13
|
+
- **Corner radius**
|
|
14
|
+
- **Top story slug** — feature one published post between the hero and the news section
|
|
15
|
+
- **Logo image URL**
|
|
16
|
+
- **Header navigation** — label + URL pairs
|
|
17
|
+
- **Footer links** — label + URL pairs
|
|
18
|
+
- **Footer legend** — address / company info / extra small print
|
|
@@ -3,45 +3,23 @@
|
|
|
3
3
|
* selector pattern as the other themes. */
|
|
4
4
|
|
|
5
5
|
[data-theme='corporate'] {
|
|
6
|
-
--background: oklch(0.99 0 0);
|
|
7
|
-
--foreground: oklch(0.18 0.02 250);
|
|
8
|
-
--card: oklch(1 0 0);
|
|
9
|
-
--card-foreground: oklch(0.18 0.02 250);
|
|
10
|
-
--primary: oklch(0.4 0.13 250);
|
|
11
|
-
--primary-foreground: oklch(0.99 0 0);
|
|
12
|
-
--secondary: oklch(0.95 0.01 250);
|
|
13
|
-
--secondary-foreground: oklch(0.25 0.05 250);
|
|
14
|
-
--muted: oklch(0.96 0.005 250);
|
|
15
|
-
--muted-foreground: oklch(0.5 0.02 250);
|
|
16
|
-
--accent: oklch(0.95 0.02 250);
|
|
17
|
-
--accent-foreground: oklch(0.3 0.08 250);
|
|
18
|
-
--destructive: oklch(0.55 0.22 25);
|
|
19
|
-
--destructive-foreground: oklch(0.99 0 0);
|
|
20
|
-
--border: oklch(0.9 0.005 250);
|
|
21
|
-
--input: oklch(0.9 0.005 250);
|
|
22
|
-
--ring: oklch(0.4 0.13 250);
|
|
6
|
+
--background: light-dark(oklch(0.99 0 0), oklch(0.16 0.02 250));
|
|
7
|
+
--foreground: light-dark(oklch(0.18 0.02 250), oklch(0.96 0.005 250));
|
|
8
|
+
--card: light-dark(oklch(1 0 0), oklch(0.22 0.02 250));
|
|
9
|
+
--card-foreground: light-dark(oklch(0.18 0.02 250), oklch(0.96 0.005 250));
|
|
10
|
+
--primary: light-dark(oklch(0.4 0.13 250), oklch(0.7 0.14 250));
|
|
11
|
+
--primary-foreground: light-dark(oklch(0.99 0 0), oklch(0.16 0.02 250));
|
|
12
|
+
--secondary: light-dark(oklch(0.95 0.01 250), oklch(0.28 0.03 250));
|
|
13
|
+
--secondary-foreground: light-dark(oklch(0.25 0.05 250), oklch(0.96 0.005 250));
|
|
14
|
+
--muted: light-dark(oklch(0.96 0.005 250), oklch(0.26 0.02 250));
|
|
15
|
+
--muted-foreground: light-dark(oklch(0.5 0.02 250), oklch(0.7 0.02 250));
|
|
16
|
+
--accent: light-dark(oklch(0.95 0.02 250), oklch(0.32 0.05 250));
|
|
17
|
+
--accent-foreground: light-dark(oklch(0.3 0.08 250), oklch(0.96 0.005 250));
|
|
18
|
+
--destructive: light-dark(oklch(0.55 0.22 25), oklch(0.55 0.22 25));
|
|
19
|
+
--destructive-foreground: light-dark(oklch(0.99 0 0), oklch(0.99 0 0));
|
|
20
|
+
--border: light-dark(oklch(0.9 0.005 250), oklch(0.32 0.02 250));
|
|
21
|
+
--input: light-dark(oklch(0.9 0.005 250), oklch(0.32 0.02 250));
|
|
22
|
+
--ring: light-dark(oklch(0.4 0.13 250), oklch(0.7 0.14 250));
|
|
23
23
|
--radius: 0.25rem;
|
|
24
24
|
--ampless-body-font: system-ui, -apple-system, sans-serif;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
@media (prefers-color-scheme: dark) {
|
|
28
|
-
[data-theme='corporate'] {
|
|
29
|
-
--background: oklch(0.16 0.02 250);
|
|
30
|
-
--foreground: oklch(0.96 0.005 250);
|
|
31
|
-
--card: oklch(0.22 0.02 250);
|
|
32
|
-
--card-foreground: oklch(0.96 0.005 250);
|
|
33
|
-
--primary: oklch(0.7 0.14 250);
|
|
34
|
-
--primary-foreground: oklch(0.16 0.02 250);
|
|
35
|
-
--secondary: oklch(0.28 0.03 250);
|
|
36
|
-
--secondary-foreground: oklch(0.96 0.005 250);
|
|
37
|
-
--muted: oklch(0.26 0.02 250);
|
|
38
|
-
--muted-foreground: oklch(0.7 0.02 250);
|
|
39
|
-
--accent: oklch(0.32 0.05 250);
|
|
40
|
-
--accent-foreground: oklch(0.96 0.005 250);
|
|
41
|
-
--destructive: oklch(0.55 0.22 25);
|
|
42
|
-
--destructive-foreground: oklch(0.99 0 0);
|
|
43
|
-
--border: oklch(0.32 0.02 250);
|
|
44
|
-
--input: oklch(0.32 0.02 250);
|
|
45
|
-
--ring: oklch(0.7 0.14 250);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
> English: [README.md](./README.md)
|
|
2
|
+
>
|
|
3
|
+
# DADS テーマ
|
|
4
|
+
|
|
5
|
+
デジタル庁デザインシステム準拠のレイアウト。政府・自治体・公共系サイト向け。高コントラスト、アクセシビリティ重視、装飾控えめ。公式の **[デジタル庁デザインシステム Tailwind プラグイン](https://github.com/digital-go-jp/tailwind-theme-plugin)**(`@digital-go-jp/tailwind-theme-plugin`、MIT)をベースに構築されています。
|
|
6
|
+
|
|
7
|
+
## プラグインが提供する機能
|
|
8
|
+
|
|
9
|
+
- **カラーパレット** — プライマリカラーに `solidBlue`(`#0017c1`)を使用し、DADS の全スケール(ライトブルー、シアン、グリーン、ライム、イエロー、オレンジ、レッド、マゼンタ)を Tailwind クラス(`bg-blue-900`、`text-blue-50` など)で利用可能
|
|
10
|
+
- **タイポグラフィ** — プラグイン経由で `fontFamily.sans` に Noto Sans JP を設定。`--ampless-body-font` として参照可能
|
|
11
|
+
- **ボーダー半径** — `rounded-4` / `rounded-6` が利用可能
|
|
12
|
+
|
|
13
|
+
`tokens.css` がプラグインの CSS 変数(`--color-blue-900` など)を ampless 標準のテーマ変数(`--primary`、`--background` など)にバインドするため、共有 chrome(SiteHeader、SiteFooter、shadcn ボタンなど)が自動的に DADS カラーで描画されます。
|
|
14
|
+
|
|
15
|
+
DADS が新しいパレットバージョンを公開した場合、`@digital-go-jp/tailwind-theme-plugin` をバージョンアップするだけでテーマに反映されます。
|
|
16
|
+
|
|
17
|
+
## カスタマイズ
|
|
18
|
+
|
|
19
|
+
`/admin/sites/<siteId>/theme` で設定:
|
|
20
|
+
|
|
21
|
+
- **ロゴ画像 URL** — 組織マーク
|
|
22
|
+
- **プライマリカラー** — デフォルトは DADS の `solidBlue`。DADS 以外の色に変更するとサイトは DADS 準拠ではなくなります。
|
|
23
|
+
- **トップストーリーのスラッグ** — ヒーローとお知らせ一覧の間に公開済み投稿を 1 件フィーチャー
|
|
24
|
+
- **ヘッダーナビ** — ラベル + URL のペア
|
|
25
|
+
- **フッターリンク** — ラベル + URL のペア
|
|
26
|
+
- **フッター注記** — 住所 / 機関情報 / 追加の注意書き
|
|
27
|
+
|
|
28
|
+
## 注意事項
|
|
29
|
+
|
|
30
|
+
- ダークモードは反転色による近似実装です。プラグイン 0.3.4 時点では DADS の公式ダークパレットは存在しません。公式ダークパレットが公開された際は、`tokens.css` のダーク変数バインディングを更新してください。
|
|
31
|
+
- このプラグインはデザイントークンのみを提供します。フル DADS コンポーネント(ボタン、アラート、タブなど)については [design-system-example-components](https://github.com/digital-go-jp/design-system-example-components) を参照し、必要に応じて取り込んでください。
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
# DADS theme
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Government / public-sector layout following the Digital Agency Design System aesthetic. High contrast, accessibility-first, minimal decoration. Built on the official **[Digital Agency Design System Tailwind plugin](https://github.com/digital-go-jp/tailwind-theme-plugin)** (`@digital-go-jp/tailwind-theme-plugin`, MIT).
|
|
4
6
|
|
|
5
7
|
## What's plugin-backed
|
|
6
8
|
|
|
@@ -8,28 +10,22 @@ DADS theme — built on the official **[Digital Agency Design System Tailwind pl
|
|
|
8
10
|
- **Typography** — `fontFamily.sans` set to Noto Sans JP via the plugin; surfaced through `--ampless-body-font`
|
|
9
11
|
- **Border radii** — `rounded-4` / `rounded-6` available
|
|
10
12
|
|
|
11
|
-
`
|
|
13
|
+
`tokens.css` binds the plugin's CSS variables (`--color-blue-900` etc.) to the standard ampless theme variables (`--primary`, `--background`, ...) so all shared chrome (SiteHeader, SiteFooter, shadcn buttons, etc.) automatically renders in DADS colors.
|
|
12
14
|
|
|
13
|
-
When DADS publishes a new palette version, bumping `@digital-go-jp/tailwind-theme-plugin`
|
|
15
|
+
When DADS publishes a new palette version, bumping `@digital-go-jp/tailwind-theme-plugin` is enough — the theme picks it up.
|
|
14
16
|
|
|
15
17
|
## Customizing
|
|
16
18
|
|
|
17
19
|
In `/admin/sites/<siteId>/theme`:
|
|
18
20
|
|
|
19
|
-
- **Logo image URL** —
|
|
20
|
-
- **Primary color** — defaults to DADS solidBlue
|
|
21
|
-
- **Top story slug** — feature one published post between hero and news
|
|
22
|
-
- **Header navigation
|
|
21
|
+
- **Logo image URL** — organization mark
|
|
22
|
+
- **Primary color** — defaults to DADS `solidBlue`. Changing to a non-DADS color makes the site no longer DADS-conformant.
|
|
23
|
+
- **Top story slug** — feature one published post between the hero and the news section
|
|
24
|
+
- **Header navigation** — label + URL pairs
|
|
25
|
+
- **Footer links** — label + URL pairs
|
|
26
|
+
- **Footer legend** — address / agency info / extra small print
|
|
23
27
|
|
|
24
28
|
## Notes
|
|
25
29
|
|
|
26
|
-
- Dark mode uses an inverted approximation. DADS doesn't ship an official dark palette as of plugin 0.3.4; when one lands, update `
|
|
30
|
+
- Dark mode uses an inverted approximation. DADS doesn't ship an official dark palette as of plugin 0.3.4; when one lands, update `tokens.css` to bind the dark variables.
|
|
27
31
|
- The plugin only provides design tokens. For full DADS components (buttons, alerts, tabs, etc.), see [design-system-example-components](https://github.com/digital-go-jp/design-system-example-components) and adapt as needed.
|
|
28
|
-
|
|
29
|
-
## Getting started
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install
|
|
33
|
-
npx ampx sandbox
|
|
34
|
-
npm run dev
|
|
35
|
-
```
|
|
@@ -13,26 +13,31 @@
|
|
|
13
13
|
* enough; we don't hardcode hex values here. The fallbacks after
|
|
14
14
|
* each `var(...)` are the DADS values from version 0.3.4 in case
|
|
15
15
|
* the plugin isn't loaded for some reason.
|
|
16
|
+
*
|
|
17
|
+
* Dark mode: DADS doesn't ship an official dark palette as of v0.3.4,
|
|
18
|
+
* so the D side of `light-dark()` here is an inverted approximation.
|
|
19
|
+
* When DADS adds a dark variant, bind the D arg to the corresponding
|
|
20
|
+
* plugin variables (e.g. `var(--color-blue-300)` for primary).
|
|
16
21
|
*/
|
|
17
22
|
|
|
18
23
|
[data-theme='dads'] {
|
|
19
|
-
--background: #ffffff;
|
|
20
|
-
--foreground: #1a1a1c;
|
|
21
|
-
--card: #ffffff;
|
|
22
|
-
--card-foreground: #1a1a1c;
|
|
23
|
-
--primary: var(--color-blue-900, #0017c1);
|
|
24
|
-
--primary-foreground: #ffffff;
|
|
25
|
-
--secondary: var(--color-blue-50, #e8f1fe);
|
|
26
|
-
--secondary-foreground: var(--color-blue-900, #0017c1);
|
|
27
|
-
--muted: #f5f5f5;
|
|
28
|
-
--muted-foreground: #595959;
|
|
29
|
-
--accent: var(--color-blue-50, #e8f1fe);
|
|
30
|
-
--accent-foreground: var(--color-blue-900, #0017c1);
|
|
31
|
-
--destructive: var(--color-red-900, #ce0000);
|
|
32
|
-
--destructive-foreground: #ffffff;
|
|
33
|
-
--border: #d9d9d9;
|
|
34
|
-
--input: #d9d9d9;
|
|
35
|
-
--ring: var(--color-blue-900, #0017c1);
|
|
24
|
+
--background: light-dark(#ffffff, #1a1a1c);
|
|
25
|
+
--foreground: light-dark(#1a1a1c, #f0f0f0);
|
|
26
|
+
--card: light-dark(#ffffff, #232327);
|
|
27
|
+
--card-foreground: light-dark(#1a1a1c, #f0f0f0);
|
|
28
|
+
--primary: light-dark(var(--color-blue-900, #0017c1), var(--color-blue-300, #9db7f9));
|
|
29
|
+
--primary-foreground: light-dark(#ffffff, #1a1a1c);
|
|
30
|
+
--secondary: light-dark(var(--color-blue-50, #e8f1fe), #2c2f3a);
|
|
31
|
+
--secondary-foreground: light-dark(var(--color-blue-900, #0017c1), #f0f0f0);
|
|
32
|
+
--muted: light-dark(#f5f5f5, #28282c);
|
|
33
|
+
--muted-foreground: light-dark(#595959, #b3b3b3);
|
|
34
|
+
--accent: light-dark(var(--color-blue-50, #e8f1fe), #2c2f3a);
|
|
35
|
+
--accent-foreground: light-dark(var(--color-blue-900, #0017c1), #f0f0f0);
|
|
36
|
+
--destructive: light-dark(var(--color-red-900, #ce0000), var(--color-red-700, #fa0000));
|
|
37
|
+
--destructive-foreground: light-dark(#ffffff, #ffffff);
|
|
38
|
+
--border: light-dark(#d9d9d9, #3a3a3f);
|
|
39
|
+
--input: light-dark(#d9d9d9, #3a3a3f);
|
|
40
|
+
--ring: light-dark(var(--color-blue-900, #0017c1), var(--color-blue-300, #9db7f9));
|
|
36
41
|
--radius: 0.25rem;
|
|
37
42
|
/* DADS recommends Noto Sans JP for body text. The plugin sets
|
|
38
43
|
* fontFamily.sans to it; we surface that through our usual
|
|
@@ -40,28 +45,3 @@
|
|
|
40
45
|
* up consistently. */
|
|
41
46
|
--ampless-body-font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
42
47
|
}
|
|
43
|
-
|
|
44
|
-
@media (prefers-color-scheme: dark) {
|
|
45
|
-
[data-theme='dads'] {
|
|
46
|
-
/* DADS doesn't ship an official dark palette as of v0.3.4; this
|
|
47
|
-
* is an inverted approximation. When DADS adds a dark variant,
|
|
48
|
-
* bind these to the corresponding plugin variables. */
|
|
49
|
-
--background: #1a1a1c;
|
|
50
|
-
--foreground: #f0f0f0;
|
|
51
|
-
--card: #232327;
|
|
52
|
-
--card-foreground: #f0f0f0;
|
|
53
|
-
--primary: var(--color-blue-300, #9db7f9);
|
|
54
|
-
--primary-foreground: #1a1a1c;
|
|
55
|
-
--secondary: #2c2f3a;
|
|
56
|
-
--secondary-foreground: #f0f0f0;
|
|
57
|
-
--muted: #28282c;
|
|
58
|
-
--muted-foreground: #b3b3b3;
|
|
59
|
-
--accent: #2c2f3a;
|
|
60
|
-
--accent-foreground: #f0f0f0;
|
|
61
|
-
--destructive: var(--color-red-700, #fa0000);
|
|
62
|
-
--destructive-foreground: #ffffff;
|
|
63
|
-
--border: #3a3a3f;
|
|
64
|
-
--input: #3a3a3f;
|
|
65
|
-
--ring: var(--color-blue-300, #9db7f9);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
> English: [README.md](./README.md)
|
|
2
|
+
>
|
|
3
|
+
# Docs テーマ
|
|
4
|
+
|
|
5
|
+
サイドバー主導のドキュメントレイアウト。サイドバー項目は通常のリンクに加え、**タグ駆動セクション**を組み合わせられます — `tag:<name>` 形式の項目を入れると、そのタグが付いた公開済み投稿の一覧に自動展開されます。タグでコンテンツを整理するだけでナビゲーションに自動反映されます。
|
|
6
|
+
|
|
7
|
+
## カスタマイズ
|
|
8
|
+
|
|
9
|
+
`/admin/sites/<siteId>/theme` で設定:
|
|
10
|
+
|
|
11
|
+
- **プライマリカラー**
|
|
12
|
+
- **角丸**
|
|
13
|
+
- **コードフォント** — システム等幅 / JetBrains Mono
|
|
14
|
+
- **サイドバーナビ** — 各行は `ラベル` + `URL`。URL には以下を指定可能:
|
|
15
|
+
- パス(`/getting-started`)
|
|
16
|
+
- 外部 URL(`https://...`)
|
|
17
|
+
- タグ参照(`tag:tutorials`)→ 見出し + タグ付き投稿一覧として描画
|
|
18
|
+
- **ロゴ画像 URL**
|
|
19
|
+
- **ヘッダーナビ** — トップレベルのリンク
|
|
20
|
+
- **フッターリンク** — ラベル + URL のペア
|
|
21
|
+
|
|
22
|
+
## 執筆のヒント
|
|
23
|
+
|
|
24
|
+
投稿に `guide` タグを付けて、サイドバーに URL `tag:guide` の行を追加するだけ。新しい記事を公開しても手動でリンクを編集する必要はなく、サイドバーに自動で並びます。
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
> 日本語版: [README.ja.md](./README.ja.md)
|
|
2
|
+
>
|
|
3
|
+
# Docs theme
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Sidebar-led documentation layout. The sidebar combines plain links with **tag-driven sections** — a sidebar entry of the form `tag:<name>` auto-expands into a list of every published post with that tag. Lets writers organize content by tag and have it appear in nav automatically.
|
|
4
6
|
|
|
5
7
|
## Customizing
|
|
6
8
|
|
|
7
9
|
In `/admin/sites/<siteId>/theme`:
|
|
8
10
|
|
|
11
|
+
- **Primary color**
|
|
12
|
+
- **Corner radius**
|
|
13
|
+
- **Code font** — System monospace / JetBrains Mono
|
|
9
14
|
- **Sidebar navigation** — each row is `Label` + `URL`. The URL can be:
|
|
10
15
|
- a path (`/getting-started`)
|
|
11
16
|
- an external URL (`https://...`)
|
|
12
17
|
- a tag reference (`tag:tutorials`) → renders as a heading + list of tagged posts
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
18
|
+
- **Logo image URL**
|
|
19
|
+
- **Header navigation** — top-level links
|
|
20
|
+
- **Footer links** — label + URL pairs
|
|
16
21
|
|
|
17
22
|
## Authoring tip
|
|
18
23
|
|
|
19
24
|
Tag a post `guide` (in the post editor) and add a sidebar row with URL `tag:guide`. The sidebar will list that post automatically — no manual link editing every time you publish.
|
|
20
|
-
|
|
21
|
-
## Getting started
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm install
|
|
25
|
-
npx ampx sandbox
|
|
26
|
-
npm run dev
|
|
27
|
-
```
|