Compare commits
No commits in common. "7d7920237f7320e496aa055aeeeba2dffe3492ae" and "66289e131e09b863ada64c779dadfe59f31d4c3f" have entirely different histories.
7d7920237f
...
66289e131e
7 changed files with 17 additions and 41 deletions
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -1569,7 +1569,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
|||
|
||||
[[package]]
|
||||
name = "pagetop"
|
||||
version = "0.0.14"
|
||||
version = "0.0.13"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-session",
|
||||
|
@ -1582,7 +1582,6 @@ dependencies = [
|
|||
"figlet-rs",
|
||||
"fluent-templates",
|
||||
"itoa",
|
||||
"pagetop-build",
|
||||
"pagetop-macros",
|
||||
"parking_lot",
|
||||
"pastey",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "pagetop"
|
||||
version = "0.0.14"
|
||||
version = "0.0.13"
|
||||
edition = "2021"
|
||||
|
||||
description = """\
|
||||
|
@ -42,7 +42,7 @@ static-files.workspace = true
|
|||
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
pagetop-macros.workspace = true
|
||||
pagetop-macros = { version = "0.0", path = "helpers/pagetop-macros" }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
@ -51,8 +51,6 @@ testing = []
|
|||
[dev-dependencies]
|
||||
tempfile = "3.20.0"
|
||||
|
||||
[build-dependencies]
|
||||
pagetop-build.workspace = true
|
||||
|
||||
|
||||
[workspace]
|
||||
|
@ -70,6 +68,3 @@ authors = ["Manuel Cillero <manuel@cillero.es>"]
|
|||
|
||||
[workspace.dependencies]
|
||||
static-files = "0.2.5"
|
||||
|
||||
pagetop-build = { version = "0.0", path = "helpers/pagetop-build" }
|
||||
pagetop-macros = { version = "0.0", path = "helpers/pagetop-macros" }
|
||||
|
|
7
build.rs
7
build.rs
|
@ -1,7 +0,0 @@
|
|||
use pagetop_build::StaticFilesBundle;
|
||||
|
||||
fn main() -> std::io::Result<()> {
|
||||
StaticFilesBundle::from_dir("./static", None)
|
||||
.with_name("assets")
|
||||
.build()
|
||||
}
|
|
@ -230,9 +230,15 @@ impl StaticFilesBundle {
|
|||
// Guarda el archivo CSS compilado en el directorio temporal.
|
||||
let css_path = temp_dir.join(target_name);
|
||||
File::create(&css_path)
|
||||
.unwrap_or_else(|_| panic!("Failed to create CSS file `{}`", css_path.display()))
|
||||
.expect(&format!(
|
||||
"Failed to create CSS file `{}`",
|
||||
css_path.display()
|
||||
))
|
||||
.write_all(css_content.as_bytes())
|
||||
.unwrap_or_else(|_| panic!("Failed to write CSS content to `{}`", css_path.display()));
|
||||
.expect(&format!(
|
||||
"Failed to write CSS content to `{}`",
|
||||
css_path.display()
|
||||
));
|
||||
|
||||
// Identifica el directorio temporal de recursos.
|
||||
StaticFilesBundle {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::core::action::add_action;
|
||||
use crate::core::extension::ExtensionRef;
|
||||
use crate::core::theme::all::THEMES;
|
||||
use crate::{global, include_files, include_files_service, service, trace};
|
||||
use crate::{/*global, include_files, include_files_service, */ service, trace};
|
||||
|
||||
use parking_lot::RwLock;
|
||||
|
||||
|
@ -125,13 +125,13 @@ pub fn initialize_extensions() {
|
|||
|
||||
// CONFIGURA LOS SERVICIOS *************************************************************************
|
||||
|
||||
include_files!(assets);
|
||||
//include_files!(assets);
|
||||
|
||||
pub fn configure_services(scfg: &mut service::web::ServiceConfig) {
|
||||
for extension in ENABLED_EXTENSIONS.read().iter() {
|
||||
extension.configure_service(scfg);
|
||||
}
|
||||
include_files_service!(
|
||||
/*include_files_service!(
|
||||
scfg, assets => "/", [&global::SETTINGS.dev.pagetop_project_dir, "static"]
|
||||
);
|
||||
);*/
|
||||
}
|
||||
|
|
|
@ -12,9 +12,6 @@ include_config!(SETTINGS: Settings => [
|
|||
"app.language" => "en-US",
|
||||
"app.startup_banner" => "Slant",
|
||||
|
||||
// [dev]
|
||||
"dev.pagetop_project_dir" => "",
|
||||
|
||||
// [log]
|
||||
"log.enabled" => true,
|
||||
"log.tracing" => "Info",
|
||||
|
@ -30,11 +27,10 @@ include_config!(SETTINGS: Settings => [
|
|||
]);
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
/// Ajustes para las secciones globales [`[app]`](App), [`[dev]`](Dev), [`[log]`](Log) y
|
||||
/// [`[server]`](Server) de [`SETTINGS`].
|
||||
/// Ajustes para las secciones globales [`[app]`](App), [`[log]`](Log) y [`[server]`](Server) de
|
||||
/// [`SETTINGS`].
|
||||
pub struct Settings {
|
||||
pub app: App,
|
||||
pub dev: Dev,
|
||||
pub log: Log,
|
||||
pub server: Server,
|
||||
}
|
||||
|
@ -58,16 +54,6 @@ pub struct App {
|
|||
pub run_mode: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
/// Sección `[Dev]` de la configuración. Forma parte de [`Settings`].
|
||||
pub struct Dev {
|
||||
/// Los archivos estáticos requeridos por `PageTop` se integran por defecto en el binario
|
||||
/// ejecutable. Sin embargo, durante el desarrollo puede resultar útil servirlos desde su propio
|
||||
/// directorio para evitar recompilar cada vez que se modifican. En ese caso, este ajuste debe
|
||||
/// indicar la ruta absoluta al directorio raíz del proyecto.
|
||||
pub pagetop_project_dir: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
/// Sección `[log]` de la configuración. Forma parte de [`Settings`].
|
||||
pub struct Log {
|
||||
|
|
|
@ -9,9 +9,6 @@ pub use actix_web::dev::ServiceResponse as Response;
|
|||
pub use actix_web::{cookie, http, rt, web};
|
||||
pub use actix_web::{App, Error, HttpMessage, HttpRequest, HttpResponse, HttpServer};
|
||||
|
||||
pub use actix_web_files::Files as ActixFiles;
|
||||
pub use actix_web_static_files::ResourceFiles;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub use actix_web::test;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue