diff --git a/TASKS.md b/TASKS.md index ffa4326..3e1a01f 100644 --- a/TASKS.md +++ b/TASKS.md @@ -90,11 +90,7 @@ Propose TASK update ## LAYOUT SYSTEM -- [ ] T106 Create Global Layout -- [ ] T107 Create Navigation -- [ ] T108 Create Mobile Navigation -- [ ] T109 Create Document Layout -- [ ] T110 Create Content Collection Routing +- [x] T106 Create Site Shell --- diff --git a/src/components/DesktopNav.astro b/src/components/DesktopNav.astro new file mode 100644 index 0000000..4959722 --- /dev/null +++ b/src/components/DesktopNav.astro @@ -0,0 +1,19 @@ +--- +import { navItems } from '../lib/site'; +--- + + diff --git a/src/components/Footer.astro b/src/components/Footer.astro new file mode 100644 index 0000000..59ba038 --- /dev/null +++ b/src/components/Footer.astro @@ -0,0 +1,9 @@ +--- + +--- + + diff --git a/src/components/Header.astro b/src/components/Header.astro new file mode 100644 index 0000000..f9fde53 --- /dev/null +++ b/src/components/Header.astro @@ -0,0 +1,18 @@ +--- +import DesktopNav from './DesktopNav.astro'; +import MobileNav from './MobileNav.astro'; +--- + +
+
+ + REPL Works + + + +
+
diff --git a/src/components/MobileNav.astro b/src/components/MobileNav.astro new file mode 100644 index 0000000..f3cee6f --- /dev/null +++ b/src/components/MobileNav.astro @@ -0,0 +1,30 @@ +--- +import { navItems } from '../lib/site'; +--- + +
+
+ + Menu + + + +
+
diff --git a/src/layouts/DocumentLayout.astro b/src/layouts/DocumentLayout.astro new file mode 100644 index 0000000..1a077ae --- /dev/null +++ b/src/layouts/DocumentLayout.astro @@ -0,0 +1,30 @@ +--- +import SiteLayout from './SiteLayout.astro'; +const { title = 'Document', description = 'Document content placeholder.' } = + Astro.props; +--- + + +
+
+

+ Document +

+

+ {title} +

+

+ {description} +

