Added "og:" meta tags.
This should allow for additional card support, e.g. in Discord.
This commit is contained in:
parent
cb4853c09f
commit
882e6f5a92
3 changed files with 12 additions and 2 deletions
8
src/components/Meta.astro
Normal file
8
src/components/Meta.astro
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
const { title, image } = Astro.props;
|
||||
---
|
||||
{title && <meta property="og:title" content={title} />}
|
||||
{image && <meta property="og:image" content=`https://bashelton.com${image}` />}
|
||||
<meta property="og:description" content="Just Us Class Notes and Resources" />
|
||||
<meta property="og:url" content="https://bashelton.com/sundays" />
|
||||
<meta property="og:type" content="website" />
|
||||
|
|
@ -2,10 +2,11 @@
|
|||
//import "../global.css";
|
||||
import Header from "../components/Header.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
import Meta from "../components/Meta.astro";
|
||||
|
||||
import { urlfrag } from "../utils/path.js";
|
||||
|
||||
const { title } = Astro.props;
|
||||
const { title, image } = Astro.props;
|
||||
const base = import.meta.env.BASE_URL;
|
||||
---
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ const base = import.meta.env.BASE_URL;
|
|||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#28303c" />
|
||||
<Meta title={title} image={image} />
|
||||
<link rel="icon" type="image/svg+xml" href={urlfrag(base, 'favicon.svg')} />
|
||||
<link rel="icon" href={urlfrag(base, 'favicon.png')} />
|
||||
<title>{title}</title>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const meta = `{
|
|||
|
||||
---
|
||||
|
||||
<Layout title=`${note.data.title} - ${note.data.sub_heading}`>
|
||||
<Layout title=`${note.data.title} - ${note.data.sub_heading}` image=`${urlfrag(base, note.data.post_image)}`>
|
||||
{meta && <script type="application/ld+json" is:inline set:html={meta} />}
|
||||
<script>
|
||||
import { bindModals } from '../../utils/modal.js';
|
||||
|
|
|
|||
Loading…
Reference in a new issue