Skip to content

Commit

Permalink
allow overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
archiewood committed Jan 8, 2025
1 parent 6624284 commit bf0249c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
20 changes: 18 additions & 2 deletions sites/docs/pages/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,31 @@
export let data;
import { page } from '$app/stores';
let pageRoute = $page.route.id.replace(/\/$/, '')
// Check if the page has an og:image set in the frontmatter
let tree = data.pagesManifest
let frontMatter = undefined
for (const part of $page.route.id.split('/').slice(1)) {
tree = tree.children[part]
frontMatter = tree?.frontMatter
}
const ogImageOverride = frontMatter?.og?.image || undefined
</script>
<head>
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
</head>
<svelte:head>
<meta property="twitter:image" content="https://docs.evidence.dev{pageRoute}/og.png"/>
<meta property="og:image" content="{pageRoute}/og.png"/>
{#if ogImageOverride}
<meta property="twitter:image" content="https://docs.evidence.dev{ogImageOverride}"/>
<meta property="og:image" content="{ogImageOverride}"/>
{:else}
<meta property="twitter:image" content="https://docs.evidence.dev{pageRoute}/og.png"/>
<meta property="og:image" content="{pageRoute}/og.png"/>
{/if}
</svelte:head>
<EvidenceDefaultLayout
{data}
Expand Down
2 changes: 0 additions & 2 deletions sites/docs/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ sidebar_position: 1
title: What is Evidence? | Evidence Docs
description: Evidence is an open source framework for building data products with SQL - things like reports, decision-support tools, and customer-facing/embedded reporting. It's a code-driven alternative to drag-and-drop BI tools.
hide_title: true
og:
image: /img/how-it-works.png
---

# What is Evidence?
Expand Down
2 changes: 0 additions & 2 deletions sites/docs/pages/motivation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
sidebar_position: 2
title: Motivation
description: It's still too difficult to build high quality data products. We give you the tools to deliver production-quality data products that feel more like the New York Times' data journalism than a drag-and-drop dashboard.
og:
image: /img/how-it-works.png
---

We think it's still too difficult to build high quality data products. Businesses are stuck with BI software that delivers slow and clunky outputs, and analysts are stuck manually configuring reports.
Expand Down

0 comments on commit bf0249c

Please sign in to comment.