mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
sitemap generates URL
This commit is contained in:
@@ -66,6 +66,7 @@ pub mod routes {
|
||||
pub sitekey: Sitekey,
|
||||
pub notifications: &'static str,
|
||||
pub settings: Settings,
|
||||
pub stats: &'static str,
|
||||
}
|
||||
|
||||
impl Panel {
|
||||
@@ -75,10 +76,11 @@ pub mod routes {
|
||||
sitekey: Sitekey::new(),
|
||||
notifications: "/notifications",
|
||||
settings: Settings::new(),
|
||||
stats: "/stats",
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn get_sitemap() -> [&'static str; 5] {
|
||||
pub const fn get_sitemap() -> [&'static str; 6] {
|
||||
const PANEL: Panel = Panel::new();
|
||||
const S: [&str; 2] = Sitekey::get_sitemap();
|
||||
|
||||
@@ -88,6 +90,7 @@ pub mod routes {
|
||||
S[0],
|
||||
S[1],
|
||||
Settings::get_sitemap()[0],
|
||||
PANEL.stats,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,19 @@ use crate::PAGES;
|
||||
#[template(path = "sitemap.html")]
|
||||
struct IndexPage {
|
||||
urls: [&'static str; 7],
|
||||
domain: &'static str,
|
||||
}
|
||||
|
||||
impl Default for IndexPage {
|
||||
fn default() -> Self {
|
||||
let urls = Routes::get_sitemap();
|
||||
Self { urls }
|
||||
let domain = if crate::SETTINGS.server.domain.ends_with('/') {
|
||||
&crate::SETTINGS.server.domain[0..crate::SETTINGS.server.domain.len() - 1]
|
||||
} else {
|
||||
&crate::SETTINGS.server.domain
|
||||
};
|
||||
|
||||
Self { urls, domain }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user