-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor font loading logic in BaseHead.astro and add font preload fo…
…r onest font
- Loading branch information
1 parent
a874387
commit b6b4c02
Showing
3 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import '../styles/base.css'; | |
import '@fontsource-variable/onest/index.css'; | ||
import { ClientRouter } from 'astro:transitions'; | ||
import { Generator } from 'studiocms:components'; | ||
import { isDashboardRoute } from '../utils'; | ||
import onestWoff2 from '@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url'; | ||
export interface Props { | ||
title: string; | ||
|
@@ -16,7 +16,11 @@ const { title, description } = Astro.props; | |
<head> | ||
|
||
{/* HTMX - v2.0.2 */} | ||
<!-- <script is:inline src="https://unpkg.com/[email protected]" integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ" crossorigin="anonymous" /> --> | ||
{/* | ||
<script is:inline src="https://unpkg.com/[email protected]" integrity="sha384-Y7hw+L/jvKeWIRRkqWYfPcvVxHzVzn5REgzbawhxAuQGwX1XWe70vji+VSeHOThJ" crossorigin="anonymous" /> | ||
*/} | ||
|
||
{/* Global Metadata */} | ||
<meta charset="utf-8" /> | ||
|
@@ -33,20 +37,10 @@ const { title, description } = Astro.props; | |
<meta name="title" content={title} /> | ||
<meta name="description" content={description} /> | ||
|
||
{/* Open Graph / Facebook / Twitter */} | ||
{ !isDashboardRoute(Astro.url.pathname) && ( | ||
<meta property="og:type" content='website' /> | ||
<meta property="og:url" content={Astro.url} /> | ||
<meta property="og:title" content={title} /> | ||
<meta property="og:description" content={description} /> | ||
|
||
<meta property="twitter:card" content="summary_large_image" /> | ||
<meta property="twitter:url" content={Astro.url} /> | ||
<meta property="twitter:title" content={title} /> | ||
<meta property="twitter:description" content={description} /> | ||
)} | ||
|
||
{/* Astro Client Router (ViewTransitions) */} | ||
<ClientRouter /> | ||
|
||
{/* Fonts */} | ||
<link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href={onestWoff2} /> | ||
|
||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters