create-ampless 1.0.0-alpha.57 → 1.0.0-alpha.59

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.
Files changed (63) hide show
  1. package/dist/index.js +1 -10
  2. package/dist/templates/_shared/AGENTS.ja.md +16 -26
  3. package/dist/templates/_shared/AGENTS.md +16 -26
  4. package/dist/templates/_shared/README.ja.md +29 -3
  5. package/dist/templates/_shared/README.md +29 -3
  6. package/dist/templates/_shared/THEMES.ja.md +495 -0
  7. package/dist/templates/_shared/THEMES.md +523 -0
  8. package/dist/templates/_shared/app/layout.tsx +8 -8
  9. package/dist/templates/_shared/app/providers.tsx +0 -2
  10. package/dist/templates/_shared/components/site-chrome/site-sidebar.tsx +2 -2
  11. package/dist/templates/_shared/components.json +1 -1
  12. package/dist/templates/_shared/lib/admin.ts +4 -6
  13. package/dist/templates/_shared/lib/ampless.ts +2 -8
  14. package/dist/templates/_shared/lib/amplify.ts +0 -5
  15. package/dist/templates/_shared/package.json +2 -2
  16. package/dist/templates/blog/pages/feed.ts +2 -2
  17. package/dist/templates/blog/pages/home.tsx +8 -10
  18. package/dist/templates/blog/pages/post.tsx +9 -12
  19. package/dist/templates/blog/pages/sitemap.ts +2 -2
  20. package/dist/templates/blog/pages/tag.tsx +7 -9
  21. package/dist/templates/corporate/pages/feed.ts +2 -2
  22. package/dist/templates/corporate/pages/home.tsx +6 -8
  23. package/dist/templates/corporate/pages/post.tsx +9 -12
  24. package/dist/templates/corporate/pages/sitemap.ts +2 -2
  25. package/dist/templates/corporate/pages/tag.tsx +7 -9
  26. package/dist/templates/dads/pages/feed.ts +2 -2
  27. package/dist/templates/dads/pages/home.tsx +6 -8
  28. package/dist/templates/dads/pages/post.tsx +9 -12
  29. package/dist/templates/dads/pages/sitemap.ts +2 -2
  30. package/dist/templates/dads/pages/tag.tsx +7 -9
  31. package/dist/templates/docs/pages/feed.ts +2 -2
  32. package/dist/templates/docs/pages/home.tsx +4 -6
  33. package/dist/templates/docs/pages/post.tsx +7 -10
  34. package/dist/templates/docs/pages/sitemap.ts +2 -2
  35. package/dist/templates/docs/pages/tag.tsx +6 -8
  36. package/dist/templates/landing/pages/feed.ts +2 -2
  37. package/dist/templates/landing/pages/home.tsx +6 -8
  38. package/dist/templates/landing/pages/post.tsx +9 -12
  39. package/dist/templates/landing/pages/sitemap.ts +2 -2
  40. package/dist/templates/landing/pages/tag.tsx +7 -9
  41. package/dist/templates/minimal/pages/feed.ts +2 -2
  42. package/dist/templates/minimal/pages/home.tsx +5 -6
  43. package/dist/templates/minimal/pages/post.tsx +8 -10
  44. package/dist/templates/minimal/pages/sitemap.ts +2 -2
  45. package/dist/templates/minimal/pages/tag.tsx +6 -7
  46. package/package.json +1 -1
  47. package/dist/templates/_shared/components/i18n-provider.tsx +0 -15
  48. package/dist/templates/_shared/lib/amplify-server.ts +0 -7
  49. package/dist/templates/_shared/lib/auth-server.ts +0 -15
  50. package/dist/templates/_shared/lib/cn.ts +0 -5
  51. package/dist/templates/_shared/lib/i18n.ts +0 -35
  52. package/dist/templates/_shared/lib/kv-provider.ts +0 -8
  53. package/dist/templates/_shared/lib/media.ts +0 -6
  54. package/dist/templates/_shared/lib/posts-provider.ts +0 -8
  55. package/dist/templates/_shared/lib/posts-public.ts +0 -27
  56. package/dist/templates/_shared/lib/posts.ts +0 -12
  57. package/dist/templates/_shared/lib/seo.ts +0 -11
  58. package/dist/templates/_shared/lib/site-settings.ts +0 -11
  59. package/dist/templates/_shared/lib/storage.ts +0 -10
  60. package/dist/templates/_shared/lib/theme-actions.ts +0 -5
  61. package/dist/templates/_shared/lib/theme-active.ts +0 -10
  62. package/dist/templates/_shared/lib/theme-config.ts +0 -12
  63. package/dist/templates/_shared/lib/upload.ts +0 -6
