cleanup and cms migration
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -1,52 +0,0 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
import SEOHead from '../components/SEOHead.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import { getLangFromUrl } from '../i18n/utils';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
keywords?: string;
|
||||
ogImage?: string;
|
||||
canonical?: string;
|
||||
noindex?: boolean;
|
||||
pageType?: 'website' | 'article';
|
||||
}
|
||||
|
||||
const lang = getLangFromUrl(Astro.url);
|
||||
const props = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang={lang}>
|
||||
<head>
|
||||
<SEOHead {...props} />
|
||||
</head>
|
||||
<body>
|
||||
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
|
||||
<main id="main-content">
|
||||
<slot />
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style is:global>
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: -100%;
|
||||
left: 1rem;
|
||||
z-index: 9999;
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: var(--color-brand-600);
|
||||
color: #ffffff;
|
||||
font-weight: 700;
|
||||
border-radius: 0 0 4px 4px;
|
||||
transition: top 0.2s ease;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
top: 0;
|
||||
}
|
||||
</style>
|
||||
44
src/layouts/base.astro
Normal file
44
src/layouts/base.astro
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { getLocale } from '@/lib/locale';
|
||||
import SEOHead from '@/components/seo-head.astro';
|
||||
import Header from '@/components/header';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
keywords?: string;
|
||||
ogImage?: string;
|
||||
canonical?: string;
|
||||
noindex?: boolean;
|
||||
pageType?: 'website' | 'article';
|
||||
}
|
||||
|
||||
const props = Astro.props;
|
||||
const locale = getLocale(Astro);
|
||||
|
||||
const [navEntry] = await getCollection('navigation', (e) => e.id === `${locale}/main`);
|
||||
if (!navEntry) throw new Error(`Missing navigation content for locale: ${locale}`);
|
||||
|
||||
const nav = navEntry.data;
|
||||
const navigationItems = nav.links.map((link) => ({ name: link.name, href: link.href }));
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang={locale}>
|
||||
<head>
|
||||
<SEOHead {...props} />
|
||||
</head>
|
||||
<body>
|
||||
<Header
|
||||
navigation={navigationItems}
|
||||
ctaLabel={nav.cta.label}
|
||||
ctaHref={nav.cta.href}
|
||||
client:load
|
||||
/>
|
||||
<main id="main-content">
|
||||
<slot />
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user