Skip to content
Early bird + Black Friday · 73% off

Get ZeroDirs for $179 $49

Claim $49 deal

Ads and sponsors

Ads are static markup in site.config.ts — no script, no ad network. Each placement is one boolean under ads; ads.page.enabled builds the /advertise/ page of rates.

  1. Turn on the page and one placement.

    site.config.ts
    ads: {
    contactEmail: 'ads@acme.com',
    page: { enabled: true, note: 'Placements run for a calendar month.' },
    topBanner: { enabled: true, text: 'Sponsor Acme — your product in front of every reader.', url: 'https://sponsor.example' },
    rates: [{ slot: 'topBanner', price: '$99 / month', blurb: 'One line under the header, on every page.' }],
    },

    pnpm check:config answers site.config.ts OK — <name> (<url>). A url or logo must be an https:// URL or a /-rooted path.

  2. Build and deploy.

    Terminal
    pnpm deploy

    The build’s zero-js: line still ends — ok.

What to check Where You should see
The placement curl -s https://<your domain>/ | grep -o 'data-ad="[a-z-]*"' data-ad="top-banner"; the others are sponsors, inline-card, corner
The rates https://<your domain>/advertise/ the rates table, a live badge per enabled placement, an Email button
The footer any page an Advertise link
The rel page source rel="sponsored noopener" on every ad link

The demo home page: top banner, sponsor wall, corner card

The demo’s /advertise/ page: rates table and Email button

  • advertise is reserved: no listing or category base can use it.
  • The Email button is a mailto: to ads.contactEmail, falling back to site.contactEmail, subject Advertising on <site name>.
  • A sponsor is name, url, optional logo and tagline; other placements take name, tagline, url, logo. Add one to site.config.ts and deploy.
  • corner only renders from the md breakpoint up.
  • A placement runs until you edit the file again. The demo’s prices are placeholders.
State Visitor sees Fix
All off (default) no ads, no footer link, /advertise/ is a 404 —
A placement on, page.enabled off without url, the ad links to /advertise/: a 404 set url, or enable the page
sponsors.enabled with empty items nothing renders, no live badge add an item
A grid no longer than every no in-grid card expected
A url without https:// or a leading / pnpm check:config fails naming the field fix the value

ads.contactEmail, ads.page.enabled, ads.page.intro, ads.page.note, the four placements ads.topBanner, ads.sponsors, ads.inlineCard and ads.corner, and the ads.rates table — ads.

  • Directorysrc/
    • Directorycomponents/ads/
      • AdBanner.astro topBanner
      • Sponsors.astro sponsors
      • AdCard.astro inlineCard
      • CornerAd.astro corner
    • lib/ads.ts AD_SLOTS, activeSlots(), withInlineSlots()
    • pages/[advertise].astro the rates page
    • layouts/Base.astro mounts the banner and the corner card
    • templates/HomePage.astro mounts the sponsor wall
    • components/listing/Grid.astro mounts the in-grid card
    • components/site/Footer.astro the Advertise link
    • config/defaults.ts DEFAULT_ADS
  • site.config.ts the demo’s ads block