Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually inject the schema to homepage on build #447

Merged
merged 1 commit into from
Jan 31, 2025
Merged
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
10 changes: 5 additions & 5 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
interface Props {
title: string
isHome?: boolean
}

const { title } = Astro.props
const onHomepage = Astro.url.origin === 'https://zen-browser.app/'
const { title, isHome } = Astro.props
import '@fontsource/bricolage-grotesque/400.css'
import NavBar from '../components/NavBar.astro'
import Footer from '../components/Footer.astro'
Expand Down Expand Up @@ -38,9 +38,9 @@ import Footer from '../components/Footer.astro'
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="sitemap" href="/sitemap-0.xml" />

<!-- Injecting schema to homepage only (for SEO) -->
{onHomepage && (
<script type="application/ld+json">
{isHome && (
<!-- Injecting schema to homepage only (for SEO) -->
<script is:inline type="application/ld+json">
{{
"@context":"https://schema.org",
"@type":"WebSite",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Features from '../components/Features.astro'
import HomeExtras from '../components/HomeExtras.astro'
---

<Layout title="Zen Browser">
<Layout title="Zen Browser" isHome>
<main>
<Hero />
<Community />
Expand Down