yagit

Yet another static site generator for Git 🙀️

Commit
bf0f1d1d21ed78ae47cb99f156d9dd1d7f6e60d0
Parent
de1997a74eaf34ef10126688839e76cc79afc713
Author
Pablo <pablo-pie@riseup.net>
Date

Hardcoded the debug build consts

Diffstats

3 files changed, 10 insertions, 22 deletions

Status Name Changes Insertions Deletions
Modified .gitignore 2 files changed 0 1
Modified config.toml 2 files changed 3 14
Modified src/config.rs 2 files changed 7 7
diff --git a/.gitignore b/.gitignore
@@ -1,6 +1,5 @@
 /target
 /test
-/site
 Cargo.lock
 
 /profiling
diff --git a/config.toml b/config.toml
@@ -1,23 +1,12 @@
 [output]
+path                = "/var/www/git"
 tree_subdir         = "tree"
 blob_subdir         = "blob"
 commit_subdir       = "commit"
 private_output_root = "private/"
 
-[output.release]
-path = "/var/www/git"
-
-[output.debug]
-path = "./site"
-
 [git]
-store_owner = "Pablo"
-user = "git"
-
-[git.release]
 store_path         = "/var/git/public"  # path to the public  repo store
 private_store_path = "/var/git/private" # path to the private repo store
-
-[git.debug]
-store_path         = "./test/public"  # path to the public  repo store
-private_store_path = "./test/private" # path to the private repo store
+store_owner        = "Pablo"
+user               = "git"
diff --git a/src/config.rs b/src/config.rs
@@ -5,10 +5,10 @@ static_toml::static_toml! {
 }
 
 #[cfg(not(debug_assertions))]
-pub const OUTPUT_PATH: &str = CONFIG.output.release.path;
+pub const OUTPUT_PATH: &str = CONFIG.output.path;
 
 #[cfg(debug_assertions)]
-pub const OUTPUT_PATH: &str = CONFIG.output.debug.path;
+pub const OUTPUT_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/site");
 
 pub const TREE_SUBDIR:         &str = CONFIG.output.tree_subdir;
 pub const BLOB_SUBDIR:         &str = CONFIG.output.blob_subdir;
@@ -17,14 +17,14 @@ pub const PRIVATE_OUTPUT_ROOT: &str = CONFIG.output.private_output_root;
 
 #[cfg(not(debug_assertions))]
 pub const GIT_USER: &str = CONFIG.git.user;
-pub const OWNER: &str = CONFIG.git.store_owner;
+pub const OWNER:    &str = CONFIG.git.store_owner;
 
 #[cfg(debug_assertions)]
-pub const STORE_PATH:         &str = CONFIG.git.debug.store_path;
+pub const STORE_PATH:         &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/public");
 #[cfg(debug_assertions)]
-pub const PRIVATE_STORE_PATH: &str = CONFIG.git.debug.private_store_path;
+pub const PRIVATE_STORE_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test/private");
 
 #[cfg(not(debug_assertions))]
-pub const STORE_PATH:         &str = CONFIG.git.release.store_path;
+pub const STORE_PATH:         &str = CONFIG.git.store_path;
 #[cfg(not(debug_assertions))]
-pub const PRIVATE_STORE_PATH: &str = CONFIG.git.release.private_store_path;
+pub const PRIVATE_STORE_PATH: &str = CONFIG.git.private_store_path;