+
+
+ +
+
+
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index ced41b0..4219df0 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,16 +1,21 @@ --- import '../styles/global.css'; +const { + title = 'REPL Works', + description = 'A documentation shell for the REPL Works website.', +} = Astro.props; --- - + + - Astro Basics + {title} @@ -21,7 +26,15 @@ import '../styles/global.css'; html, body { margin: 0; - width: 100%; - height: 100%; + min-height: 100%; + font-family: + ui-sans-serif, + system-ui, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + sans-serif; + background: #f8fafc; + color: #0f172a; } diff --git a/src/layouts/SiteLayout.astro b/src/layouts/SiteLayout.astro new file mode 100644 index 0000000..4cc4b2d --- /dev/null +++ b/src/layouts/SiteLayout.astro @@ -0,0 +1,19 @@ +--- +import Layout from './Layout.astro'; +import Header from '../components/Header.astro'; +import Footer from '../components/Footer.astro'; +const { + title = 'REPL Works', + description = 'REPL Works documentation shell.', +} = Astro.props; +--- + + +
+
+
+ +
+
+
+
diff --git a/src/lib/site.ts b/src/lib/site.ts new file mode 100644 index 0000000..5d9cdae --- /dev/null +++ b/src/lib/site.ts @@ -0,0 +1,40 @@ +export const contentCollections = [ + 'manifesto', + 'specification', + 'workflow', + 'resources', + 'showcase', +] as const; + +export type ContentCollection = (typeof contentCollections)[number]; + +export const navItems = [ + { title: 'Home', href: '/' }, + { title: 'Why', href: '/why' }, + { title: 'Manifesto', href: '/manifesto' }, + { title: 'Specification', href: '/specification' }, + { title: 'Workflow', href: '/workflow' }, + { title: 'Resources', href: '/resources' }, + { title: 'Showcase', href: '/showcase' }, +] as const; + +export const collectionTitles: Record = { + manifesto: 'Manifesto', + specification: 'Specification', + workflow: 'Workflow', + resources: 'Resources', + showcase: 'Showcase', +}; + +export const collectionDescriptions: Record = { + manifesto: 'A shared manifesto for REPL Works and AI development.', + specification: + 'The specification framework for the REPL Works documentation platform.', + workflow: 'The workflow and process guidance for using REPL Works.', + resources: 'Curated resources to support REPL Works adoption.', + showcase: 'Proof of adoption and showcase examples for REPL Works.', +}; + +export function isContentCollection(value: string): value is ContentCollection { + return contentCollections.includes(value as ContentCollection); +} diff --git a/src/pages/[collection]/[slug].astro b/src/pages/[collection]/[slug].astro new file mode 100644 index 0000000..5e21ac4 --- /dev/null +++ b/src/pages/[collection]/[slug].astro @@ -0,0 +1,42 @@ +--- +import type { ContentCollection } from '../../lib/site'; +import { collectionTitles, isContentCollection } from '../../lib/site'; +import { getEntry } from 'astro:content'; +import DocumentLayout from '../../layouts/DocumentLayout.astro'; + +export async function getStaticPaths() { + return [] as Array<{ + params: { collection: ContentCollection; slug: string }; + }>; +} + +const collection = Astro.params.collection; +const slug = Astro.params.slug; +if (!isContentCollection(collection)) { + throw new Error(`Unsupported collection: ${collection}`); +} + +const entry = await getEntry(collection, slug); +if (!entry) { + throw new Error(`Entry not found for ${collection}/${slug}`); +} + +const rendered = entry.rendered ?? null; +const metadata = entry.data ?? {}; +--- + + + { + rendered ? ( +
+ ) : ( +
+

This document is available once the collection publish content.

+
+ ) + } + diff --git a/src/pages/[collection]/index.astro b/src/pages/[collection]/index.astro new file mode 100644 index 0000000..cf8b645 --- /dev/null +++ b/src/pages/[collection]/index.astro @@ -0,0 +1,32 @@ +--- +import { + collectionDescriptions, + collectionTitles, + contentCollections, + isContentCollection, +} from '../../lib/site'; +import DocumentLayout from '../../layouts/DocumentLayout.astro'; + +export async function getStaticPaths() { + return contentCollections.map((collection) => ({ params: { collection } })); +} + +const collection = Astro.params.collection; +if (!isContentCollection(collection)) { + throw new Error(`Unsupported collection: ${collection}`); +} + +const collectionTitle = collectionTitles[collection]; +const collectionDescription = collectionDescriptions[collection]; +--- + + +
+

+ No content has been added yet for {collectionTitle}. This collection route + is ready for future documents. +

+
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index 92ed21d..d280968 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,11 +1,22 @@ --- -import Welcome from '../components/Welcome.astro'; -import Layout from '../layouts/Layout.astro'; - -// Welcome to Astro! Wondering what to do next? Check out the Astro documentation at https://docs.astro.build -// Don't want to use any of this? Delete everything in this file, the `assets`, `components`, and `layouts` directories, and start fresh. +import SiteLayout from '../layouts/SiteLayout.astro'; --- - - - + +
+

+ Documentation shell +

+

+ REPL Works +

+

+ This foundation provides shared layout, navigation, and content collection + routing for the REPL Works platform. +

+
+
diff --git a/src/pages/why.astro b/src/pages/why.astro new file mode 100644 index 0000000..e0fc128 --- /dev/null +++ b/src/pages/why.astro @@ -0,0 +1,15 @@ +--- +import SiteLayout from '../layouts/SiteLayout.astro'; +--- + + +
+

Why REPL Works?

+

+ This page is a placeholder for the Why section. The shared site shell is + configured and ready for content. +

+
+