diff --git a/Cargo.lock b/Cargo.lock index 072424ea..1aa8450f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1109,6 +1109,7 @@ name = "drust" version = "0.0.4" dependencies = [ "pagetop", + "pagetop-bootsier", ] [[package]] @@ -2384,6 +2385,15 @@ dependencies = [ "unic-langid", ] +[[package]] +name = "pagetop-bootsier" +version = "0.0.18" +dependencies = [ + "pagetop", + "pagetop-build", + "static-files", +] + [[package]] name = "pagetop-build" version = "0.0.14" @@ -2441,6 +2451,7 @@ name = "pagetop-website" version = "0.0.11" dependencies = [ "pagetop", + "pagetop-bootsier", "pagetop-build", "pagetop-mdbook", "serde", diff --git a/Cargo.toml b/Cargo.toml index 2d2683a0..b1311d4b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ members = [ # Themes #"packages/pagetop-aliner", - #"packages/pagetop-bootsier", + "packages/pagetop-bootsier", # Apps "website", @@ -46,4 +46,4 @@ pagetop-hljs = { version = "0.0", path = "packages/pagetop-hljs" } # Themes #pagetop-aliner = { version = "0.0", path = "packages/pagetop-aliner" } -#pagetop-bootsier = { version = "0.0", path = "packages/pagetop-bootsier" } +pagetop-bootsier = { version = "0.0", path = "packages/pagetop-bootsier" } diff --git a/README.md b/README.md index 01f97b9d..39b28678 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,12 @@ El código se organiza en un *workspace* con los siguientes subproyectos: utiliza [HighlightJS](https://highlightjs.org) para mostrar fragmentos de código con resaltado de sintaxis con `PageTop`. +## Temas + + * **[pagetop-bootsier](https://github.com/manuelcillero/pagetop/tree/latest/packages/pagetop-bootsier)**, + tema para `PageTop` que usa [Bootstrap](https://getbootstrap.com) para dar vida a tus diseños + web. + ## Aplicaciones * **[drust](https://github.com/manuelcillero/pagetop/tree/latest/drust)**, es una aplicación que diff --git a/config/default.toml b/config/default.toml index 3c61765c..656883a8 100644 --- a/config/default.toml +++ b/config/default.toml @@ -1,6 +1,6 @@ [app] #theme = "Aliner" -#theme = "Bootsier" +theme = "Bootsier" language = "es-ES" [log] diff --git a/drust/Cargo.toml b/drust/Cargo.toml index 943bccf2..5c01b95c 100644 --- a/drust/Cargo.toml +++ b/drust/Cargo.toml @@ -15,9 +15,8 @@ authors.workspace = true [dependencies] pagetop.workspace = true +pagetop-bootsier.workspace = true -# Packages. -#pagetop-bootsier.workspace = true #pagetop-admin = { version = "0.0", path = "../pagetop-admin" } #pagetop-user = { version = "0.0", path = "../pagetop-user" } #pagetop-node = { version = "0.0", path = "../pagetop-node" } diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 00000000..085a6cda --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1 @@ +pagetop-aliner/** diff --git a/packages/pagetop-bootsier/.gitattributes b/packages/pagetop-bootsier/.gitattributes new file mode 100644 index 00000000..940d6a84 --- /dev/null +++ b/packages/pagetop-bootsier/.gitattributes @@ -0,0 +1 @@ +static/** linguist-vendored diff --git a/packages/pagetop-bootsier/Cargo.toml b/packages/pagetop-bootsier/Cargo.toml new file mode 100644 index 00000000..5f1aa3b1 --- /dev/null +++ b/packages/pagetop-bootsier/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pagetop-bootsier" +version = "0.0.18" +edition = "2021" + +description = """\ + Tema para PageTop que usa Bootstrap para dar vida a tus diseños web.\ +""" +categories = ["web-programming", "gui"] +keywords = ["pagetop", "theme", "bootstrap", "css", "js"] + +homepage = { workspace = true } +repository = { workspace = true } +authors = { workspace = true } +license = { workspace = true } + +[dependencies] +pagetop.workspace = true + +static-files.workspace = true + +[build-dependencies] +pagetop-build.workspace = true diff --git a/packages/pagetop-bootsier/README.md b/packages/pagetop-bootsier/README.md new file mode 100644 index 00000000..58c0a1dd --- /dev/null +++ b/packages/pagetop-bootsier/README.md @@ -0,0 +1,39 @@ +
+ +

PageTop Bootsier

+ +

Tema para PageTop que usa Bootstrap para dar vida a tus diseños web.

+ +[![Licencia](https://img.shields.io/badge/license-MIT%2FApache-blue.svg?label=Licencia&style=for-the-badge)](#-license) +[![Doc API](https://img.shields.io/docsrs/pagetop-bootsier?label=Doc%20API&style=for-the-badge&logo=Docs.rs)](https://docs.rs/pagetop-bootsier) +[![Crates.io](https://img.shields.io/crates/v/pagetop-bootsier.svg?style=for-the-badge&logo=ipfs)](https://crates.io/crates/pagetop-bootsier) +[![Descargas](https://img.shields.io/crates/d/pagetop-bootsier.svg?label=Descargas&style=for-the-badge&logo=transmission)](https://crates.io/crates/pagetop-bootsier) + +
+ +## Sobre PageTop + +[PageTop](https://docs.rs/pagetop) es un entorno de desarrollo que reivindica la esencia de la web +clásica para crear soluciones web SSR (*renderizadas en el servidor*) modulares, extensibles y +configurables, basadas en HTML, CSS y JavaScript. + + +# 🚧 Advertencia + +`PageTop` es un proyecto personal que hago por diversión para aprender cosas nuevas. Está en +desarrollo activo, su API es inestable y está sujeta a cambios frecuentes. No recomiendo su uso en +producción, al menos hasta liberar la versión **1.0.0**. + + +# 📜 Licencia + +El código está disponible bajo una doble licencia: + + * **Licencia MIT** + ([LICENSE-MIT](LICENSE-MIT) o también https://opensource.org/licenses/MIT) + + * **Licencia Apache, Versión 2.0** + ([LICENSE-APACHE](LICENSE-APACHE) o también https://www.apache.org/licenses/LICENSE-2.0) + +Puedes elegir la licencia que prefieras. Este enfoque de doble licencia es el estándar de facto en +el ecosistema Rust. diff --git a/packages/pagetop-bootsier/build.rs b/packages/pagetop-bootsier/build.rs new file mode 100644 index 00000000..7cccc663 --- /dev/null +++ b/packages/pagetop-bootsier/build.rs @@ -0,0 +1,19 @@ +use pagetop_build::StaticFilesBundle; + +use std::env; +use std::path::Path; + +fn main() -> std::io::Result<()> { + StaticFilesBundle::from_scss("./static/bs-5.3.3/scss/bootstrap.scss", "bootstrap.min.css") + .with_name("bootsier_bs") + .build()?; + StaticFilesBundle::from_dir("./static/bs-5.3.3/js", Some(bootstrap_js_files)) + .with_name("bootsier_js") + .build() +} + +fn bootstrap_js_files(path: &Path) -> bool { + // No filtra durante el desarrollo, solo en la compilación "release". + env::var("PROFILE").unwrap_or_else(|_| "release".to_string()) != "release" + || path.file_name().map_or(false, |n| n == "bootstrap.min.js") +} diff --git a/packages/pagetop-bootsier/src/bs.rs b/packages/pagetop-bootsier/src/bs.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/packages/pagetop-bootsier/src/bs.rs @@ -0,0 +1 @@ + diff --git a/packages/pagetop-bootsier/src/lib.rs b/packages/pagetop-bootsier/src/lib.rs new file mode 100644 index 00000000..6c2d1b13 --- /dev/null +++ b/packages/pagetop-bootsier/src/lib.rs @@ -0,0 +1,202 @@ +use pagetop::prelude::*; + +// GLOBAL ****************************************************************************************** + +include_files!(bootsier_bs); +include_files!(bootsier_js); + +include_locales!(LOCALES_BOOTSIER); + +const BOOTSTRAP_VERSION: &str = "5.3.3"; // Versión de la librería Bootstrap. + +// API ********************************************************************************************* + +pub mod bs; + +pub struct Bootsier; + +impl PackageTrait for Bootsier { + fn theme(&self) -> Option { + Some(&Bootsier) + } + + fn actions(&self) -> Vec { + actions![ + // action::theme::BeforePrepare::::new(&Self, before_prepare_icon), + // action::theme::BeforePrepare::