Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cms/src/api/page/content-types/page/lifecycles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ interface Page {
title: string
slug: string
locale?: string
category?: 'default' | 'tech' | 'mission' | 'vision' | 'values'
hero?: Hero
seo?: Seo
content?: ContentBlock[]
Expand Down Expand Up @@ -548,6 +549,11 @@ function generateMDX(page: Page): string {
}
}

// Add category for theming
if (page.category) {
frontmatterLines.push(`category: "${page.category}"`)
}

// Add locale and contentId for localized pages
if (isLocalized) {
frontmatterLines.push(`locale: "${locale}"`)
Expand Down
10 changes: 10 additions & 0 deletions cms/src/api/page/content-types/page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
"blocks.ambassadors-grid",
"blocks.blockquote"
]
},
"category": {
"type": "enumeration",
"enum": ["default", "tech", "mission", "vision", "values"],
"default": "default",
"pluginOptions": {
"i18n": {
"localized": false
}
}
}
}
}
9 changes: 9 additions & 0 deletions cms/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ export interface ApiPagePage extends Struct.CollectionTypeSchema {
}
}
attributes: {
category: Schema.Attribute.Enumeration<
['default', 'tech', 'mission', 'vision', 'values']
> &
Schema.Attribute.SetPluginOptions<{
i18n: {
localized: false
}
}> &
Schema.Attribute.DefaultTo<'default'>
content: Schema.Attribute.DynamicZone<
[
'blocks.paragraph',
Expand Down
2 changes: 1 addition & 1 deletion src/components/blockquote/Blockquote.astro
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (
const formattedQuote = `“${trimmedQuote.trim()}”`
---

<div class="ps-space-s py-space-2xs border-l-4 border-primary mb-space-s">
<div class="ps-space-s py-space-2xs border-l-4 border-(--accent-color) mb-space-s">
<blockquote class="text-step-1">
<p>{formattedQuote}</p>
</blockquote>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/[...page].astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ export async function getStaticPaths() {
const { page } = Astro.props
const { Content } = await render(page)

const { title, heroTitle, heroDescription, description } = page.data
const { title, heroTitle, heroDescription, description, category } = page.data
const pageTitle = title || page.data.slug
const pageCategory = category || 'default'
---

<BaseLayout title={pageTitle} description={description}>
<main class="pb-space-l">
<main class="pb-space-l" data-category={pageCategory}>
{
heroTitle && (
<section class="bg-gradient-primary bg-no-repeat bg-cover bg-[position:bottom_right] min-h-[40vh] py-space-xl text-white flex items-center">
Expand Down
19 changes: 19 additions & 0 deletions src/styles/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
--color-header-accent: #eee;
--color-table-stripe: #f6f7f9;
--color-bg-inline-code: #edeef3;
/* Accent color for themed elements (blockquotes, etc.) */
--accent-color: var(--color-primary);
--option1: linear-gradient(
to bottom,
hsla(162, 86%, 12%, 1),
Expand All @@ -150,6 +152,23 @@
--color-text: var(--color-white);
}

/* Category-based theming */
[data-category='tech'] {
--accent-color: oklch(51.54% 0.088 194.77); /* Using primary for now */
}

[data-category='mission'] {
--accent-color: oklch(55.27% 0.205 32.62); /* Using mission color */
}

[data-category='vision'] {
--accent-color: oklch(51.54% 0.088 194.77); /* Using primary for now */
}

[data-category='values'] {
--accent-color: oklch(51.54% 0.088 194.77); /* Using primary for now */
}

main {
@apply flex-1 text-step-0;
}
Expand Down