diff --git a/pages/constant.GIT_COMMIT_HASH.html b/pages/constant.GIT_COMMIT_HASH.html index 32d1ad0..c526aa6 100644 --- a/pages/constant.GIT_COMMIT_HASH.html +++ b/pages/constant.GIT_COMMIT_HASH.html @@ -1,4 +1,4 @@ GIT_COMMIT_HASH in pages - Rust

Constant pages::GIT_COMMIT_HASH[][src]

pub const GIT_COMMIT_HASH: &str = "c6f9cb7ac1d7e9a4b945cae402686383608bc71d";
+

Constant pages::GIT_COMMIT_HASH[][src]

pub const GIT_COMMIT_HASH: &str = "fc8f86a2af00e3bb6d060b01cd9948e0ee88f157";
\ No newline at end of file diff --git a/pages/settings/index.html b/pages/settings/index.html index 3bb8500..1795aa7 100644 --- a/pages/settings/index.html +++ b/pages/settings/index.html @@ -1,5 +1,5 @@ pages::settings - Rust

Module pages::settings[][src]

Structs

+

Module settings

\ No newline at end of file diff --git a/pages/settings/struct.Settings.html b/pages/settings/struct.Settings.html index e7fd6b4..d6ae393 100644 --- a/pages/settings/struct.Settings.html +++ b/pages/settings/struct.Settings.html @@ -4,7 +4,7 @@ pub server: Server, pub source_code: String, pub pages: Vec<Page>, -}

Fields

server: Serversource_code: Stringpages: Vec<Page>

Implementations

Trait Implementations

Returns a copy of the value. Read more

+}

Fields

server: Serversource_code: Stringpages: Vec<Page>

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

diff --git a/pages/struct.SETTINGS.html b/pages/struct.SETTINGS.html index fde0afd..163773d 100644 --- a/pages/struct.SETTINGS.html +++ b/pages/struct.SETTINGS.html @@ -2,7 +2,7 @@

Struct pages::SETTINGS[][src]

pub struct SETTINGS {
     pub(crate) __private_field: (),
-}

Fields

__private_field: ()

Methods from Deref<Target = Settings>

Trait Implementations

The resulting type after dereferencing.

+}

Fields

__private_field: ()

Methods from Deref<Target = Settings>

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

diff --git a/pages/struct.Settings.html b/pages/struct.Settings.html index a444aed..b5960a2 100644 --- a/pages/struct.Settings.html +++ b/pages/struct.Settings.html @@ -4,7 +4,7 @@ pub server: Server, pub source_code: String, pub pages: Vec<Page>, -}

Fields

server: Serversource_code: Stringpages: Vec<Page>

Implementations

Trait Implementations

Returns a copy of the value. Read more

+}

Fields

server: Serversource_code: Stringpages: Vec<Page>

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

diff --git a/src/pages/settings.rs.html b/src/pages/settings.rs.html index 2c1b806..52a9864 100644 --- a/src/pages/settings.rs.html +++ b/src/pages/settings.rs.html @@ -107,6 +107,16 @@ 105 106 107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117
/*
  * Copyright (C) 2022  Aravinth Manivannan <realaravinth@batsense.net>
  *
@@ -162,14 +172,24 @@
         const CURRENT_DIR: &str = "./config/default.toml";
         const ETC: &str = "/etc/static-pages/config.toml";
 
-        if let Ok(path) = env::var("PAGES__CONFIG") {
-            s = s.add_source(File::with_name(&path));
-        } else if Path::new(CURRENT_DIR).exists() {
+        let mut read_file = false;
+
+        if Path::new(ETC).exists() {
+            s = s.add_source(File::with_name(ETC));
+            read_file = true;
+        }
+        if Path::new(CURRENT_DIR).exists() {
             // merging default config from file
             s = s.add_source(File::with_name(CURRENT_DIR));
-        } else if Path::new(ETC).exists() {
-            s = s.add_source(File::with_name(ETC));
-        } else {
+            read_file = true;
+        }
+
+        if let Ok(path) = env::var("PAGES_CONFIG") {
+            s = s.add_source(File::with_name(&path));
+            read_file = true;
+        }
+
+        if !read_file {
             log::warn!("configuration file not found");
         }