(build): Introduce nuevas funciones de build

Añade `compile_scss()`, `copy_dir()`, `copy_file()`,
`copy_file_replacing()` y `minify_js()` para preparar activos en
`build.rs`. Adopta el patrón `assets/ -> static/`: los archivos
estáticos se mueven a `assets/` y `static/` se añade a `.gitignore`. Los
`build.rs` de *pagetop* y *pagetop-htmx* se actualizan con el nuevo
patrón.  La documentación del módulo se reescribe para reflejar los
nuevos cambios.
This commit is contained in:
Manuel Cillero 2026-06-14 21:18:54 +02:00
parent 6376e3e88c
commit f27790c3a2
26 changed files with 468 additions and 236 deletions

View file

@ -1,7 +1,7 @@
/*!
<div align="center">
<img src="https://git.cillero.es/manuelcillero/pagetop/raw/branch/main/static/banner.png" />
<img src="https://git.cillero.es/manuelcillero/pagetop/raw/branch/main/assets/banner.png" />
<h1>PageTop</h1>
@ -86,7 +86,7 @@ estructurar e inicializar la aplicación de forma modular.
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_favicon_url = "https://git.cillero.es/manuelcillero/pagetop/raw/branch/main/static/favicon.ico"
html_favicon_url = "https://git.cillero.es/manuelcillero/pagetop/raw/branch/main/assets/favicon.ico"
)]
// Alias para que las rutas absolutas `::pagetop::...` generadas por las macros funcionen en el
@ -138,14 +138,14 @@ pub use pagetop_statics::{StaticFile, resource};
pub use getter_methods::Getters;
/// Contenedor para un conjunto de recursos embebidos.
/// Contenedor para un paquete de recursos embebidos.
#[derive(AutoDefault)]
pub struct StaticResources {
bundle: HashMap<&'static str, StaticFile>,
}
impl StaticResources {
/// Crea un contenedor para un conjunto de recursos generado por `build.rs` (consultar
/// Crea un contenedor para un paquete de recursos generado por `build.rs` (consultar
/// [`pagetop_build`](https://docs.rs/pagetop-build)).
pub fn new(bundle: HashMap<&'static str, StaticFile>) -> Self {
Self { bundle }