Skip to content

feat: add core components for Mailify marketing site - #4

Merged
DoniLite merged 2 commits into
masterfrom
feat/new-realese-update
Apr 24, 2026
Merged

feat: add core components for Mailify marketing site#4
DoniLite merged 2 commits into
masterfrom
feat/new-realese-update

Conversation

@DoniLite

@DoniLite DoniLite commented Apr 24, 2026

Copy link
Copy Markdown
Owner
  • Introduced Hero component for the landing section with branding and call-to-action buttons.
  • Created MarketingLayout component for consistent page structure with header and footer.
  • Developed SiteHeader and SiteFooter components for navigation and branding.
  • Added ThemeToggle component for light/dark mode switching.
  • Implemented ThemeShowcase component to demonstrate theme system.
  • Created 404 error page with user-friendly messaging and navigation options.
  • Established pricing page detailing Mailify's cost structure and support options.
  • Added global and token styles for consistent theming and layout.
  • Configured content collections for documentation management.
  • Set up TypeScript configuration for improved type safety.

Summary by Sourcery

Set up a new Astro-based marketing and documentation site for Mailify with shared marketing layout, theming, and navigation components, plus CI to build and deploy it.

New Features:

  • Add Astro/Starlight-powered marketing homepage with hero, feature, workflow, theme showcase, and architecture sections.
  • Introduce reusable marketing layout with global header, footer, and accessibility features for marketing pages.
  • Create dedicated pricing and 404 pages tailored to the Mailify product and contribution flow.
  • Add theme toggle and design token system to support light/dark modes and consistent branding across site.

Enhancements:

  • Define global typography, spacing, button styles, and design tokens to unify visual styling across marketing and docs.
  • Configure Astro content collections and site metadata, including Open Graph and structured data, for SEO and docs management.

Build:

  • Add Astro project with package manifest, TypeScript config, and content configuration for the marketing/docs site.
  • Configure GitHub Actions workflow to build and deploy the site to GitHub Pages on changes to site or docs.

CI:

  • Introduce site build-and-deploy GitHub Actions workflow targeting GitHub Pages.

Documentation:

  • Update Docker deployment guide code block language hint for clearer Caddy example formatting.

- Introduced Hero component for the landing section with branding and call-to-action buttons.
- Created MarketingLayout component for consistent page structure with header and footer.
- Developed SiteHeader and SiteFooter components for navigation and branding.
- Added ThemeToggle component for light/dark mode switching.
- Implemented ThemeShowcase component to demonstrate theme system.
- Created 404 error page with user-friendly messaging and navigation options.
- Established pricing page detailing Mailify's cost structure and support options.
- Added global and token styles for consistent theming and layout.
- Configured content collections for documentation management.
- Set up TypeScript configuration for improved type safety.
@sourcery-ai

sourcery-ai Bot commented Apr 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a new Astro-based marketing site for Mailify (home, pricing, and 404 pages) with a reusable marketing layout, core UI components, theme tokens/global styling, Starlight docs integration, and a CI workflow to build/deploy the site to GitHub Pages, plus a minor docs code-block fix.

Sequence diagram for ThemeToggle behavior on the marketing site

sequenceDiagram
  actor User
  participant ThemeToggleButton as ThemeToggle_button
  participant ThemeScript as Theme_toggle_script
  participant LocalStorage
  participant MediaQuery as PrefersColorScheme
  participant Document as DocumentRoot

  Note over ThemeScript,DocumentRoot: Initial load
  ThemeScript->>LocalStorage: getItem(starlight-theme)
  alt stored theme is light/dark
    LocalStorage-->>ThemeScript: "light" or "dark"
  else no stored theme
    LocalStorage-->>ThemeScript: null
    ThemeScript->>PrefersColorScheme: match('(prefers-color-scheme: light)')
    PrefersColorScheme-->>ThemeScript: matches true/false
  end
  ThemeScript->>DocumentRoot: set data-theme to resolved theme

  Note over User,ThemeToggleButton: User toggles theme
  User->>ThemeToggleButton: click
  ThemeToggleButton->>ThemeScript: click handler invoked
  ThemeScript->>LocalStorage: getItem(starlight-theme)
  ThemeScript->>PrefersColorScheme: resolveTheme(current)
  PrefersColorScheme-->>ThemeScript: current effective theme
  ThemeScript->>ThemeScript: compute nextTheme(light<->dark)
  ThemeScript->>DocumentRoot: set data-theme = nextTheme
  ThemeScript->>LocalStorage: setItem(starlight-theme, nextTheme)
