53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
---
|
|
import { getCollection, render } from 'astro:content';
|
|
import Base from '../../layouts/Base.astro';
|
|
|
|
export async function getStaticPaths() {
|
|
const fichas = (await getCollection('fichas'))
|
|
.filter(f => f.data.semaforo === 'verde' || f.data.semaforo === 'propio');
|
|
return fichas.map(f => ({ params: { slug: f.id }, props: { ficha: f } }));
|
|
}
|
|
|
|
const { ficha } = Astro.props;
|
|
const d = ficha.data;
|
|
const { Content } = await render(ficha);
|
|
|
|
/* schema.org — para que un buscador (o un modelo) pueda leer la procedencia
|
|
sin adivinarla. 9-1 §2: «fichas públicas + schema.org para GEO». */
|
|
const jsonld = {
|
|
'@context': 'https://schema.org',
|
|
'@type': 'CreativeWork',
|
|
name: d.tituloCompleto ?? d.titulo,
|
|
alternateName: d.titulo,
|
|
inLanguage: 'es',
|
|
datePublished: String(d.anio),
|
|
isPartOf: d.obra,
|
|
creditText: d.credito,
|
|
...(d.atribuido
|
|
? { author: { '@type': 'Person', name: d.autor.replace(/^Atribuido a /, '') },
|
|
creativeWorkStatus: 'Autoría tradicional no verificada paleográficamente' }
|
|
: { author: { '@type': 'Person', name: d.autor } }),
|
|
};
|
|
---
|
|
<Base
|
|
titulo={`${d.palabra} — ${d.autor}`}
|
|
descripcion={d.resumen}
|
|
ruta={`/ficha/${ficha.id}/`}
|
|
og={`/og/${ficha.id}.png`}
|
|
>
|
|
<h1>{d.palabra}</h1>
|
|
|
|
<p class="credito">{d.credito}</p>
|
|
|
|
<ul class="marcas">
|
|
<li>Dominio público</li>
|
|
{d.atribuido && <li>Atribuido</li>}
|
|
{d.fragmento && <li>Fragmento</li>}
|
|
<li>{d.anio}</li>
|
|
</ul>
|
|
|
|
<Content />
|
|
|
|
<script type="application/ld+json" set:html={JSON.stringify(jsonld)} is:inline />
|
|
</Base>
|