generated from avior/template-web-astro
@ -1,8 +1,7 @@
|
||||
---
|
||||
import Layout, { type Props as BaseProps } from './Layout.astro'
|
||||
import Header from 'components/global/Header.astro'
|
||||
import Footer from 'components/global/Footer.astro'
|
||||
import ButtonLink from 'components/global/ButtonLink.astro'
|
||||
import Button from 'components/global/Button.astro'
|
||||
import Breadcrumb from 'components/global/Breadcrumb.astro'
|
||||
|
||||
export interface Props extends BaseProps {
|
||||
@ -12,6 +11,7 @@ export interface Props extends BaseProps {
|
||||
text?: string
|
||||
target?: string
|
||||
}
|
||||
disabled?: string
|
||||
breadcrumb: Array<{
|
||||
text: string
|
||||
href?: string
|
||||
|
@ -1,27 +1,13 @@
|
||||
---
|
||||
import Favicon from '../components/Favicon/Favicon.astro'
|
||||
import IconSVG from '../assets/layouts/Base/favicon.svg'
|
||||
import IconPNG from '../assets/layouts/Base/favicon.png'
|
||||
import '@fontsource-variable/lexend'
|
||||
import Head, { type Props as HeadProps } from './Head.astro'
|
||||
|
||||
export interface Props {
|
||||
title: string
|
||||
}
|
||||
|
||||
const { title } = Astro.props;
|
||||
export interface Props extends HeadProps {}
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="fr" prefix="og: https://ogp.me/ns#">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="Astro description">
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<!-- Analytics -->
|
||||
<script defer data-domain="avior.me" src="/js/script.js"></script>
|
||||
|
||||
<Favicon svg={IconSVG} png={IconPNG} icoPath="/favicon.ico" />
|
||||
<title>{title}</title>
|
||||
<Head {...Astro.props} />
|
||||
</head>
|
||||
<body class="bg-blue-50 dark:bg-slate-950 text-slate-950 dark:text-blue-50">
|
||||
<slot />
|
||||
|
106
src/layouts/Head.astro
Normal file
106
src/layouts/Head.astro
Normal file
@ -0,0 +1,106 @@
|
||||
---
|
||||
import Favicon from '../components/Favicon/Favicon.astro'
|
||||
import IconSVG from '../assets/layouts/Base/favicon.svg'
|
||||
import IconPNG from '../assets/layouts/Base/favicon.png'
|
||||
import '@fontsource-variable/lexend'
|
||||
|
||||
export interface Props {
|
||||
siteName?: string
|
||||
title?: string
|
||||
description?: string
|
||||
canonical?: string
|
||||
image?: Array<typeof IconPNG>
|
||||
twitter?: {
|
||||
title?: string
|
||||
card?: "summary" | "summary_large_image" | "app" | "player"
|
||||
site?: string
|
||||
creator?: string
|
||||
}
|
||||
og?: {
|
||||
title?: string
|
||||
type?: string
|
||||
description?: string
|
||||
url?: string
|
||||
}
|
||||
}
|
||||
|
||||
const props = Astro.props
|
||||
---
|
||||
|
||||
<!-- Charset -->
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<!-- Viewport -->
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
|
||||
|
||||
<!-- Analytics -->
|
||||
<script defer data-domain="avior.me" src="/js/script.js"></script>
|
||||
|
||||
<!-- Favicon -->
|
||||
<Favicon svg={IconSVG} png={IconPNG} icoPath="/favicon.ico" />
|
||||
|
||||
<!-- OpenGraph Sitename -->
|
||||
{props.siteName && (
|
||||
<meta property="og:site_name" content={props.siteName} />
|
||||
)}
|
||||
|
||||
<!-- Title -->
|
||||
{props.title && (
|
||||
<title>{props.title}</title>
|
||||
// <meta property="twitter:title" content={props.twitter?.title ?? props.title} />
|
||||
)}
|
||||
|
||||
<!-- Description -->
|
||||
{props.description && (
|
||||
<meta name="description" content={props.description} />
|
||||
)}
|
||||
|
||||
<!-- Canonical -->
|
||||
{(typeof props.canonical === 'string' || typeof props.canonical == 'undefined') && (
|
||||
<link rel="canonical" href={props.canonical ?? Astro.url.href} />
|
||||
)}
|
||||
|
||||
<!-- Twitter -->
|
||||
<!-- Twitter Card -->
|
||||
<meta property="twitter:card" content={props.twitter?.card ?? 'summary'} />
|
||||
|
||||
<!-- Twitter Site -->
|
||||
{props.twitter?.site && (
|
||||
<meta property="twitter:site" content={props.twitter.site} />
|
||||
)}
|
||||
|
||||
<!-- Twitter Creator -->
|
||||
{props.twitter?.creator && (
|
||||
<meta property="twitter:creator" content={props.twitter.creator} />
|
||||
)}
|
||||
|
||||
<!-- Twitter Title -->
|
||||
{(props.twitter?.title ?? props.title) && (
|
||||
<meta property="twitter:title" content={props.twitter?.title ?? props.title} />
|
||||
)}
|
||||
|
||||
<!-- OpenGraph -->
|
||||
<!-- OpenGraph Title -->
|
||||
{(props.og?.title ?? props.title) && (
|
||||
<meta property="og:title" content={props.og?.title ?? props.title} />
|
||||
)}
|
||||
|
||||
<!-- OpenGraph Description -->
|
||||
{(props.og?.description ?? props.description) && (
|
||||
<meta property="og:description" content={props.og?.description ?? props.description} />
|
||||
)}
|
||||
|
||||
<!-- OpenGraph Type -->
|
||||
<meta property="og:type" content={props.og?.type ?? 'website'} />
|
||||
|
||||
<!-- OpenGraph URL -->
|
||||
<meta property="og:url" content={props.og?.url ?? Astro.url.href} />
|
||||
|
||||
<!-- OpenGraph Image -->
|
||||
{props.image?.map((img) => (
|
||||
<meta property="og:image" content={img.src} />
|
||||
<meta property="og:image:type" content={`image/${img.format}`} />
|
||||
<meta property="og:image:width" content={img.width.toString()} />
|
||||
<meta property="og:image:height" content={img.height.toString()} />
|
||||
))}
|
Reference in New Issue
Block a user