feat(proyectos): fase 2, colección de proyectos, lista y plantilla de ficha
- Seis fichas en src/content/proyectos con esquema zod (método obligatorio en métricas) - Diagramas SVG en src/diagramas incrustados con los tokens del tema - Componentes Meta, EstadoPill, ProyectoFila, Diagrama y FichaTecnica (siete bloques) - Layout Ficha con demostración al lado de la documentación (sticky en escritorio) - Páginas /proyectos y /proyectos/[slug]; tablas apiladas bajo 560 px - La cifra de sistemas en producción se calcula en el build desde la colección Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d4283163d
commit
eb9c2cebc1
24 files changed
+1162
-6
No files matched your search
@@ -0,0 +1,30 @@
|
||||
---
|
||||
/* Diagrama SVG del repositorio incrustado en la página para que use los tokens
|
||||
de color del tema. El SVG es decorativo para lectores de pantalla; la
|
||||
descripción va en aria-label del contenedor. */
|
||||
import { leerDiagrama } from '../lib/proyectos';
|
||||
interface Props {
|
||||
ruta: string;
|
||||
descripcion: string;
|
||||
}
|
||||
const { ruta, descripcion } = Astro.props;
|
||||
const svg = leerDiagrama(ruta).replace('<svg ', '<svg aria-hidden="true" focusable="false" ');
|
||||
---
|
||||
|
||||
<div class="diagrama" role="img" aria-label={descripcion} set:html={svg} />
|
||||
|
||||
<style>
|
||||
.diagrama {
|
||||
border: 1px solid var(--line);
|
||||
padding: 1rem;
|
||||
background: var(--bg-2);
|
||||
overflow-x: auto;
|
||||
font-family: var(--font-body);
|
||||
}
|
||||
.diagrama :global(svg) {
|
||||
display: block;
|
||||
min-width: 620px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
import { ESTADO_TEXTO } from '../lib/proyectos';
|
||||
interface Props {
|
||||
estado: keyof typeof ESTADO_TEXTO;
|
||||
}
|
||||
const { estado } = Astro.props;
|
||||
---
|
||||
|
||||
<span class:list={['pill', estado]}>{ESTADO_TEXTO[estado]}</span>
|
||||
|
||||
<style>
|
||||
.pill {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
padding: 0.3rem 0.6rem;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
white-space: nowrap;
|
||||
color: var(--fg-2);
|
||||
}
|
||||
.produccion {
|
||||
border-color: var(--ok);
|
||||
color: var(--ok);
|
||||
}
|
||||
.piloto {
|
||||
border-color: var(--warn);
|
||||
color: var(--warn);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,171 @@
|
||||
---
|
||||
/* Los siete bloques numerados de una ficha de proyecto. Recibe la entrada de la
|
||||
colección y el cuerpo ya renderizado (bloque 7, Estado). */
|
||||
import Diagrama from './Diagrama.astro';
|
||||
import type { Proyecto } from '../lib/proyectos';
|
||||
import { mesAnio } from '../lib/proyectos';
|
||||
|
||||
interface Props {
|
||||
proyecto: Proyecto;
|
||||
}
|
||||
const { data } = Astro.props.proyecto;
|
||||
const descripcionDiagrama = `Diagrama de arquitectura: ${data.arquitectura.principios.map((p) => p.titulo.replace(/\.$/, '')).join('; ')}.`;
|
||||
|
||||
export const BLOQUES = [
|
||||
{ id: 'operacion', titulo: 'La operación' },
|
||||
{ id: 'que-hace', titulo: 'Qué hace' },
|
||||
{ id: 'arquitectura', titulo: 'Arquitectura' },
|
||||
{ id: 'stack', titulo: 'Stack' },
|
||||
{ id: 'seguridad', titulo: 'Datos y seguridad' },
|
||||
{ id: 'metricas', titulo: 'Métricas con método' },
|
||||
{ id: 'estado', titulo: 'Estado' },
|
||||
] as const;
|
||||
---
|
||||
|
||||
<section class="bloque" id="operacion" aria-labelledby="h-operacion">
|
||||
<span class="n mono" aria-hidden="true">01</span>
|
||||
<h2 id="h-operacion">La operación</h2>
|
||||
<div class="grid g-4-8">
|
||||
<p class="callout"><strong>Antes:</strong> {data.operacion_antes}</p>
|
||||
<p class="muted">{data.operacion_ahora}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="que-hace" aria-labelledby="h-que-hace">
|
||||
<span class="n mono" aria-hidden="true">02</span>
|
||||
<h2 id="h-que-hace">Qué hace</h2>
|
||||
<div class="scroll">
|
||||
<table class="apilada">
|
||||
<thead><tr><th scope="col">Módulo</th><th scope="col">Qué resuelve</th><th scope="col">Cómo</th></tr></thead>
|
||||
<tbody>
|
||||
{data.modulos.map((m) => <tr><td data-th="Módulo"><strong>{m.nombre}</strong></td><td data-th="Qué resuelve">{m.resuelve}</td><td data-th="Cómo">{m.como}</td></tr>)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="arquitectura" aria-labelledby="h-arquitectura">
|
||||
<span class="n mono" aria-hidden="true">03</span>
|
||||
<h2 id="h-arquitectura">Arquitectura</h2>
|
||||
<Diagrama ruta={data.arquitectura.diagrama} descripcion={descripcionDiagrama} />
|
||||
<ul class="list principios">
|
||||
{data.arquitectura.principios.map((p) => <li><strong>{p.titulo}</strong> {p.texto}</li>)}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="stack" aria-labelledby="h-stack">
|
||||
<span class="n mono" aria-hidden="true">04</span>
|
||||
<h2 id="h-stack">Stack</h2>
|
||||
<div class="scroll">
|
||||
<table class="apilada">
|
||||
<thead><tr><th scope="col">Capa</th><th scope="col">Tecnología</th><th scope="col">Decisión</th></tr></thead>
|
||||
<tbody>
|
||||
{data.stack.map((s) => <tr><td data-th="Capa">{s.capa}</td><td data-th="Tecnología" class="k mono">{s.tecnologia}</td><td data-th="Decisión">{s.decision}</td></tr>)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="seguridad" aria-labelledby="h-seguridad">
|
||||
<span class="n mono" aria-hidden="true">05</span>
|
||||
<h2 id="h-seguridad">Datos y seguridad</h2>
|
||||
<ul class="list">
|
||||
{data.seguridad.map((s) => <li>{s}</li>)}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="metricas" aria-labelledby="h-metricas">
|
||||
<span class="n mono" aria-hidden="true">06</span>
|
||||
<h2 id="h-metricas">Métricas con método</h2>
|
||||
<div class="scroll">
|
||||
<table class="apilada">
|
||||
<thead><tr><th scope="col">Medición</th><th scope="col">Resultado</th><th scope="col">Cómo se mide</th><th scope="col">Periodo</th></tr></thead>
|
||||
<tbody>
|
||||
{
|
||||
data.metricas.map((m) => (
|
||||
<tr>
|
||||
<td data-th="Medición">{m.medicion}</td>
|
||||
<td data-th="Resultado" class="mono">{m.resultado ?? 'por medir'}</td>
|
||||
<td data-th="Cómo se mide">{m.metodo}</td>
|
||||
<td data-th="Periodo" class="periodo">{m.periodo ?? '—'}</td>
|
||||
</tr>
|
||||
))
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="fuente">Ninguna cifra se publica sin su método y su periodo de medición.</p>
|
||||
</section>
|
||||
|
||||
<section class="bloque" id="estado" aria-labelledby="h-estado">
|
||||
<span class="n mono" aria-hidden="true">07</span>
|
||||
<h2 id="h-estado">Estado</h2>
|
||||
<p class="eyebrow estado-eyebrow">En {data.estado === 'produccion' ? 'producción' : 'piloto'} desde {mesAnio(data.desde)}</p>
|
||||
<div class="muted cuerpo"><slot /></div>
|
||||
<p class="cta"><a class="link" href="/contacto">Solicitar demostración técnica</a></p>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.bloque {
|
||||
padding-block: clamp(2.2rem, 5vw, 3.5rem);
|
||||
}
|
||||
.bloque + .bloque {
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
.bloque h2 {
|
||||
margin-bottom: 1.2rem;
|
||||
scroll-margin-top: 5rem;
|
||||
}
|
||||
.n {
|
||||
color: var(--fg-3);
|
||||
font-size: 0.85rem;
|
||||
margin-bottom: 0.5rem;
|
||||
display: block;
|
||||
}
|
||||
.k {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.principios {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
.periodo {
|
||||
color: var(--fg-3);
|
||||
}
|
||||
/* Bajo 560 px cada fila de tabla se apila: una columna, con el encabezado delante de cada dato. */
|
||||
@media (max-width: 559px) {
|
||||
.apilada thead {
|
||||
display: none;
|
||||
}
|
||||
.apilada tr {
|
||||
display: block;
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding: 0.7rem 0;
|
||||
}
|
||||
.apilada td {
|
||||
display: grid;
|
||||
grid-template-columns: 6.5rem 1fr;
|
||||
gap: 0.6rem;
|
||||
border: 0;
|
||||
padding: 0.2rem 0;
|
||||
}
|
||||
.apilada td::before {
|
||||
content: attr(data-th);
|
||||
color: var(--fg-3);
|
||||
font-family: var(--font-body);
|
||||
font-size: 0.72rem;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
font-weight: 600;
|
||||
padding-top: 0.15em;
|
||||
}
|
||||
}
|
||||
.estado-eyebrow {
|
||||
margin-bottom: 0.8rem;
|
||||
}
|
||||
.cuerpo :global(p + p) {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.cta {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
/* Lista de datos (dl) con término y valor, para cabeceras de ficha y contacto. */
|
||||
interface Props {
|
||||
items: { termino: string; valor: string; mono?: boolean }[];
|
||||
}
|
||||
const { items } = Astro.props;
|
||||
---
|
||||
|
||||
<dl class="meta">
|
||||
{
|
||||
items.map((i) => (
|
||||
<div>
|
||||
<dt>{i.termino}</dt>
|
||||
<dd class:list={{ mono: i.mono }}>{i.valor}</dd>
|
||||
</div>
|
||||
))
|
||||
}
|
||||
</dl>
|
||||
|
||||
<style>
|
||||
.meta {
|
||||
display: grid;
|
||||
gap: 0.6rem;
|
||||
font-size: 0.9rem;
|
||||
border-left: 2px solid var(--line);
|
||||
padding-left: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
.meta div {
|
||||
display: grid;
|
||||
grid-template-columns: 8rem 1fr;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
dt {
|
||||
color: var(--fg-3);
|
||||
}
|
||||
dd {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
import EstadoPill from './EstadoPill.astro';
|
||||
import type { Proyecto } from '../lib/proyectos';
|
||||
interface Props {
|
||||
proyecto: Proyecto;
|
||||
}
|
||||
const { data } = Astro.props.proyecto;
|
||||
const href = `/proyectos/${data.slug}`;
|
||||
---
|
||||
|
||||
<article class="fila">
|
||||
<p class="sector">{data.sector}</p>
|
||||
<div>
|
||||
<h2 class="titulo"><a href={href}>{data.titulo}</a></h2>
|
||||
<p class="resumen">{data.resumen}</p>
|
||||
<p class="enlace"><a class="link" href={href} aria-label={`Ficha técnica: ${data.titulo}`}>Ficha técnica</a></p>
|
||||
</div>
|
||||
<EstadoPill estado={data.estado} />
|
||||
</article>
|
||||
|
||||
<style>
|
||||
.fila {
|
||||
border-top: 1px solid var(--line);
|
||||
padding: 1.6rem 0;
|
||||
display: grid;
|
||||
grid-template-columns: 9rem 1fr auto;
|
||||
gap: 1.5rem;
|
||||
align-items: start;
|
||||
}
|
||||
.fila:last-child {
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.sector {
|
||||
font-size: 0.8rem;
|
||||
color: var(--fg-3);
|
||||
line-height: 1.35;
|
||||
padding-top: 0.3rem;
|
||||
}
|
||||
.titulo {
|
||||
font-size: 1.35rem;
|
||||
font-variation-settings: 'opsz' 48;
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
.resumen {
|
||||
color: var(--fg-2);
|
||||
max-width: 62ch;
|
||||
}
|
||||
.enlace {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.fila {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
.sector {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user