diff --git a/Cargo.lock b/Cargo.lock index bc31346..504c79e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,13 +207,13 @@ dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "logger 0.1.0", "pulldown-cmark 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "rsass 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", - "tera 1.0.0-beta.5 (registry+https://github.com/rust-lang/crates.io-index)", + "simple-log 0.1.0 (git+https://git.sr.ht/~adnano/simple-log)", + "tera 1.0.0-beta.6 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -235,14 +235,6 @@ dependencies = [ "cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "logger" -version = "0.1.0" -dependencies = [ - "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "maplit" version = "1.0.1" @@ -557,6 +549,15 @@ dependencies = [ "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "simple-log" +version = "0.1.0" +source = "git+https://git.sr.ht/~adnano/simple-log#e037111566afd3ece75ba5690d66ff5a244c31ae" +dependencies = [ + "env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "slug" version = "0.1.4" @@ -582,7 +583,7 @@ dependencies = [ [[package]] name = "tera" -version = "1.0.0-beta.5" +version = "1.0.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -894,10 +895,11 @@ dependencies = [ "checksum serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "58fc82bec244f168b23d1963b45c8bf5726e9a15a9d146a067f9081aeed2de79" "checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d" "checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded" +"checksum simple-log 0.1.0 (git+https://git.sr.ht/~adnano/simple-log)" = "" "checksum slug 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b3bc762e6a4b6c6fcaade73e77f9ebc6991b676f88bb2358bddb56560f073373" "checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be" "checksum syn 0.15.30 (registry+https://github.com/rust-lang/crates.io-index)" = "66c8865bf5a7cbb662d8b011950060b3c8743dca141b054bf7195b20d314d8e2" -"checksum tera 1.0.0-beta.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a86432150f195cc337f91f70cf9b507d83f538fc9bb156ca85acc119a5445" +"checksum tera 1.0.0-beta.6 (registry+https://github.com/rust-lang/crates.io-index)" = "603de2ef6fe7bc1989ea4457b5b1e36d5f6dda8fc84ee6f0362229d3f09084fb" "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" diff --git a/Cargo.toml b/Cargo.toml index 92ace11..9b6c14a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,6 @@ regex = "1.1" rsass = "0.9" serde = "1.0" serde_derive = "1.0" -tera = "1.0.0-beta.5" +tera = "1.0.0-beta.6" toml = "0.4" -logger = { path = "../logger" } +simple-log = { version = "0.1.0", git = "https://git.sr.ht/~adnano/simple-log" } diff --git a/src/index.rs b/src/index.rs index c84705c..2101c7a 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1,8 +1,7 @@ +use std::io::Result; use std::path::{Path, PathBuf}; use std::{env, fs, ops, slice}; -use std::io::Result; - #[derive(Default)] pub struct Index(Vec<(PathBuf, Vec)>); diff --git a/src/main.rs b/src/main.rs index 0177d29..b2974b4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ -fn main() -> kiln::Exit { - logger::new().init(); - kiln::run()?; - Ok(()) +#[macro_use] +extern crate log; + +fn main() { + simple_log::init(); + kiln::run().unwrap_or_else(|e| error!("{}", e)); } diff --git a/src/manipulate.rs b/src/manipulate.rs index 6957e56..b4fe80a 100644 --- a/src/manipulate.rs +++ b/src/manipulate.rs @@ -34,7 +34,8 @@ impl<'a> Manipulater<'a> { fn manipulate(mut self) -> Result<()> { for (i, (path, contents)) in self.index.iter_mut().enumerate() { match path.extension().and_then(OsStr::to_str) { - Some("html") => { + Some("tera") => { + path.set_extension("html"); let filename = path.file_name().unwrap(); if filename == "index.html" { path.pop();