@@ -1,26 +1,24 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, parseLinkList, type ThemeRouteContext } from 'ampless'
3
- import { listPublishedPosts, getPublishedPost } from '@/lib/posts-public'
4
- import { loadSiteSettings } from '@/lib/site-settings'
5
- import { loadThemeConfig } from '@/lib/theme-config'
6
- import { renderBody } from '@/lib/posts'
3
+ import { renderBody } from '@ampless/runtime'
4
+ import { ampless } from '@/lib/ampless'
5
+ import { admin } from '@/lib/admin'
7
6
  import { TagList } from '@/components/tag-list'
8
7
  import { SiteHeader } from '@/components/site-chrome/site-header'
9
8
  import { SiteFooter } from '@/components/site-chrome/site-footer'
10
- import { t } from '@/lib/i18n'
11
9
 
12
10
  export default async function BlogHome(_: ThemeRouteContext) {
13
11
  const [settings, theme, postsResult] = await Promise.all([
14
- loadSiteSettings(),
15
- loadThemeConfig(),
16
- listPublishedPosts(),
12
+ ampless.loadSiteSettings(),
13
+ ampless.loadThemeConfig(),
14
+ ampless.listPublishedPosts(),
17
15
  ])
18
16
 
19
17
  // Featured (pinned) post: render the body inline above the list,
20
18
  // then drop the same slug from the feed so it doesn't show twice.
21
19
  // Missing / unpublished slugs return null and the section is skipped.
22
20
  const featuredSlug = theme.values.featuredSlug?.trim()
23
- const featured = featuredSlug ? await getPublishedPost(featuredSlug) : null
21
+ const featured = featuredSlug ? await ampless.getPublishedPost(featuredSlug) : null
24
22
  const posts = featured
25
23
  ? postsResult.items.filter((p) => p.slug !== featured.slug)
26
24
  : postsResult.items
@@ -69,7 +67,7 @@ export default async function BlogHome(_: ThemeRouteContext) {
69
67
  )}
70
68
 
