feat: more friendly meta tags
This commit is contained in:
parent
2c7b0edaf7
commit
7ff2d1fd6c
5 changed files with 32 additions and 2 deletions
21
src/components/helper/head/Meta.astro
Normal file
21
src/components/helper/head/Meta.astro
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
const { title, description, ogImage = "" } = Astro.props
|
||||
|
||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||
---
|
||||
<meta name="title" content={title} />
|
||||
<meta name="description" content={description} />
|
||||
{/* Open Graph / Facebook */}
|
||||
<meta name="og:title" content={title} />
|
||||
<meta name="og:description" content={description} />
|
||||
{ogImage && <meta name="og:image" content={ogImage} />}
|
||||
<meta property="og:locale" content="en_US"/>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content={canonicalURL} />
|
||||
{/* Twitter */}
|
||||
<meta name="twitter:card" content="summary"></meta>
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
{ogImage && <meta name="twitter:image" content={ogImage} />}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue