From fd54389cd515fda18392d8b47738a99c90f4696e Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Thu, 2 Feb 2023 08:45:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20[aliner]=20Saca=20tema=20del=20c?= =?UTF-8?q?=C3=B3digo=20base=20de=20PageTop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagetop-aliner/Cargo.toml | 23 ++ pagetop-aliner/README.md | 27 ++ pagetop-aliner/build.rs | 3 + pagetop-aliner/src/lib.rs | 30 +++ pagetop-aliner/static/css/styles.css | 356 +++++++++++++++++++++++++++ 5 files changed, 439 insertions(+) create mode 100644 pagetop-aliner/Cargo.toml create mode 100644 pagetop-aliner/README.md create mode 100644 pagetop-aliner/build.rs create mode 100644 pagetop-aliner/src/lib.rs create mode 100644 pagetop-aliner/static/css/styles.css diff --git a/pagetop-aliner/Cargo.toml b/pagetop-aliner/Cargo.toml new file mode 100644 index 00000000..17a359fa --- /dev/null +++ b/pagetop-aliner/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pagetop-aliner" +version = "0.0.1" +edition = "2021" + +authors = [ + "Manuel Cillero " +] +description = """\ + Theme for PageTop that uses minimal CSS with bounding boxes for page layout and component \ + display.\ +""" +homepage = "https://pagetop.cillero.es" +repository = "https://github.com/manuelcillero/pagetop" +license = "Apache-2.0 OR MIT" + +[dependencies] +pagetop = { path = "../pagetop", version = "0.0" } +static-files = "0.2.3" +maud = "0.24.0" + +[build-dependencies] +pagetop-build = { path = "../pagetop-build", version = "0.0" } diff --git a/pagetop-aliner/README.md b/pagetop-aliner/README.md new file mode 100644 index 00000000..f35e4f1a --- /dev/null +++ b/pagetop-aliner/README.md @@ -0,0 +1,27 @@ +Tema para **PageTop** que define un conjunto mínimo de estilos con cajas delimitadas por bordes para +la composición de páginas y visualización de componentes. + +[PageTop](https://github.com/manuelcillero/pagetop/tree/main/pagetop), es un entorno de desarrollo +basado en algunos de los *crates* más estables y populares del ecosistema Rust para proporcionar +APIs, patrones de desarrollo y buenas prácticas para la creación de soluciones web SSR (*Server-Side +Rendering*). + + +# 🚧 Advertencia + +**PageTop** sólo libera actualmente versiones de desarrollo. La API no es estable y los cambios son +constantes. No puede considerarse preparado hasta que se libere la versión **0.1.0**. + + +# 📜 Licencia + +Este proyecto tiene licencia, de hecho tiene dos, puedes aplicar cualquiera de las siguientes a tu +elección: + +* Licencia Apache versión 2.0 + ([LICENSE-APACHE](https://github.com/manuelcillero/pagetop/blob/main/LICENSE-APACHE) o + [http://www.apache.org/licenses/LICENSE-2.0]). + +* Licencia MIT + ([LICENSE-MIT](https://github.com/manuelcillero/pagetop/blob/main/LICENSE-MIT) o + [http://opensource.org/licenses/MIT]). diff --git a/pagetop-aliner/build.rs b/pagetop-aliner/build.rs new file mode 100644 index 00000000..ba1cd204 --- /dev/null +++ b/pagetop-aliner/build.rs @@ -0,0 +1,3 @@ +fn main() -> std::io::Result<()> { + pagetop_build::bundle_resources("./static", "aliner", None) +} diff --git a/pagetop-aliner/src/lib.rs b/pagetop-aliner/src/lib.rs new file mode 100644 index 00000000..c4fe9935 --- /dev/null +++ b/pagetop-aliner/src/lib.rs @@ -0,0 +1,30 @@ +use pagetop::prelude::*; + +pub_handle!(THEME_ALINER); + +include!(concat!(env!("OUT_DIR"), "/aliner.rs")); + +pub struct Aliner; + +impl ModuleTrait for Aliner { + fn handle(&self) -> Handle { + THEME_ALINER + } + + fn theme(&self) -> Option { + Some(&Aliner) + } + + fn configure_service(&self, cfg: &mut server::web::ServiceConfig) { + serve_static_files!(cfg, "/aliner", bundle_aliner); + } +} + +impl ThemeTrait for Aliner { + fn before_render_page(&self, page: &mut Page) { + page.alter_favicon(Some(Favicon::new().with_icon("/theme/favicon.ico"))) + .alter_context(ContextOp::AddStyleSheet( + StyleSheet::located("/aliner/css/styles.css").with_weight(-99), + )); + } +} diff --git a/pagetop-aliner/static/css/styles.css b/pagetop-aliner/static/css/styles.css new file mode 100644 index 00000000..1cc2f5dc --- /dev/null +++ b/pagetop-aliner/static/css/styles.css @@ -0,0 +1,356 @@ +html { + background-color: white; + padding: 1px 3px; +} +body { + padding: 1px 3px; +} +div { + padding: 1px 3px; + margin: 5px; +} +h1, h2, h3, h4,h5, h6, p { + background-color: snow; +} +* * { + outline: 5px solid rgba(255,0,0,.1); +} +* * * { + outline: 3px dashed rgba(255,0,0,.4); +} +* * * * { + outline: 2px dotted rgba(255,0,0,.6); +} +* * * * * { + outline: 1px dotted rgba(255,0,0,.9); +} +* * * * * * { + outline-color: gray; +} + +*::before, *::after { + background: #faa; + border-radius: 3px; + font: normal normal 400 10px/1.2 monospace; + vertical-align: middle; + padding: 1px 3px; + margin: 0 3px; +} +*::before { + content: "("; +} +*::after { + content: ")"; +} + +a::before { content: ""; } +a::after { content: ""; } +abbr::before { content: ""; } +abbr::after { content: ""; } +acronym::before { content: ""; } +acronym::after { content: ""; } +address::before { content: "
"; } +address::after { content: "
"; } +applet::before { content: ""; } +applet::after { content: ""; } +area::before { content: ""; } +area::after { content: ""; } +article::before { content: "
"; } +article::after { content: "
"; } +aside::before { content: ""; } +audio::before { content: ""; } + +b::before { content: ""; } +b::after { content: ""; } +base::before { content: ""; } +base::after { content: ""; } +basefont::before { content: ""; } +basefont::after { content: ""; } +bdi::before { content: ""; } +bdi::after { content: ""; } +bdo::before { content: ""; } +bdo::after { content: ""; } +bgsound::before { content: ""; } +bgsound::after { content: ""; } +big::before { content: ""; } +big::after { content: ""; } +blink::before { content: ""; } +blink::after { content: ""; } +blockquote::before { content: "
"; } +blockquote::after { content: "
"; } +body::before { content: ""; } +body::after { content: ""; } +br::before { content: "
"; } +br::after { content: "
"; } +button::before { content: ""; } + +caption::before { content: ""; } +caption::after { content: ""; } +canvas::before { content: ""; } +canvas::after { content: ""; } +center::before { content: "
"; } +center::after { content: "
"; } +cite::before { content: ""; } +cite::after { content: ""; } +code::before { content: ""; } +code::after { content: ""; } +col::before { content: ""; } +col::after { content: ""; } +colgroup::before { content: ""; } +colgroup::after { content: ""; } +command::before { content: ""; } +command::after { content: ""; } +content::before { content: ""; } +content::after { content: ""; } + +data::before { content: ""; } +data::after { content: ""; } +datalist::before { content: ""; } +datalist::after { content: ""; } +dd::before { content: "
"; } +dd::after { content: "
"; } +del::before { content: ""; } +del::after { content: ""; } +details::before { content: "
"; } +details::after { content: "
"; } +dfn::before { content: ""; } +dfn::after { content: ""; } +dialog::before { content: ""; } +dialog::after { content: ""; } +dir::before { content: ""; } +dir::after { content: ""; } +div::before { content: "
"; } +div::after { content: "
"; } +dl::before { content: "
"; } +dl::after { content: "
"; } +dt::before { content: "
"; } +dt::after { content: "
"; } + +element::before { content: ""; } +element::after { content: ""; } +em::before { content: ""; } +em::after { content: ""; } +embed::before { content: ""; } +embed::after { content: ""; } + +fieldset::before { content: "
"; } +fieldset::after { content: "
"; } +figcaption::before { content: "
"; } +figcaption::after { content: "
"; } +figure::before { content: "
"; } +figure::after { content: "
"; } +font::before { content: ""; } +font::after { content: ""; } +footer::before { content: "
"; } +footer::after { content: "
"; } +form::before { content: "
"; } +form::after { content: "
"; } +frame::before { content: ""; } +frame::after { content: ""; } +frameset::before { content: ""; } +frameset::after { content: ""; } + +h1::before { content: "

"; } +h1::after { content: "

"; } +h2::before { content: "

"; } +h2::after { content: "

"; } +h3::before { content: "

"; } +h3::after { content: "

"; } +h4::before { content: "

"; } +h4::after { content: "

"; } +h5::before { content: "
"; } +h5::after { content: "
"; } +h6::before { content: "
"; } +h6::after { content: "
"; } +head::before { content: ""; } +head::after { content: ""; } +header::before { content: "
"; } +header::after { content: "
"; } +hgroup::before { content: "
"; } +hgroup::after { content: "
"; } +hr::before { content: "
"; } +hr::after { content: ""; } +html::before { content: ""; } +html::after { content: ""; } + +i::before { content: ""; } +i::after { content: ""; } +iframe::before { content: ""; } +image::before { content: ""; } +image::after { content: ""; } +img::before { content: ""; } +img::after { content: ""; } +input::before { content: ""; } +input::after { content: ""; } +ins::before { content: ""; } +ins::after { content: ""; } +isindex::before { content: ""; } +isindex::after { content: ""; } + +kbd::before { content: ""; } +kbd::after { content: ""; } +keygen::before { content: ""; } +keygen::after { content: ""; } + +label::before { content: ""; } +legend::before { content: ""; } +legend::after { content: ""; } +li::before { content: "
  • "; } +li::after { content: "
  • "; } +link::before { content: ""; } +link::after { content: ""; } +listing::before { content: ""; } +listing::after { content: ""; } + +main::before { content: "
    "; } +main::after { content: "
    "; } +map::before { content: ""; } +map::after { content: ""; } +mark::before { content: ""; } +mark::after { content: ""; } +marquee::before { content: ""; } +marquee::after { content: ""; } +menu::before { content: ""; } +menu::after { content: ""; } +menuitem::before { content: ""; } +menuitem::after { content: ""; } +meta::before { content: ""; } +meta::after { content: ""; } +meter::before { content: ""; } +meter::after { content: ""; } +multicol::before { content: ""; } +multicol::after { content: ""; } + +nav::before { content: ""; } +nextid::before { content: ""; } +nextid::after { content: ""; } +nobr::before { content: ""; } +nobr::after { content: ""; } +noembed::before { content: ""; } +noembed::after { content: ""; } +noframes::before { content: ""; } +noframes::after { content: ""; } +noscript::before { content: ""; } + +object::before { content: ""; } +object::after { content: ""; } +ol::before { content: "
      "; } +ol::after { content: "
    "; } +optgroup::before { content: ""; } +optgroup::after { content: ""; } +option::before { content: ""; } +output::before { content: ""; } +output::after { content: ""; } + +p::before { content: "

    "; } +p::after { content: "

    "; } +param::before { content: ""; } +param::after { content: ""; } +picture::before { content: ""; } +picture::after { content: ""; } +plaintext::before { content: ""; } +plaintext::after { content: "</plaintext>"; } +pre::before { content: "<pre>"; } +pre::after { content: "</pre>"; } +progress::before { content: "<progress>"; } +progress::after { content: "</progress>"; } + +q::before { content: "<q>"; } +q::after { content: "</q>"; } + +rb::before { content: "<rb>"; } +rb::after { content: "</rb>"; } +rp::before { content: "<rp>"; } +rp::after { content: "</rp>"; } +rt::before { content: "<rt>"; } +rt::after { content: "</rt>"; } +rtc::before { content: "<rtc>"; } +rtc::after { content: "</rtc>"; } +ruby::before { content: "<ruby>"; } +ruby::after { content: "</ruby>"; } + +s::before { content: "<s>"; } +s::after { content: "</s>"; } +samp::before { content: "<samp>"; } +samp::after { content: "</samp>"; } +script::before { content: "<script>"; } +script::after { content: "</script>"; } +section::before { content: "<section>"; } +section::after { content: "</section>"; } +select::before { content: "<select>"; } +select::after { content: "</select>"; } +shadow::before { content: "<shadow>"; } +shadow::after { content: "</shadow>"; } +slot::before { content: "<slot>"; } +slot::after { content: "</slot>"; } +small::before { content: "<small>"; } +small::after { content: "</small>"; } +source::before { content: "<source>"; } +source::after { content: "</source>"; } +spacer::before { content: "<spacer>"; } +spacer::after { content: "</spacer>"; } +span::before { content: "<span>"; } +span::after { content: "</span>"; } +strike::before { content: "<strike>"; } +strike::after { content: "</strike>"; } +strong::before { content: "<strong>"; } +strong::after { content: "</strong>"; } +style::before { content: "<style>"; } +style::after { content: "<\/style>"; } +sub::before { content: "<sub>"; } +sub::after { content: "</sub>"; } +summary::before { content: "<summary>"; } +summary::after { content: "</summary>"; } +sup::before { content: "<sup>"; } +sup::after { content: "</sup>"; } + +table::before { content: "<table>"; } +table::after { content: "</table>"; } +tbody::before { content: "<tbody>"; } +tbody::after { content: "</tbody>"; } +td::before { content: "<td>"; } +td::after { content: "</td>"; } +template::before { content: "<template>"; } +template::after { content: "</template>"; } +textarea::before { content: "<textarea>"; } +textarea::after { content: "</textarea>"; } +tfoot::before { content: "<tfoot>"; } +tfoot::after { content: "</tfoot>"; } +th::before { content: "<th>"; } +th::after { content: "</th>"; } +thead::before { content: "<thead>"; } +thead::after { content: "</thead>"; } +time::before { content: "<time>"; } +time::after { content: "</time>"; } +title::before { content: "<title>"; } +title::after { content: "</title>"; } +tr::before { content: "<tr>"; } +tr::after { content: "</tr>"; } +track::before { content: "<track>"; } +track::after { content: "</track>"; } +tt::before { content: "<tt>"; } +tt::after { content: "</tt>"; } + +u::before { content: "<u>"; } +u::after { content: "</u>"; } +ul::before { content: "<ul>"; } +ul::after { content: "</ul>"; } + +var::before { content: "<var>"; } +var::after { content: "</var>"; } +video::before { content: "<video>"; } +video::after { content: "</video>"; } + +wbr::before { content: "<wbr>"; } +wbr::after { content: "</wbr>"; } + +xmp::before { content: "<xmp>"; } +xmp::after { content: "</xmp>"; }