Loading

Class diagram for Astro marketing layout and core components

classDiagram
  class MarketingLayout {
    +string title
    +string description
    +Slot content
  }

  class SiteHeader {
    +ThemeToggle themeToggle
  }

  class SiteFooter {
  }

  class ThemeToggle {
    +button[data-theme-toggle]
    +getTheme()
    +resolveTheme(theme)
    +applyTheme(theme)
  }

  class Hero {
  }

  class FeatureGrid {
    -Feature[] features
  }

  class Feature {
    +string title
    +string body
  }

  class CodeTabs {
    -string snippet
  }

  class ThemeShowcase {
  }

  class ArchitectureDiagram {
    -string[] crates
  }

  class IndexPage {
    +MarketingLayout layout
    +Hero hero
    +FeatureGrid featureGrid
    +CodeTabs codeTabs
    +ThemeShowcase themeShowcase
    +ArchitectureDiagram architectureDiagram
  }

  class PricingPage {
    +MarketingLayout layout
  }

  class NotFoundPage404 {
    +MarketingLayout layout
  }

  class AstroConfig {
    +starlightIntegration
    +sitemapIntegration
    +customCss
    +sidebarConfig
    +headMetaConfig
  }

  class ContentCollections {
    +docsCollection
  }

  MarketingLayout --> SiteHeader : composes
  MarketingLayout --> SiteFooter : composes

  SiteHeader --> ThemeToggle : uses

  FeatureGrid --> Feature : aggregates

  IndexPage --> MarketingLayout : uses
  IndexPage --> Hero : uses
  IndexPage --> FeatureGrid : uses
  IndexPage --> CodeTabs : uses
  IndexPage --> ThemeShowcase : uses
  IndexPage --> ArchitectureDiagram : uses

  PricingPage --> MarketingLayout : uses
  NotFoundPage404 --> MarketingLayout : uses

  AstroConfig --> ContentCollections : uses
Loading

File-Level Changes

Change Details Files
Introduce Astro marketing site shell with shared layout, navigation, and theming.
  • Create MarketingLayout wrapper that sets up HTML head metadata, shared header/footer, and skip-link accessible main content region
  • Implement SiteHeader and SiteFooter components with logo variants, primary navigation, theme toggle, and key footer link groups
  • Add ThemeToggle client script that reads/stores theme preference, syncs with prefers-color-scheme, and toggles :root[data-theme] on click
site/src/components/MarketingLayout.astro
site/src/components/SiteHeader.astro
site/src/components/SiteFooter.astro
site/src/components/ThemeToggle.astro
Build the main landing page with reusable content sections and theme showcase.
  • Add Hero component for the top-of-page call-to-action with SVG illustration and responsive layout
  • Implement FeatureGrid, CodeTabs, ThemeShowcase, and ArchitectureDiagram sections as standalone presentational components
  • Compose the new index.astro page using MarketingLayout and the new components to form the full landing page
site/src/components/Hero.astro
site/src/components/FeatureGrid.astro
site/src/components/CodeTabs.astro
site/src/components/ThemeShowcase.astro
site/src/components/ArchitectureDiagram.astro
site/src/pages/index.astro
Add additional marketing pages (pricing, 404) using the shared layout.
  • Create pricing page with two-tier explanation and support call-to-action, styled with responsive cards and sections
  • Add custom 404 page with friendly copy and navigation options back to home, docs, and issue reporting
site/src/pages/pricing.astro
site/src/pages/404.astro
Define design tokens, global styles, and documentation content/config for the marketing/docs site.
  • Introduce tokens.css with brand palette, semantic colors, typography scale, spacing, radii, shadows, and Starlight theme variable mappings including dark mode overrides
  • Add global.css for base resets, typography, buttons, focus states, and reduced-motion handling
  • Configure Starlight content collections for docs and create placeholder docs content directory entry
site/src/styles/tokens.css
site/src/styles/global.css
site/src/content.config.ts
site/src/content/docs/docs
Configure Astro/Starlight app, TypeScript, and GitHub Pages deployment workflow for the site.
  • Add astro.config.mjs defining site URL, Starlight integration (title, logo, sidebar structure, SEO metadata, social links), sitemap integration, and custom CSS
  • Add TS config extending Astro strict defaults for the site
  • Add site-specific package.json and bun.lock to manage dependencies and scripts for dev/build
  • Create GitHub Actions workflow to build the site with Bun on pushes/PRs and deploy to GitHub Pages on master
  • Add public assets (favicon, OG image, robots, CNAME) and site-level .gitignore