71
69
  {posts.length === 0 ? (
72
- !featured && <p className="text-gray-500">{t('public.noPosts')}</p>
70
+ !featured && <p className="text-gray-500">{admin.t('public.noPosts')}</p>
73
71
  ) : (
74
72
  <ul className="space-y-8">
75
73
  {posts.map((post) => (
@@ -2,32 +2,29 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, parseLinkList, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@/lib/posts'
5
+ import { renderBody } from '@ampless/runtime'
6
+ import { ampless } from '@/lib/ampless'
7
+ import { admin } from '@/lib/admin'
6
8
  import { LightboxBinder } from '@/components/lightbox-content'
7
9
  import { TagList } from '@/components/tag-list'
8
- import { postMetadata } from '@/lib/seo'
9
- import { loadSiteSettings } from '@/lib/site-settings'
10
- import { loadThemeConfig } from '@/lib/theme-config'
11
- import { getPublishedPost } from '@/lib/posts-public'
12
10
  import { SiteHeader } from '@/components/site-chrome/site-header'
13
11
  import { SiteFooter } from '@/components/site-chrome/site-footer'
14
- import { t } from '@/lib/i18n'
15
12
 
16
13
  type PostCtx = ThemeRouteContext<{ slug: string }>
17
14
 
18
15
  export async function generatePostMetadata({ params }: PostCtx): Promise<Metadata> {
19
16
  const { slug } = await params
20
- const post = await getPublishedPost(slug)
17
+ const post = await ampless.getPublishedPost(slug)
21
18
  if (!post) return {}
22
- return postMetadata(post)
19
+ return ampless.postMetadata(post)
23
20
  }
24
21
 
25
22
  export default async function BlogPost({ params }: PostCtx) {
26
23
  const { slug } = await params
27
24
  const [post, settings, theme] = await Promise.all([
28
- getPublishedPost(slug),
29
- loadSiteSettings(),
30
- loadThemeConfig(),
25
+ ampless.getPublishedPost(slug),
26
+ ampless.loadSiteSettings(),
27
+ ampless.loadThemeConfig(),
31
28
  ])
32
29
  if (!post) notFound()
33
30
 
@@ -53,7 +50,7 @@ export default async function BlogPost({ params }: PostCtx) {
53
50
 
54
51
  <main className="mx-auto max-w-2xl px-6 py-12">
55
52
  <nav className="mb-8">
56
- <Link href="/" className="text-sm text-gray-500 hover:underline">{t('public.back')}</Link>
53
+ <Link href="/" className="text-sm text-gray-500 hover:underline">{admin.t('public.back')}</Link>
57
54
  </nav>
58
55
 
59
56
  <article>
@@ -1,4 +1,4 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
@@ -7,7 +7,7 @@ interface Ctx {
7
7
  // /sitemap.xml proxy — plugin-seo regenerates the sitemap on every
8
8
  // content event and writes it to `public/plugins/seo/sitemap.xml`.
9
9
  export async function blogSitemapHandler(_ctx: Ctx): Promise<Response> {
10
- const url = publicAssetUrl('public/plugins/seo/sitemap.xml')
10
+ const url = ampless.publicAssetUrl('public/plugins/seo/sitemap.xml')
11
11
  const upstream = await fetch(url, { cache: 'no-store' })
12
12
  if (!upstream.ok) {
13
13
  return new Response(
@@ -1,20 +1,18 @@
1
1
  import Link from 'next/link'
2
2
  import { notFound } from 'next/navigation'
3
3
  import { formatDate, parseLinkList, type ThemeRouteContext } from 'ampless'
4
- import { listPostsByTag } from '@/lib/posts-public'
5
- import { loadSiteSettings } from '@/lib/site-settings'
6
- import { loadThemeConfig } from '@/lib/theme-config'
4
+ import { ampless } from '@/lib/ampless'
5
+ import { admin } from '@/lib/admin'
7
6
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
7
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
- import { t } from '@/lib/i18n'
10
8
 
11
9
  export default async function BlogTag({ params }: ThemeRouteContext<{ tag: string }>) {
12
10
  const { tag } = await params
13
11
  const decodedTag = decodeURIComponent(tag)
14
12
  const [{ items: posts }, settings, theme] = await Promise.all([
15
- listPostsByTag(decodedTag, { limit: 50 }),
16
- loadSiteSettings(),
17
- loadThemeConfig(),
13
+ ampless.listPostsByTag(decodedTag, { limit: 50 }),
14
+ ampless.loadSiteSettings(),
15
+ ampless.loadThemeConfig(),
18
16
  ])
19
17
 
20
18
  if (posts.length === 0) notFound()
@@ -36,11 +34,11 @@ export default async function BlogTag({ params }: ThemeRouteContext<{ tag: strin
36
34
 
37
35
  <main className="mx-auto max-w-2xl px-6 py-12">
38
36
  <nav className="mb-8">
39
- <Link href="/" className="text-sm text-gray-500 hover:underline">{t('public.home')}</Link>
37
+ <Link href="/" className="text-sm text-gray-500 hover:underline">{admin.t('public.home')}</Link>
40
38
  </nav>
41
39
 
42
40
  <header className="mb-12 border-b pb-6">
43
- <p className="text-sm text-gray-500">{t('public.tagLabel')}</p>
41
+ <p className="text-sm text-gray-500">{admin.t('public.tagLabel')}</p>
44
42
  <h1 className="text-4xl font-bold tracking-tight">#{decodedTag}</h1>
45
43
  </header>
46
44
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function corporateFeedHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/rss/feed.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/rss/feed.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,23 +1,21 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { listPublishedPosts, getPublishedPost } from '@/lib/posts-public'
4
- import { loadSiteSettings } from '@/lib/site-settings'
5
- import { loadThemeConfig } from '@/lib/theme-config'
6
- import { renderBody } from '@/lib/posts'
3
+ import { renderBody } from '@ampless/runtime'
4
+ import { ampless } from '@/lib/ampless'
7
5
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
6
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
7
 
10
8
  export default async function CorporateHome(_: ThemeRouteContext) {
11
9
  const [settings, theme, postsResult] = await Promise.all([
12
- loadSiteSettings(),
13
- loadThemeConfig(),
14
- listPublishedPosts({ limit: 8 }),
10
+ ampless.loadSiteSettings(),
11
+ ampless.loadThemeConfig(),
12
+ ampless.listPublishedPosts({ limit: 8 }),
15
13
  ])
16
14
 
17
15
  // Top-story embed between hero and news. Filtered out of news to
18
16
  // avoid duplication. Skipped silently if missing / unpublished.
19
17
  const featuredSlug = theme.values.featuredSlug?.trim()
20
- const featured = featuredSlug ? await getPublishedPost(featuredSlug) : null
18
+ const featured = featuredSlug ? await ampless.getPublishedPost(featuredSlug) : null
21
19
  const posts = featured
22
20
  ? postsResult.items.filter((p) => p.slug !== featured.slug)
23
21
  : postsResult.items
@@ -2,32 +2,29 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@/lib/posts'
5
+ import { renderBody } from '@ampless/runtime'
6
+ import { ampless } from '@/lib/ampless'
7
+ import { admin } from '@/lib/admin'
6
8
  import { LightboxBinder } from '@/components/lightbox-content'
7
9
  import { TagList } from '@/components/tag-list'
8
- import { postMetadata } from '@/lib/seo'
9
- import { loadSiteSettings } from '@/lib/site-settings'
10
- import { loadThemeConfig } from '@/lib/theme-config'
11
- import { getPublishedPost } from '@/lib/posts-public'
12
10
  import { SiteHeader } from '@/components/site-chrome/site-header'
13
11
  import { SiteFooter } from '@/components/site-chrome/site-footer'
14
- import { t } from '@/lib/i18n'
15
12
 
16
13
  type PostCtx = ThemeRouteContext<{ slug: string }>
17
14
 
18
15
  export async function generatePostMetadata({ params }: PostCtx): Promise<Metadata> {
19
16
  const { slug } = await params
20
- const post = await getPublishedPost(slug)
17
+ const post = await ampless.getPublishedPost(slug)
21
18
  if (!post) return {}
22
- return postMetadata(post)
19
+ return ampless.postMetadata(post)
23
20
  }
24
21
 
25
22
  export default async function CorporatePost({ params }: PostCtx) {
26
23
  const { slug } = await params
27
24
  const [post, settings, theme] = await Promise.all([
28
- getPublishedPost(slug),
29
- loadSiteSettings(),
30
- loadThemeConfig(),
25
+ ampless.getPublishedPost(slug),
26
+ ampless.loadSiteSettings(),
27
+ ampless.loadThemeConfig(),
31
28
  ])
32
29
  if (!post) notFound()
33
30
 
@@ -50,7 +47,7 @@ export default async function CorporatePost({ params }: PostCtx) {
50
47
  <main className="mx-auto max-w-3xl px-6 py-12">
51
48
  <nav className="mb-6">
52
49
  <Link href="/" className="text-sm text-[var(--muted-foreground)] hover:text-[var(--primary)]">
53
- {t('public.back')}
50
+ {admin.t('public.back')}
54
51
  </Link>
55
52
  </nav>
56
53
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function corporateSitemapHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/seo/sitemap.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/seo/sitemap.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,20 +1,18 @@
1
1
  import Link from 'next/link'
2
2
  import { notFound } from 'next/navigation'
3
3
  import { formatDate, type ThemeRouteContext } from 'ampless'
4
- import { listPostsByTag } from '@/lib/posts-public'
5
- import { loadSiteSettings } from '@/lib/site-settings'
6
- import { loadThemeConfig } from '@/lib/theme-config'
4
+ import { ampless } from '@/lib/ampless'
5
+ import { admin } from '@/lib/admin'
7
6
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
7
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
- import { t } from '@/lib/i18n'
10
8
 
11
9
  export default async function CorporateTag({ params }: ThemeRouteContext<{ tag: string }>) {
12
10
  const { tag } = await params
13
11
  const decodedTag = decodeURIComponent(tag)
14
12
  const [{ items: posts }, settings, theme] = await Promise.all([
15
- listPostsByTag(decodedTag, { limit: 50 }),
16
- loadSiteSettings(),
17
- loadThemeConfig(),
13
+ ampless.listPostsByTag(decodedTag, { limit: 50 }),
14
+ ampless.loadSiteSettings(),
15
+ ampless.loadThemeConfig(),
18
16
  ])
19
17
  if (posts.length === 0) notFound()
20
18
 
@@ -32,12 +30,12 @@ export default async function CorporateTag({ params }: ThemeRouteContext<{ tag:
32
30
  <main className="mx-auto max-w-4xl px-6 py-12">
33
31
  <nav className="mb-6">
34
32
  <Link href="/" className="text-sm text-[var(--muted-foreground)] hover:text-[var(--primary)]">
35
- {t('public.home')}
33
+ {admin.t('public.home')}
36
34
  </Link>
37
35
  </nav>
38
36
 
39
37
  <header className="mb-10">
40
- <p className="text-sm text-[var(--muted-foreground)]">{t('public.tagLabel')}</p>
38
+ <p className="text-sm text-[var(--muted-foreground)]">{admin.t('public.tagLabel')}</p>
41
39
  <h1 className="text-3xl font-bold tracking-tight">#{decodedTag}</h1>
42
40
  </header>
43
41
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function dadsFeedHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/rss/feed.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/rss/feed.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,9 +1,7 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { listPublishedPosts, getPublishedPost } from '@/lib/posts-public'
4
- import { loadSiteSettings } from '@/lib/site-settings'
5
- import { loadThemeConfig } from '@/lib/theme-config'
6
- import { renderBody } from '@/lib/posts'
3
+ import { renderBody } from '@ampless/runtime'
4
+ import { ampless } from '@/lib/ampless'
7
5
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
6
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
7
 
@@ -13,13 +11,13 @@ import { SiteFooter } from '@/components/site-chrome/site-footer'
13
11
  // decoration.
14
12
  export default async function DadsHome(_: ThemeRouteContext) {
15
13
  const [settings, theme, postsResult] = await Promise.all([
16
- loadSiteSettings(),
17
- loadThemeConfig(),
18
- listPublishedPosts({ limit: 10 }),
14
+ ampless.loadSiteSettings(),
15
+ ampless.loadThemeConfig(),
16
+ ampless.listPublishedPosts({ limit: 10 }),
19
17
  ])
20
18
 
21
19
  const featuredSlug = theme.values.featuredSlug?.trim()
22
- const featured = featuredSlug ? await getPublishedPost(featuredSlug) : null
20
+ const featured = featuredSlug ? await ampless.getPublishedPost(featuredSlug) : null
23
21
  const posts = featured
24
22
  ? postsResult.items.filter((p) => p.slug !== featured.slug)
25
23
  : postsResult.items
@@ -2,32 +2,29 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@/lib/posts'
5
+ import { renderBody } from '@ampless/runtime'
6
+ import { ampless } from '@/lib/ampless'
7
+ import { admin } from '@/lib/admin'
6
8
  import { LightboxBinder } from '@/components/lightbox-content'
7
9
  import { TagList } from '@/components/tag-list'
8
- import { postMetadata } from '@/lib/seo'
9
- import { loadSiteSettings } from '@/lib/site-settings'
10
- import { loadThemeConfig } from '@/lib/theme-config'
11
- import { getPublishedPost } from '@/lib/posts-public'
12
10
  import { SiteHeader } from '@/components/site-chrome/site-header'
13
11
  import { SiteFooter } from '@/components/site-chrome/site-footer'
14
- import { t } from '@/lib/i18n'
15
12
 
16
13
  type PostCtx = ThemeRouteContext<{ slug: string }>
17
14
 
18
15
  export async function generatePostMetadata({ params }: PostCtx): Promise<Metadata> {
19
16
  const { slug } = await params
20
- const post = await getPublishedPost(slug)
17
+ const post = await ampless.getPublishedPost(slug)
21
18
  if (!post) return {}
22
- return postMetadata(post)
19
+ return ampless.postMetadata(post)
23
20
  }
24
21
 
25
22
  export default async function DadsPost({ params }: PostCtx) {
26
23
  const { slug } = await params
27
24
  const [post, settings, theme] = await Promise.all([
28
- getPublishedPost(slug),
29
- loadSiteSettings(),
30
- loadThemeConfig(),
25
+ ampless.getPublishedPost(slug),
26
+ ampless.loadSiteSettings(),
27
+ ampless.loadThemeConfig(),
31
28
  ])
32
29
  if (!post) notFound()
33
30
 
@@ -54,7 +51,7 @@ export default async function DadsPost({ params }: PostCtx) {
54
51
  href="/"
55
52
  className="text-[var(--primary)] underline-offset-4 hover:underline"
56
53
  >
57
- {t('public.back')}
54
+ {admin.t('public.back')}
58
55
  </Link>
59
56
  </nav>
60
57
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function dadsSitemapHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/seo/sitemap.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/seo/sitemap.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,20 +1,18 @@
1
1
  import Link from 'next/link'
2
2
  import { notFound } from 'next/navigation'
3
3
  import { formatDate, type ThemeRouteContext } from 'ampless'
4
- import { listPostsByTag } from '@/lib/posts-public'
5
- import { loadSiteSettings } from '@/lib/site-settings'
6
- import { loadThemeConfig } from '@/lib/theme-config'
4
+ import { ampless } from '@/lib/ampless'
5
+ import { admin } from '@/lib/admin'
7
6
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
7
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
- import { t } from '@/lib/i18n'
10
8
 
11
9
  export default async function DadsTag({ params }: ThemeRouteContext<{ tag: string }>) {
12
10
  const { tag } = await params
13
11
  const decodedTag = decodeURIComponent(tag)
14
12
  const [{ items: posts }, settings, theme] = await Promise.all([
15
- listPostsByTag(decodedTag, { limit: 50 }),
16
- loadSiteSettings(),
17
- loadThemeConfig(),
13
+ ampless.listPostsByTag(decodedTag, { limit: 50 }),
14
+ ampless.loadSiteSettings(),
15
+ ampless.loadThemeConfig(),
18
16
  ])
19
17
  if (posts.length === 0) notFound()
20
18
 
@@ -36,12 +34,12 @@ export default async function DadsTag({ params }: ThemeRouteContext<{ tag: strin
36
34
  href="/"
37
35
  className="text-[var(--primary)] underline-offset-4 hover:underline"
38
36
  >
39
- {t('public.home')}
37
+ {admin.t('public.home')}
40
38
  </Link>
41
39
  </nav>
42
40
 
43
41
  <header className="mb-10">
44
- <p className="text-sm text-[var(--muted-foreground)]">{t('public.tagLabel')}</p>
42
+ <p className="text-sm text-[var(--muted-foreground)]">{admin.t('public.tagLabel')}</p>
45
43
  <h1 className="text-3xl font-bold tracking-tight">#{decodedTag}</h1>
46
44
  </header>
47
45
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function docsFeedHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/rss/feed.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/rss/feed.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,8 +1,6 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { listPublishedPosts } from '@/lib/posts-public'
4
- import { loadSiteSettings } from '@/lib/site-settings'
5
- import { loadThemeConfig } from '@/lib/theme-config'
3
+ import { ampless } from '@/lib/ampless'
6
4
  import { SiteHeader } from '@/components/site-chrome/site-header'
7
5
  import { SiteSidebar } from '@/components/site-chrome/site-sidebar'
8
6
  import { SiteFooter } from '@/components/site-chrome/site-footer'
@@ -13,9 +11,9 @@ import { CollapsibleSidebar } from '@/components/site-chrome/collapsible-sidebar
13
11
  // page until the user arranges static pages.
14
12
  export default async function DocsHome(_: ThemeRouteContext) {
15
13
  const [settings, theme, postsResult] = await Promise.all([
16
- loadSiteSettings(),
17
- loadThemeConfig(),
18
- listPublishedPosts({ limit: 12 }),
14
+ ampless.loadSiteSettings(),
15
+ ampless.loadThemeConfig(),
16
+ ampless.listPublishedPosts({ limit: 12 }),
19
17
  ])
20
18
  const posts = postsResult.items
21
19
 
@@ -2,13 +2,10 @@ import type { Metadata } from 'next'
2
2
  import Link from 'next/link'
3
3
  import { notFound } from 'next/navigation'
4
4
  import { formatDate, type ThemeRouteContext } from 'ampless'
5
- import { renderBody } from '@/lib/posts'
5
+ import { renderBody } from '@ampless/runtime'
6
+ import { ampless } from '@/lib/ampless'
6
7
  import { LightboxBinder } from '@/components/lightbox-content'
7
8
  import { TagList } from '@/components/tag-list'
8
- import { postMetadata } from '@/lib/seo'
9
- import { loadSiteSettings } from '@/lib/site-settings'
10
- import { loadThemeConfig } from '@/lib/theme-config'
11
- import { getPublishedPost } from '@/lib/posts-public'
12
9
  import { SiteHeader } from '@/components/site-chrome/site-header'
13
10
  import { SiteSidebar } from '@/components/site-chrome/site-sidebar'
14
11
  import { SiteFooter } from '@/components/site-chrome/site-footer'
@@ -18,9 +15,9 @@ type PostCtx = ThemeRouteContext<{ slug: string }>
18
15
 
19
16
  export async function generatePostMetadata({ params }: PostCtx): Promise<Metadata> {
20
17
  const { slug } = await params
21
- const post = await getPublishedPost(slug)
18
+ const post = await ampless.getPublishedPost(slug)
22
19
  if (!post) return {}
23
- return postMetadata(post)
20
+ return ampless.postMetadata(post)
24
21
  }
25
22
 
26
23
  // Docs post page: sidebar always visible while reading. The sidebar
@@ -29,9 +26,9 @@ export async function generatePostMetadata({ params }: PostCtx): Promise<Metadat
29
26
  export default async function DocsPost({ params }: PostCtx) {
30
27
  const { slug } = await params
31
28
  const [post, settings, theme] = await Promise.all([
32
- getPublishedPost(slug),
33
- loadSiteSettings(),
34
- loadThemeConfig(),
29
+ ampless.getPublishedPost(slug),
30
+ ampless.loadSiteSettings(),
31
+ ampless.loadThemeConfig(),
35
32
  ])
36
33
  if (!post) notFound()
37
34
 
@@ -1,11 +1,11 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
5
5
  }
6
6
 
7
7
  export async function docsSitemapHandler(_ctx: Ctx): Promise<Response> {
8
- const url = publicAssetUrl('public/plugins/seo/sitemap.xml')
8
+ const url = ampless.publicAssetUrl('public/plugins/seo/sitemap.xml')
9
9
  const upstream = await fetch(url, { cache: 'no-store' })
10
10
  if (!upstream.ok) {
11
11
  return new Response(
@@ -1,22 +1,20 @@
1
1
  import Link from 'next/link'
2
2
  import { notFound } from 'next/navigation'
3
3
  import { formatDate, type ThemeRouteContext } from 'ampless'
4
- import { listPostsByTag } from '@/lib/posts-public'
5
- import { loadSiteSettings } from '@/lib/site-settings'
6
- import { loadThemeConfig } from '@/lib/theme-config'
4
+ import { ampless } from '@/lib/ampless'
5
+ import { admin } from '@/lib/admin'
7
6
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
7
  import { SiteSidebar } from '@/components/site-chrome/site-sidebar'
9
8
  import { SiteFooter } from '@/components/site-chrome/site-footer'
10
9
  import { CollapsibleSidebar } from '@/components/site-chrome/collapsible-sidebar'
11
- import { t } from '@/lib/i18n'
12
10
 
13
11
  export default async function DocsTag({ params }: ThemeRouteContext<{ tag: string }>) {
14
12
  const { tag } = await params
15
13
  const decodedTag = decodeURIComponent(tag)
16
14
  const [{ items: posts }, settings, theme] = await Promise.all([
17
- listPostsByTag(decodedTag, { limit: 50 }),
18
- loadSiteSettings(),
19
- loadThemeConfig(),
15
+ ampless.listPostsByTag(decodedTag, { limit: 50 }),
16
+ ampless.loadSiteSettings(),
17
+ ampless.loadThemeConfig(),
20
18
  ])
21
19
  if (posts.length === 0) notFound()
22
20
 
@@ -36,7 +34,7 @@ export default async function DocsTag({ params }: ThemeRouteContext<{ tag: strin
36
34
 
37
35
  <main className="min-w-0">
38
36
  <header className="mb-10">
39
- <p className="text-sm text-[var(--muted-foreground)]">{t('public.tagLabel')}</p>
37
+ <p className="text-sm text-[var(--muted-foreground)]">{admin.t('public.tagLabel')}</p>
40
38
  <h1 className="text-3xl font-bold tracking-tight">#{decodedTag}</h1>
41
39
  </header>
42
40
 
@@ -1,4 +1,4 @@
1
- import { publicAssetUrl } from '@/lib/storage'
1
+ import { ampless } from '@/lib/ampless'
2
2
 
3
3
  interface Ctx {
4
4
  request: Request
@@ -7,7 +7,7 @@ interface Ctx {
7
7
  // /feed.xml proxy — plugin-rss writes the feed to
8
8
  // `public/plugins/rss/feed.xml`. Same flow as the blog theme.
9
9
  export async function landingFeedHandler(_ctx: Ctx): Promise<Response> {
10
- const url = publicAssetUrl('public/plugins/rss/feed.xml')
10
+ const url = ampless.publicAssetUrl('public/plugins/rss/feed.xml')
11
11
  const upstream = await fetch(url, { cache: 'no-store' })
12
12
  if (!upstream.ok) {
13
13
  return new Response(
@@ -1,9 +1,7 @@
1
1
  import Link from 'next/link'
2
2
  import { formatDate, type ThemeRouteContext } from 'ampless'
3
- import { listPublishedPosts, getPublishedPost } from '@/lib/posts-public'
4
- import { loadSiteSettings } from '@/lib/site-settings'
5
- import { loadThemeConfig } from '@/lib/theme-config'
6
- import { renderBody } from '@/lib/posts'
3
+ import { renderBody } from '@ampless/runtime'
4
+ import { ampless } from '@/lib/ampless'
7
5
  import { SiteHeader } from '@/components/site-chrome/site-header'
8
6
  import { SiteFooter } from '@/components/site-chrome/site-footer'
9
7
 
@@ -12,16 +10,16 @@ import { SiteFooter } from '@/components/site-chrome/site-footer'
12
10
  // site name / description when the manifest hero fields are empty.
13
11
  export default async function LandingHome(_: ThemeRouteContext) {
14
12
  const [settings, theme, postsResult] = await Promise.all([
15
- loadSiteSettings(),
16
- loadThemeConfig(),
17
- listPublishedPosts({ limit: 6 }),
13
+ ampless.loadSiteSettings(),
14
+ ampless.loadThemeConfig(),
15
+ ampless.listPublishedPosts({ limit: 6 }),
18
16
  ])
19
17
 
20
18
  // Featured embed below the hero — typical use is a short "About"
21
19
  // or "Welcome" article. Filtered out of the Latest grid below to
22
20
  // avoid showing the same post twice.
23
21
  const featuredSlug = theme.values.featuredSlug?.trim()
24
- const featured = featuredSlug ? await getPublishedPost(featuredSlug) : null
22
+ const featured = featuredSlug ? await ampless.getPublishedPost(featuredSlug) : null
25
23
  const posts = featured
26
24
  ? postsResult.items.filter((p) => p.slug !== featured.slug)
27
25
  : postsResult.items