Skip to content

Commit

Permalink
fix: add missing og-img content (#129)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Schönmann <tom@wild.as>
  • Loading branch information
flaming-codes and tom-bywild authored Jan 5, 2023
1 parent 0b05bee commit 4892f66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
13 changes: 8 additions & 5 deletions web/src/lib/page/views/BasePageInit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
import BaseMeta from '$lib/seo/views/BaseMeta.svelte';
import BreadcrumbMeta from '$lib/seo/views/BreadcrumbMeta.svelte';
export let title: string;
export let path: string;
export let withBreadcrumb = true;
export let title: string | undefined = undefined;
export let path: string | undefined = undefined;
export let withBaseMeta: boolean = true;
export let withBreadcrumb: boolean = true;
</script>

<BaseMeta {title} {path} />
{#if withBreadcrumb}
{#if title && path && withBaseMeta}
<BaseMeta {title} {path} />
{/if}
{#if title && path && withBreadcrumb}
<BreadcrumbMeta items={[{ name: title, href: path }]} />
{/if}
<ColorScheme scheme="dark" />
Expand Down
16 changes: 13 additions & 3 deletions web/src/routes/statistic/github/stars/[range]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
import SubGridIcon from '$lib/blocks/views/SubGridIcon.svelte';
import SubGridItem from '$lib/blocks/views/SubGridItem.svelte';
import CommonControls from '$lib/controls/views/CommonControls.svelte';
import ColorScheme from '$lib/display/views/ColorScheme.svelte';
import Link from '$lib/display/views/Link.svelte';
import NotificationCenterAnchor from '$lib/notification/view/NotificationCenterAnchor.svelte';
import BasePageInit from '$lib/page/views/BasePageInit.svelte';
import BaseMeta from '$lib/seo/views/BaseMeta.svelte';
import BreadcrumbMeta from '$lib/seo/views/BreadcrumbMeta.svelte';
import { mapRangeToLabel } from '$lib/statistics/models/github';
import clsx from 'clsx';
Expand All @@ -20,10 +23,15 @@
let selectedRange = data.selectedRange;
</script>

<BasePageInit
withBreadcrumb={false}
title="Trending R packages by Github stars for the last {mapRangeToLabel(selectedRange)}"
<BasePageInit withBaseMeta={false} withBreadcrumb={false} />
<BaseMeta
title={`Trending R packages by Github stars`}
description={`Trending R packages by Github stars for the last ${mapRangeToLabel(selectedRange)}`}
path="/statistic/github/stars/{selectedRange}"
image={{
url: `https://www.cran-e.com/api/statistic/github/stars/${selectedRange}/poster.jpeg`,
alt: `Poster for range ${selectedRange}`
}}
/>
<BreadcrumbMeta
items={[
Expand All @@ -37,6 +45,8 @@
]}
/>
<CommonControls variant="translucent" />
<ColorScheme scheme="dark" />
<NotificationCenterAnchor />

<main>
<Hero
Expand Down

0 comments on commit 4892f66

Please sign in to comment.