site/astro.config.mjs
site/tsconfig.json
site/package.json
site/bun.lock
site/public/favicon.svg
site/public/og-default.svg
site/public/robots.txt
site/public/CNAME
.github/workflows/site.yml
site/.gitignore
Make minor documentation rendering tweak for Docker guide code block.
  • Change the Caddy configuration code block language from caddy to txt to avoid incorrect/unsupported syntax highlighting
docs/guides/deploy-docker.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues, and left some high level feedback:

  • In ThemeToggle.astro, consider adding a fallback to mediaQuery.addListener when addEventListener('change', ...) is not available (e.g. older Safari) to avoid runtime errors in some browsers.
  • Several external links (e.g. in pricing.astro and 404.astro) use rel="noopener" without target="_blank"; either add target="_blank" (and rel="noopener noreferrer") for outbound links you want to open in a new tab, or drop the rel attribute if they should stay in the same tab.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `ThemeToggle.astro`, consider adding a fallback to `mediaQuery.addListener` when `addEventListener('change', ...)` is not available (e.g. older Safari) to avoid runtime errors in some browsers.
- Several external links (e.g. in `pricing.astro` and `404.astro`) use `rel="noopener"` without `target="_blank"`; either add `target="_blank"` (and `rel="noopener noreferrer"`) for outbound links you want to open in a new tab, or drop the `rel` attribute if they should stay in the same tab.

## Individual Comments

### Comment 1
<location path="site/src/components/ThemeToggle.astro" line_range="30-31" />
<code_context>
+    applyTheme(nextTheme);
+  });
+
+  mediaQuery.addEventListener('change', () => {
+    if (getTheme() === 'auto') applyTheme('auto');
+  });
+</script>
</code_context>
<issue_to_address>
**issue (bug_risk):** Add a fallback for `matchMedia` change events to avoid breaking in older browsers.

Safari < 14 and some WebViews only support `mediaQuery.addListener`, so this can throw at runtime there. A small compatibility shim keeps behavior consistent:

```js
if (mediaQuery.addEventListener) {
  mediaQuery.addEventListener('change', () => {
    if (getTheme() === 'auto') applyTheme('auto');
  });
} else if (mediaQuery.addListener) {
  mediaQuery.addListener(() => {
    if (getTheme() === 'auto') applyTheme('auto');
  });
}
```
</issue_to_address>

### Comment 2
<location path="site/src/components/ThemeToggle.astro" line_range="1" />
<code_context>
+<button class="theme-toggle" type="button" aria-label="Toggle color theme" data-theme-toggle>
+  <span class="theme-toggle__icon theme-toggle__icon--sun" aria-hidden="true">Light</span>
+  <span class="theme-toggle__icon theme-toggle__icon--moon" aria-hidden="true">Dark</span>
</code_context>
<issue_to_address>
**suggestion:** Expose toggle state via ARIA to improve accessibility for assistive tech users.

Since this is a binary light/dark control, expose the current state via ARIA so assistive tech can announce it. For example, set `button.aria-pressed = resolveTheme(getTheme()) === 'dark'` in `applyTheme`, and update the `aria-label` or associated `aria-live` text to reflect the active theme.

Suggested implementation:

```
<button class="theme-toggle" type="button" aria-label="Activate dark color theme" aria-pressed="false" data-theme-toggle>

```

```
  const getTheme = () => {
    const stored = localStorage.getItem(storageKey);
    return stored === 'light' || stored === 'dark' ? stored : 'auto';
  };

  const updateThemeToggleAria = (resolvedTheme) => {
    const button = document.querySelector('[data-theme-toggle]');
    if (!button) return;

    const isDark = resolvedTheme === 'dark';
    button.setAttribute('aria-pressed', String(isDark));
    button.setAttribute(
      'aria-label',
      isDark ? 'Activate light color theme' : 'Activate dark color theme',
    );
  };

```

To fully wire this up, update the (existing) `applyTheme` logic in this file:

1. Wherever you currently resolve the effective theme (often via something like `const resolvedTheme = resolveTheme(theme)` or `resolveTheme(getTheme())`), call `updateThemeToggleAria(resolvedTheme)` after the theme has been applied to the document.
2. Ensure `applyTheme` is invoked on initial load (if it isn't already) so that `aria-pressed` and `aria-label` reflect the correct state before the user interacts with the button.
3. If the function name or signature differs (e.g. your resolver is named differently), adjust the call site accordingly, but always pass the final resolved theme string `'light'` or `'dark'` into `updateThemeToggleAria`.
</issue_to_address>

### Comment 3
<location path="site/src/components/ArchitectureDiagram.astro" line_range="24-30" />
<code_context>
+      </p>
+    </div>
+
+    <div class="diagram">
+      {crates.map((crateName, index) => (
+        <div class:list={['node', index === crates.length - 1 && 'node--primary']}>
+          {crateName}
+        </div>
</code_context>
<issue_to_address>
**suggestion:** Use list semantics for the crate diagram to improve accessibility and structure.

Since this represents a sequential flow, consider rendering it as a styled `<ol>` with `<li>` items instead of plain `<div>`s. This will preserve the current look while giving screen readers and other assistive tools a clearer sense of order and structure.

```suggestion
    <ol class="diagram">
      {crates.map((crateName, index) => (
        <li class:list={['node', index === crates.length - 1 && 'node--primary']}>
          {crateName}
        </li>
      ))}
    </ol>
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +30 to +31
mediaQuery.addEventListener('change', () => {
if (getTheme() === 'auto') applyTheme('auto');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Add a fallback for matchMedia change events to avoid breaking in older browsers.

Safari < 14 and some WebViews only support mediaQuery.addListener, so this can throw at runtime there. A small compatibility shim keeps behavior consistent:

if (mediaQuery.addEventListener) {
  mediaQuery.addEventListener('change', () => {
    if (getTheme() === 'auto') applyTheme('auto');
  });
} else if (mediaQuery.addListener) {
  mediaQuery.addListener(() => {
    if (getTheme() === 'auto') applyTheme('auto');
  });
}

@@ -0,0 +1,69 @@
<button class="theme-toggle" type="button" aria-label="Toggle color theme" data-theme-toggle>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Expose toggle state via ARIA to improve accessibility for assistive tech users.

Since this is a binary light/dark control, expose the current state via ARIA so assistive tech can announce it. For example, set button.aria-pressed = resolveTheme(getTheme()) === 'dark' in applyTheme, and update the aria-label or associated aria-live text to reflect the active theme.

Suggested implementation:

<button class="theme-toggle" type="button" aria-label="Activate dark color theme" aria-pressed="false" data-theme-toggle>

  const getTheme = () => {
    const stored = localStorage.getItem(storageKey);
    return stored === 'light' || stored === 'dark' ? stored : 'auto';
  };

  const updateThemeToggleAria = (resolvedTheme) => {
    const button = document.querySelector('[data-theme-toggle]');
    if (!button) return;

    const isDark = resolvedTheme === 'dark';
    button.setAttribute('aria-pressed', String(isDark));
    button.setAttribute(
      'aria-label',
      isDark ? 'Activate light color theme' : 'Activate dark color theme',
    );
  };

To fully wire this up, update the (existing) applyTheme logic in this file:

  1. Wherever you currently resolve the effective theme (often via something like const resolvedTheme = resolveTheme(theme) or resolveTheme(getTheme())), call updateThemeToggleAria(resolvedTheme) after the theme has been applied to the document.
  2. Ensure applyTheme is invoked on initial load (if it isn't already) so that aria-pressed and aria-label reflect the correct state before the user interacts with the button.
  3. If the function name or signature differs (e.g. your resolver is named differently), adjust the call site accordingly, but always pass the final resolved theme string 'light' or 'dark' into updateThemeToggleAria.

Comment on lines +24 to +30
<div class="diagram">
{crates.map((crateName, index) => (
<div class:list={['node', index === crates.length - 1 && 'node--primary']}>
{crateName}
</div>
))}
</div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Use list semantics for the crate diagram to improve accessibility and structure.

Since this represents a sequential flow, consider rendering it as a styled <ol> with <li> items instead of plain <div>s. This will preserve the current look while giving screen readers and other assistive tools a clearer sense of order and structure.

Suggested change
<div class="diagram">
{crates.map((crateName, index) => (
<div class:list={['node', index === crates.length - 1 && 'node--primary']}>
{crateName}
</div>
))}
</div>
<ol class="diagram">
{crates.map((crateName, index) => (
<li class:list={['node', index === crates.length - 1 && 'node--primary']}>
{crateName}
</li>
))}
</ol>

@DoniLite
DoniLite merged commit 1ead031 into master Apr 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant