diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 42ab561..4b33202 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -71,6 +71,7 @@ Source Files → Astro Build → Static Output ``` src/ ├── components/ # Reusable UI components +│ ├── AnnouncementBar.astro # Reusable top-of-page announcement strip (toggle via ANNOUNCEMENT.enabled) │ ├── BaseHead.astro # content (SEO, meta, hreflang, OG, JSON-LD) │ ├── Footer.astro # Site footer │ ├── WebMcp.astro # WebMCP progressive enhancement (agent-discoverable site map) diff --git a/public/images/product-hunt/featured-dark.svg b/public/images/product-hunt/featured-dark.svg deleted file mode 100644 index 9c1fad1..0000000 --- a/public/images/product-hunt/featured-dark.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - FEATURED ON - - - Product Hunt - - - - - - 83 - - - - - - - - - diff --git a/public/images/product-hunt/featured-neutral.svg b/public/images/product-hunt/featured-neutral.svg deleted file mode 100644 index 57953b2..0000000 --- a/public/images/product-hunt/featured-neutral.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - FEATURED ON - - - Product Hunt - - - - - - 83 - - - - - - - - - diff --git a/src/components/AnnouncementBar.astro b/src/components/AnnouncementBar.astro index 3652e67..4668a9b 100644 --- a/src/components/AnnouncementBar.astro +++ b/src/components/AnnouncementBar.astro @@ -1,5 +1,9 @@ --- -// Temporary Product Hunt launch announcement bar (launch day only). +// Reusable announcement bar. +// +// ON/OFF: controlled by `ANNOUNCEMENT.enabled` in +// `src/lib/constants/announcement.ts`. MainLayout renders this component only +// when that flag is true — flip it there to turn the bar on or off site-wide. // // The whole bar is a single link. It sits in normal document flow ABOVE the // sticky header, so it simply scrolls away on scroll-down and reappears at the @@ -11,9 +15,9 @@ // themes without a dark: variant. // // Copy is wired into the i18n system (t.announcementBar) so it ships in every -// active language. To retire it, remove this component and its -// usage in src/layouts/MainLayout.astro (the announcementBar translation keys can -// stay or be cleaned up later). +// active language; the link target lives in ANNOUNCEMENT.url. It was last used +// for the Product Hunt launch. +import { ANNOUNCEMENT } from '@/lib/constants/announcement'; import type { Language } from '@/lib/i18n'; import { getTranslations } from '@/lib/translations'; @@ -24,8 +28,7 @@ interface Props { const { lang = 'en' } = Astro.props; const t = getTranslations(lang as Language).announcementBar; -const PH_URL = - 'https://www.producthunt.com/products/deep-work-plan?utm_source=launch-bar&utm_medium=banner&utm_campaign=launch-bar'; +const ANN_URL = ANNOUNCEMENT.url; ---
- - - Deep Work Plan - Models matter. Context matters more. Give your agent a plan. | Product Hunt - - -
© {new Date().getFullYear()} Deep Work Plan · {t.footer.allRightsReserved} diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index ef51cda..ddfecfd 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -5,6 +5,7 @@ import BaseHead from '@/components/BaseHead.astro'; import Footer from '@/components/Footer.astro'; import Header from '@/components/layout/Header.svelte'; import WebMcp from '@/components/WebMcp.astro'; +import { ANNOUNCEMENT } from '@/lib/constants/announcement'; import type { Language } from '@/lib/i18n'; import { getTranslations } from '@/lib/translations'; @@ -71,7 +72,7 @@ const nav = getTranslations(lang as Language).nav; Skip to content - + {ANNOUNCEMENT.enabled && }
diff --git a/src/lib/constants/announcement.ts b/src/lib/constants/announcement.ts new file mode 100644 index 0000000..3b74304 --- /dev/null +++ b/src/lib/constants/announcement.ts @@ -0,0 +1,26 @@ +/** + * Announcement bar configuration — single source of truth for the reusable + * top-of-page announcement strip (`src/components/AnnouncementBar.astro`). + * + * HOW TO TURN IT ON/OFF + * --------------------- + * - Flip `enabled` to `true` to show the bar site-wide, `false` to hide it. + * That single flag is the on/off switch — nothing else needs to change to + * mount or unmount it (MainLayout already renders it conditionally). + * + * HOW TO ANNOUNCE SOMETHING NEW + * ----------------------------- + * 1. Set `enabled: true`. + * 2. Point `url` at the target (campaign params welcome). + * 3. Update the `announcementBar` copy (badge/text/tagline/linkText) in + * EVERY locale under `src/lib/translations/*.ts` so it ships translated. + * + * It was last used for the Product Hunt launch (hence the default URL); the + * copy lives in i18n (`t.announcementBar`), not here. + */ +export const ANNOUNCEMENT = { + /** Master on/off switch for the announcement bar. */ + enabled: false, + /** Destination the whole bar links to (opens in a new tab). */ + url: 'https://www.producthunt.com/products/deep-work-plan?utm_source=launch-bar&utm_medium=banner&utm_campaign=launch-bar', +} as const;