feat(site): design fiche technique, rubriques, filtres par tags, à propos et contact
This commit is contained in:
1 parent
693f30bca3
commit
dd66a63029
26 files changed
+671
-379
No files matched your search
@@ -15,6 +15,20 @@ const fullTitle = title ? `${title} · ${SITE_TITLE}` : SITE_TITLE;
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<script is:inline>
|
||||
(() => {
|
||||
let theme;
|
||||
try {
|
||||
theme = localStorage.getItem('theme');
|
||||
} catch {
|
||||
/* stockage indisponible */
|
||||
}
|
||||
if (theme !== 'light' && theme !== 'dark') {
|
||||
theme = matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
document.documentElement.dataset.theme = theme;
|
||||
})();
|
||||
</script>
|
||||
<BaseHead title={fullTitle} description={description} />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import Base from './Base.astro';
|
||||
import FiltresProjets from '../components/FiltresProjets.astro';
|
||||
import { RUBRIQUES, type Rubrique } from '../consts';
|
||||
|
||||
interface Props {
|
||||
rubrique: Rubrique;
|
||||
projets: CollectionEntry<'projets'>[];
|
||||
}
|
||||
|
||||
const { rubrique, projets } = Astro.props;
|
||||
const { titre, chapeau } = RUBRIQUES[rubrique];
|
||||
---
|
||||
<Base title={titre}>
|
||||
<section class="accroche">
|
||||
<p class="etiquette">[{titre.toLowerCase()}]</p>
|
||||
<h1>{titre}</h1>
|
||||
<p class="chapeau">{chapeau}</p>
|
||||
</section>
|
||||
<section>
|
||||
<FiltresProjets rubrique={rubrique} projets={projets} />
|
||||
</section>
|
||||
</Base>
|
||||
@@ -2,19 +2,37 @@
|
||||
import type { CollectionEntry } from 'astro:content';
|
||||
import { Image } from 'astro:assets';
|
||||
import Base from './Base.astro';
|
||||
import { BESOINS, DOMAINES, RUBRIQUES } from '../consts';
|
||||
|
||||
type Props = CollectionEntry<'projets'>['data'];
|
||||
const { titre, resume, technos, image, imageAlt, lien } = Astro.props;
|
||||
const {
|
||||
titre, resume, date, categorie, client, besoins, domaines, technos, image, imageAlt, lien,
|
||||
} = Astro.props;
|
||||
|
||||
const rubrique = categorie === 'atelier' ? 'atelier' : 'realisations';
|
||||
const dateTexte = date.toLocaleDateString('fr-FR', { month: 'long', year: 'numeric' });
|
||||
const etiquettes =
|
||||
categorie === 'atelier' ? domaines.map((d) => DOMAINES[d]) : besoins.map((b) => BESOINS[b]);
|
||||
---
|
||||
<Base title={titre} description={resume}>
|
||||
<article>
|
||||
{image && <Image src={image} alt={imageAlt ?? ''} />}
|
||||
<article class="fiche">
|
||||
<p class="etiquette"><a href={`/${rubrique}/`}>{RUBRIQUES[rubrique].titre}</a> /</p>
|
||||
<h1>{titre}</h1>
|
||||
<p>{resume}</p>
|
||||
<ul class="technos">
|
||||
{technos.map((t) => <li>{t}</li>)}
|
||||
</ul>
|
||||
<slot />
|
||||
{lien && <p><a href={lien}>Voir le projet</a></p>}
|
||||
<p class="chapeau">{resume}</p>
|
||||
|
||||
<dl class="cartouche">
|
||||
<dt>Date</dt>
|
||||
<dd>{dateTexte}</dd>
|
||||
{client && (<><dt>Pour</dt><dd>{client}</dd></>)}
|
||||
{etiquettes.length > 0 && (
|
||||
<><dt>{categorie === 'atelier' ? 'Domaine' : 'Besoin'}</dt><dd>{etiquettes.join(', ')}</dd></>
|
||||
)}
|
||||
<dt>Technos</dt>
|
||||
<dd><ul class="technos">{technos.map((t) => <li>{t}</li>)}</ul></dd>
|
||||
</dl>
|
||||
|
||||
{image && <Image src={image} alt={imageAlt ?? ''} class="illustration" />}
|
||||
<div class="contenu"><slot /></div>
|
||||
{lien && <p><a class="bouton" href={lien}>Voir le projet</a></p>}
|
||||
</article>
|
||||
</Base>
|
||||
Reference in new issue
Block a user