feat(bibliotheque): étape E, la fiche (bandeau « non relu » avant le texte, sommaire, Agrandir) et sa page à elle /bibliotheque/fiche/<slug>, rendue au serveur, noindex tant que non relue

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jules
2026-11-19 08:30:03 +01:00
co-authored by Claude Opus 5.5
parent 52384ded3c
commit 293395d340
2 changed files with 142 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
<!--
/bibliotheque/fiche/<slug> — lot B9. La page à elle d'une fiche de lecture servie, rendue au serveur.
`noindex` tant que la fiche n'a pas été relue (bandeau) ; route dynamique : hors du sitemap par
construction (utils/seo.ts, cheminsSitemap). Un socle non servi répond 404, comme l'API.
-->
<template>
<main class="flp">
<nav class="flp__retour" aria-label="Fil d’Ariane">
<NuxtLink to="/bibliotheque">Bibliothèque</NuxtLink>
<span aria-hidden="true"> › </span>
<NuxtLink :to="`/bibliotheque?vue=mixte&fiche=${fiche.id}`">voir dans l’arborescence</NuxtLink>
</nav>
<article class="flp__article">
<h1 class="flp__titre">{{ fiche.titre }}</h1>
<p class="flp__meta">{{ fiche.auteurs }} · {{ anneeTexte(fiche.annee) }} · {{ fiche.regime }}</p>
<BibliothequeFicheLecture :fiche="fiche" sommaire />
</article>
</main>
</template>
<script setup lang="ts">
import { anneeTexte } from '~/utils/bibliotheque/arbre'
const route = useRoute()
const slug = String(route.params.slug ?? '')
const { data } = await useAsyncData(`bibliotheque-page-${slug}`, () => $fetch<any>(`/api/bibliotheque/fiche/${slug}`).catch(() => null))
if (!data.value) throw createError({ statusCode: 404, statusMessage: 'Fiche introuvable ou pas encore ouverte', fatal: true })
const fiche = computed(() => data.value)
useSeoMeta({
title: () => `${fiche.value.titre} — fiche de lecture — Bibliothèque AEP`,
description: () => `${fiche.value.titre}, ${fiche.value.auteurs} : fiche de lecture composée depuis les notes d’AEP, pas encore relue.`,
robots: () => (fiche.value.relecture_humaine ? undefined : 'noindex, follow'),
})
</script>
<style scoped>
.flp { height: 100%; overflow-y: auto; padding: var(--space-md) var(--space-md) var(--space-xl); color: var(--text); background: var(--surface); }
.flp__retour { max-width: 68ch; margin: 0 auto var(--space-sm); font-size: var(--fs-sm); }
.flp__retour a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.flp__retour a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.flp__article { max-width: 68ch; margin: 0 auto; }
.flp__titre { margin: 0 0 var(--space-2xs); font-size: var(--fs-2xl, var(--fs-xl)); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.flp__meta { margin: 0 0 var(--space-md); font-size: var(--fs-sm); color: color-mix(in srgb, var(--text) 78%, transparent); }
@media (max-width: 640px) { .flp { padding: var(--space-sm) var(--space-sm) var(--space-lg); } }
</style>