refactor(blog): description logic
This commit is contained in:
parent
88bf59ce27
commit
d89047bdfa
1 changed files with 7 additions and 6 deletions
|
@ -10,12 +10,17 @@ interface Props {
|
|||
image?: string;
|
||||
}
|
||||
|
||||
const {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props;
|
||||
let {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props;
|
||||
|
||||
description = title === SITE_TITLE
|
||||
? SITE_DESCRIPTION
|
||||
: `${SITE_TITLE} • ${description}`
|
||||
---
|
||||
|
||||
<!-- Global Metadata -->
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
|
||||
|
@ -24,11 +29,7 @@ const {isArticle = false, title, description = 'default description', image = '/
|
|||
<link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>{title} • {
|
||||
title === SITE_TITLE
|
||||
? SITE_DESCRIPTION
|
||||
: `${SITE_TITLE} • ${description}`
|
||||
}</title>
|
||||
<title>{title} • {description}</title>
|
||||
<meta name="title" content={title} />
|
||||
<meta name="description" content={description} />
|
||||
|
||||
|
|
Loading…
Reference in a new issue