Skip to content

Commit 92e7728

Browse files
committed
feat(example): demo site uses all Visor opts
1 parent 6fda399 commit 92e7728

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

.changeset/shy-peaches-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"example-site": patch
3+
---
4+
5+
Add missing param options to `<Visor />` in Layout
56.3 KB
Loading

examples/example-site/src/layouts/Layout.astro

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,28 @@
22
import {Visor} from '@binz/visor';
33
import logoSvgSrc from '../images/Logo.svg';
44
5+
const SITE_NAME = 'Example Site';
6+
57
interface Props {
68
title: string;
9+
description: string;
10+
socialImagePath?: string;
11+
socialImageAltText?: string;
12+
keywords?: string[];
713
}
814
9-
const { title: pageTitle } = Astro.props;
15+
const {
16+
title: pageTitle,
17+
description,
18+
socialImagePath: socialImage = '/social.png',
19+
socialImageAltText = pageTitle,
20+
keywords,
21+
} = Astro.props;
22+
1023
const canonicalUrl = Astro.url;
24+
25+
const title = `${pageTitle} | ${SITE_NAME}`;
26+
1127
---
1228
<!doctype html>
1329
<html lang="en">
@@ -17,13 +33,20 @@ const canonicalUrl = Astro.url;
1733
twitterHandle: "@joe_blogs"
1834
}}
1935
canonicalURL={canonicalUrl}
20-
description="Built with visor"
21-
defaultKeywords={[]}
36+
description={description}
37+
defaultKeywords={[ SITE_NAME, 'example' ]}
38+
keywords={keywords}
2239
siteName="Example Site"
2340
siteFaviconSvg={logoSvgSrc}
24-
socialImagePath="/social.jpg"
25-
title={pageTitle}
26-
pwa
41+
siteLocale="en_US"
42+
siteTwitterHandle="@example_dot_com"
43+
socialImagePath={socialImage}
44+
socialImageAltText={socialImageAltText}
45+
socialTwitterCardType='summary_large_image'
46+
siteThemeColour={'#883aea'}
47+
contentType='website'
48+
title={title}
49+
pwa
2750
/>
2851
<body>
2952
<slot />

examples/example-site/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Layout from '../layouts/Layout.astro';
33
import Card from '../components/Card.astro';
44
---
55

6-
<Layout title="Welcome to Astro.">
6+
<Layout title="Welcome to Visor." description='Visor demo landing page'>
77
<main>
88
<svg
99
class="astro-a"

0 commit comments

Comments
 (0)