2025-03-22 22:17:47 -04:00
|
|
|
use pathbufd::PathBufD;
|
2025-03-23 12:31:48 -04:00
|
|
|
use regex::Regex;
|
|
|
|
use std::{
|
|
|
|
collections::HashMap,
|
|
|
|
fs::{exists, read_to_string, write},
|
|
|
|
sync::LazyLock,
|
|
|
|
};
|
2025-03-22 22:17:47 -04:00
|
|
|
use tera::Context;
|
|
|
|
use tetratto_core::{config::Config, model::auth::User};
|
2025-03-23 12:31:48 -04:00
|
|
|
use tetratto_l10n::LangFile;
|
2025-03-23 16:37:43 -04:00
|
|
|
use tetratto_shared::hash::salt;
|
2025-03-23 12:31:48 -04:00
|
|
|
use tokio::sync::RwLock;
|
2025-03-22 22:17:47 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
use crate::{create_dir_if_not_exists, write_if_track, write_template};
|
2025-03-22 22:17:47 -04:00
|
|
|
|
|
|
|
// images
|
|
|
|
pub const DEFAULT_AVATAR: &str = include_str!("./public/images/default-avatar.svg");
|
|
|
|
pub const DEFAULT_BANNER: &str = include_str!("./public/images/default-banner.svg");
|
2025-03-23 12:31:48 -04:00
|
|
|
pub const FAVICON: &str = include_str!("./public/images/favicon.svg");
|
2025-03-22 22:17:47 -04:00
|
|
|
|
|
|
|
// css
|
|
|
|
pub const STYLE_CSS: &str = include_str!("./public/css/style.css");
|
|
|
|
|
|
|
|
// js
|
|
|
|
pub const LOADER_JS: &str = include_str!("./public/js/loader.js");
|
2025-03-23 16:37:43 -04:00
|
|
|
pub const ATTO_JS: &str = include_str!("./public/js/atto.js");
|
|
|
|
pub const ME_JS: &str = include_str!("./public/js/me.js");
|
2025-03-22 22:17:47 -04:00
|
|
|
|
|
|
|
// html
|
|
|
|
pub const ROOT: &str = include_str!("./public/html/root.html");
|
|
|
|
pub const MACROS: &str = include_str!("./public/html/macros.html");
|
2025-03-29 00:26:56 -04:00
|
|
|
pub const COMPONENTS: &str = include_str!("./public/html/components.html");
|
2025-03-22 22:17:47 -04:00
|
|
|
|
|
|
|
pub const MISC_INDEX: &str = include_str!("./public/html/misc/index.html");
|
2025-03-26 21:46:21 -04:00
|
|
|
pub const MISC_ERROR: &str = include_str!("./public/html/misc/error.html");
|
2025-03-30 22:26:20 -04:00
|
|
|
pub const MISC_NOTIFICATIONS: &str = include_str!("./public/html/misc/notifications.html");
|
2025-04-05 17:28:51 -04:00
|
|
|
pub const MISC_MARKDOWN: &str = include_str!("./public/html/misc/markdown.html");
|
2025-04-12 22:25:54 -04:00
|
|
|
pub const MISC_REQUESTS: &str = include_str!("./public/html/misc/requests.html");
|
2025-03-22 22:17:47 -04:00
|
|
|
|
|
|
|
pub const AUTH_BASE: &str = include_str!("./public/html/auth/base.html");
|
|
|
|
pub const AUTH_LOGIN: &str = include_str!("./public/html/auth/login.html");
|
|
|
|
pub const AUTH_REGISTER: &str = include_str!("./public/html/auth/register.html");
|
|
|
|
|
2025-03-25 23:58:27 -04:00
|
|
|
pub const PROFILE_BASE: &str = include_str!("./public/html/profile/base.html");
|
|
|
|
pub const PROFILE_POSTS: &str = include_str!("./public/html/profile/posts.html");
|
2025-03-31 11:45:34 -04:00
|
|
|
pub const PROFILE_SETTINGS: &str = include_str!("./public/html/profile/settings.html");
|
2025-03-31 22:35:11 -04:00
|
|
|
pub const PROFILE_FOLLOWING: &str = include_str!("./public/html/profile/following.html");
|
|
|
|
pub const PROFILE_FOLLOWERS: &str = include_str!("./public/html/profile/followers.html");
|
2025-04-11 18:08:51 -04:00
|
|
|
pub const PROFILE_WARNING: &str = include_str!("./public/html/profile/warning.html");
|
2025-04-14 17:21:52 -04:00
|
|
|
pub const PROFILE_PRIVATE: &str = include_str!("./public/html/profile/private.html");
|
2025-03-25 23:58:27 -04:00
|
|
|
|
2025-03-27 18:10:47 -04:00
|
|
|
pub const COMMUNITIES_LIST: &str = include_str!("./public/html/communities/list.html");
|
2025-03-29 00:26:56 -04:00
|
|
|
pub const COMMUNITIES_BASE: &str = include_str!("./public/html/communities/base.html");
|
|
|
|
pub const COMMUNITIES_FEED: &str = include_str!("./public/html/communities/feed.html");
|
|
|
|
pub const COMMUNITIES_POST: &str = include_str!("./public/html/communities/post.html");
|
2025-03-31 11:45:34 -04:00
|
|
|
pub const COMMUNITIES_SETTINGS: &str = include_str!("./public/html/communities/settings.html");
|
2025-04-03 20:05:21 -04:00
|
|
|
pub const COMMUNITIES_MEMBERS: &str = include_str!("./public/html/communities/members.html");
|
2025-04-10 21:37:33 -04:00
|
|
|
pub const COMMUNITIES_SEARCH: &str = include_str!("./public/html/communities/search.html");
|
2025-04-11 18:08:51 -04:00
|
|
|
pub const COMMUNITIES_CREATE_POST: &str =
|
|
|
|
include_str!("./public/html/communities/create_post.html");
|
2025-04-12 22:25:54 -04:00
|
|
|
pub const COMMUNITIES_QUESTION: &str = include_str!("./public/html/communities/question.html");
|
|
|
|
pub const COMMUNITIES_QUESTIONS: &str = include_str!("./public/html/communities/questions.html");
|
2025-03-27 18:10:47 -04:00
|
|
|
|
2025-03-31 19:31:36 -04:00
|
|
|
pub const TIMELINES_HOME: &str = include_str!("./public/html/timelines/home.html");
|
|
|
|
pub const TIMELINES_POPULAR: &str = include_str!("./public/html/timelines/popular.html");
|
2025-04-12 12:17:30 -04:00
|
|
|
pub const TIMELINES_FOLLOWING: &str = include_str!("./public/html/timelines/following.html");
|
|
|
|
pub const TIMELINES_ALL: &str = include_str!("./public/html/timelines/all.html");
|
2025-04-13 12:15:14 -04:00
|
|
|
pub const TIMELINES_HOME_QUESTIONS: &str =
|
|
|
|
include_str!("./public/html/timelines/home_questions.html");
|
2025-04-13 12:58:44 -04:00
|
|
|
pub const TIMELINES_POPULAR_QUESTIONS: &str =
|
|
|
|
include_str!("./public/html/timelines/popular_questions.html");
|
2025-04-13 12:15:14 -04:00
|
|
|
pub const TIMELINES_FOLLOWING_QUESTIONS: &str =
|
|
|
|
include_str!("./public/html/timelines/following_questions.html");
|
|
|
|
pub const TIMELINES_ALL_QUESTIONS: &str =
|
|
|
|
include_str!("./public/html/timelines/all_questions.html");
|
2025-03-31 19:31:36 -04:00
|
|
|
|
2025-04-02 11:39:51 -04:00
|
|
|
pub const MOD_AUDIT_LOG: &str = include_str!("./public/html/mod/audit_log.html");
|
|
|
|
pub const MOD_REPORTS: &str = include_str!("./public/html/mod/reports.html");
|
|
|
|
pub const MOD_FILE_REPORT: &str = include_str!("./public/html/mod/file_report.html");
|
2025-04-03 11:22:56 -04:00
|
|
|
pub const MOD_IP_BANS: &str = include_str!("./public/html/mod/ip_bans.html");
|
2025-04-06 13:43:12 -04:00
|
|
|
pub const MOD_PROFILE: &str = include_str!("./public/html/mod/profile.html");
|
2025-04-11 22:12:43 -04:00
|
|
|
pub const MOD_WARNINGS: &str = include_str!("./public/html/mod/warnings.html");
|
2025-04-02 11:39:51 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
// langs
|
|
|
|
pub const LANG_EN_US: &str = include_str!("./langs/en-US.toml");
|
|
|
|
|
2025-03-22 22:17:47 -04:00
|
|
|
// ...
|
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
/// A container for all loaded icons.
|
|
|
|
pub(crate) static ICONS: LazyLock<RwLock<HashMap<String, String>>> =
|
|
|
|
LazyLock::new(|| RwLock::new(HashMap::new()));
|
|
|
|
|
|
|
|
/// Pull an icon given its name and insert it into [`ICONS`].
|
|
|
|
pub(crate) async fn pull_icon(icon: &str, icons_dir: &str) {
|
|
|
|
let writer = &mut ICONS.write().await;
|
|
|
|
|
|
|
|
let icon_url = format!(
|
|
|
|
"https://raw.githubusercontent.com/lucide-icons/lucide/refs/heads/main/icons/{icon}.svg"
|
|
|
|
);
|
|
|
|
|
|
|
|
let file_path = PathBufD::current().extend(&[icons_dir, icon]);
|
|
|
|
|
|
|
|
if exists(&file_path).unwrap() {
|
|
|
|
writer.insert(icon.to_string(), read_to_string(&file_path).unwrap());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
println!("download icon: {icon}");
|
|
|
|
let svg = reqwest::get(icon_url).await.unwrap().text().await.unwrap();
|
|
|
|
|
|
|
|
write(&file_path, &svg).unwrap();
|
|
|
|
writer.insert(icon.to_string(), svg);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Read a string and replace all custom blocks with the corresponding correct HTML.
|
|
|
|
///
|
|
|
|
/// # Replaces
|
|
|
|
/// * icons
|
|
|
|
/// * icons (with class specifier)
|
|
|
|
/// * l10n text
|
|
|
|
pub(crate) async fn replace_in_html(input: &str, config: &Config) -> String {
|
|
|
|
let mut input = input.to_string();
|
|
|
|
input = input.replace("<!-- prettier-ignore -->", "");
|
|
|
|
|
|
|
|
// l10n text
|
|
|
|
let text = Regex::new("(\\{\\{)\\s*(text)\\s*\"(.*?)\"\\s*(\\}\\})").unwrap();
|
|
|
|
|
|
|
|
for cap in text.captures_iter(&input.clone()) {
|
|
|
|
let replace_with = format!("{{{{ lang[\"{}\"] }}}}", cap.get(3).unwrap().as_str());
|
|
|
|
input = input.replace(cap.get(0).unwrap().as_str(), &replace_with);
|
|
|
|
}
|
|
|
|
|
|
|
|
// icon (with class)
|
|
|
|
let icon_with_class =
|
|
|
|
Regex::new("(\\{\\{)\\s*(icon)\\s*(.*?)\\s*c\\((.*?)\\)\\s*(\\}\\})").unwrap();
|
|
|
|
|
|
|
|
for cap in icon_with_class.captures_iter(&input.clone()) {
|
|
|
|
let icon = &cap.get(3).unwrap().as_str().replace("\"", "");
|
|
|
|
|
|
|
|
pull_icon(icon, &config.dirs.icons).await;
|
|
|
|
|
|
|
|
let reader = ICONS.read().await;
|
|
|
|
let icon_text = reader.get(icon).unwrap().replace(
|
|
|
|
"<svg",
|
|
|
|
&format!("<svg class=\"icon {}\"", cap.get(4).unwrap().as_str()),
|
|
|
|
);
|
|
|
|
|
|
|
|
input = input.replace(cap.get(0).unwrap().as_str(), &icon_text);
|
|
|
|
}
|
|
|
|
|
|
|
|
// icon (without class)
|
|
|
|
let icon_without_class = Regex::new("(\\{\\{)\\s*(icon)\\s*(.*?)\\s*(\\}\\})").unwrap();
|
|
|
|
|
|
|
|
for cap in icon_without_class.captures_iter(&input.clone()) {
|
|
|
|
let icon = &cap.get(3).unwrap().as_str().replace("\"", "");
|
|
|
|
|
|
|
|
pull_icon(icon, &config.dirs.icons).await;
|
|
|
|
|
|
|
|
let reader = ICONS.read().await;
|
|
|
|
let icon_text = reader
|
|
|
|
.get(icon)
|
|
|
|
.unwrap()
|
|
|
|
.replace("<svg", "<svg class=\"icon\"");
|
|
|
|
|
|
|
|
input = input.replace(cap.get(0).unwrap().as_str(), &icon_text);
|
|
|
|
}
|
|
|
|
|
|
|
|
// return
|
|
|
|
input
|
|
|
|
}
|
|
|
|
|
2025-03-22 22:17:47 -04:00
|
|
|
/// Set up public directories.
|
2025-03-23 12:31:48 -04:00
|
|
|
pub(crate) async fn write_assets(config: &Config) -> PathBufD {
|
|
|
|
let html_path = PathBufD::current().join(&config.dirs.templates);
|
|
|
|
|
|
|
|
write_template!(html_path->"root.html"(crate::assets::ROOT) --config=config);
|
|
|
|
write_template!(html_path->"macros.html"(crate::assets::MACROS) --config=config);
|
2025-03-29 00:26:56 -04:00
|
|
|
write_template!(html_path->"components.html"(crate::assets::COMPONENTS) --config=config);
|
2025-03-23 12:31:48 -04:00
|
|
|
|
|
|
|
write_template!(html_path->"misc/index.html"(crate::assets::MISC_INDEX) -d "misc" --config=config);
|
2025-03-26 21:46:21 -04:00
|
|
|
write_template!(html_path->"misc/error.html"(crate::assets::MISC_ERROR) --config=config);
|
2025-03-30 22:26:20 -04:00
|
|
|
write_template!(html_path->"misc/notifications.html"(crate::assets::MISC_NOTIFICATIONS) --config=config);
|
2025-04-05 17:28:51 -04:00
|
|
|
write_template!(html_path->"misc/markdown.html"(crate::assets::MISC_MARKDOWN) --config=config);
|
2025-04-12 22:25:54 -04:00
|
|
|
write_template!(html_path->"misc/requests.html"(crate::assets::MISC_REQUESTS) --config=config);
|
2025-03-23 12:31:48 -04:00
|
|
|
|
|
|
|
write_template!(html_path->"auth/base.html"(crate::assets::AUTH_BASE) -d "auth" --config=config);
|
|
|
|
write_template!(html_path->"auth/login.html"(crate::assets::AUTH_LOGIN) --config=config);
|
|
|
|
write_template!(html_path->"auth/register.html"(crate::assets::AUTH_REGISTER) --config=config);
|
|
|
|
|
2025-03-25 23:58:27 -04:00
|
|
|
write_template!(html_path->"profile/base.html"(crate::assets::PROFILE_BASE) -d "profile" --config=config);
|
|
|
|
write_template!(html_path->"profile/posts.html"(crate::assets::PROFILE_POSTS) --config=config);
|
2025-03-31 11:45:34 -04:00
|
|
|
write_template!(html_path->"profile/settings.html"(crate::assets::PROFILE_SETTINGS) --config=config);
|
2025-03-31 22:35:11 -04:00
|
|
|
write_template!(html_path->"profile/following.html"(crate::assets::PROFILE_FOLLOWING) --config=config);
|
|
|
|
write_template!(html_path->"profile/followers.html"(crate::assets::PROFILE_FOLLOWERS) --config=config);
|
2025-04-11 18:08:51 -04:00
|
|
|
write_template!(html_path->"profile/warning.html"(crate::assets::PROFILE_WARNING) --config=config);
|
2025-04-14 17:21:52 -04:00
|
|
|
write_template!(html_path->"profile/private.html"(crate::assets::PROFILE_PRIVATE) --config=config);
|
2025-03-25 23:58:27 -04:00
|
|
|
|
2025-03-27 18:10:47 -04:00
|
|
|
write_template!(html_path->"communities/list.html"(crate::assets::COMMUNITIES_LIST) -d "communities" --config=config);
|
2025-03-29 00:26:56 -04:00
|
|
|
write_template!(html_path->"communities/base.html"(crate::assets::COMMUNITIES_BASE) --config=config);
|
|
|
|
write_template!(html_path->"communities/feed.html"(crate::assets::COMMUNITIES_FEED) --config=config);
|
|
|
|
write_template!(html_path->"communities/post.html"(crate::assets::COMMUNITIES_POST) --config=config);
|
2025-03-31 11:45:34 -04:00
|
|
|
write_template!(html_path->"communities/settings.html"(crate::assets::COMMUNITIES_SETTINGS) --config=config);
|
2025-04-03 20:05:21 -04:00
|
|
|
write_template!(html_path->"communities/members.html"(crate::assets::COMMUNITIES_MEMBERS) --config=config);
|
2025-04-10 21:37:33 -04:00
|
|
|
write_template!(html_path->"communities/search.html"(crate::assets::COMMUNITIES_SEARCH) --config=config);
|
2025-04-11 18:08:51 -04:00
|
|
|
write_template!(html_path->"communities/create_post.html"(crate::assets::COMMUNITIES_CREATE_POST) --config=config);
|
2025-04-12 22:25:54 -04:00
|
|
|
write_template!(html_path->"communities/question.html"(crate::assets::COMMUNITIES_QUESTION) --config=config);
|
|
|
|
write_template!(html_path->"communities/questions.html"(crate::assets::COMMUNITIES_QUESTIONS) --config=config);
|
2025-03-27 18:10:47 -04:00
|
|
|
|
2025-03-31 19:31:36 -04:00
|
|
|
write_template!(html_path->"timelines/home.html"(crate::assets::TIMELINES_HOME) -d "timelines" --config=config);
|
|
|
|
write_template!(html_path->"timelines/popular.html"(crate::assets::TIMELINES_POPULAR) --config=config);
|
2025-04-12 12:17:30 -04:00
|
|
|
write_template!(html_path->"timelines/following.html"(crate::assets::TIMELINES_FOLLOWING) --config=config);
|
|
|
|
write_template!(html_path->"timelines/all.html"(crate::assets::TIMELINES_ALL) --config=config);
|
2025-04-13 12:15:14 -04:00
|
|
|
write_template!(html_path->"timelines/home_questions.html"(crate::assets::TIMELINES_HOME_QUESTIONS) --config=config);
|
2025-04-13 12:58:44 -04:00
|
|
|
write_template!(html_path->"timelines/popular_questions.html"(crate::assets::TIMELINES_POPULAR_QUESTIONS) --config=config);
|
2025-04-13 12:15:14 -04:00
|
|
|
write_template!(html_path->"timelines/following_questions.html"(crate::assets::TIMELINES_FOLLOWING_QUESTIONS) --config=config);
|
|
|
|
write_template!(html_path->"timelines/all_questions.html"(crate::assets::TIMELINES_ALL_QUESTIONS) --config=config);
|
2025-03-31 19:31:36 -04:00
|
|
|
|
2025-04-02 11:39:51 -04:00
|
|
|
write_template!(html_path->"mod/audit_log.html"(crate::assets::MOD_AUDIT_LOG) -d "mod" --config=config);
|
|
|
|
write_template!(html_path->"mod/reports.html"(crate::assets::MOD_REPORTS) --config=config);
|
|
|
|
write_template!(html_path->"mod/file_report.html"(crate::assets::MOD_FILE_REPORT) --config=config);
|
2025-04-03 11:22:56 -04:00
|
|
|
write_template!(html_path->"mod/ip_bans.html"(crate::assets::MOD_IP_BANS) --config=config);
|
2025-04-06 13:43:12 -04:00
|
|
|
write_template!(html_path->"mod/profile.html"(crate::assets::MOD_PROFILE) --config=config);
|
2025-04-11 22:12:43 -04:00
|
|
|
write_template!(html_path->"mod/warnings.html"(crate::assets::MOD_WARNINGS) --config=config);
|
2025-04-02 11:39:51 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
html_path
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Set up extra directories.
|
|
|
|
pub(crate) async fn init_dirs(config: &Config) {
|
2025-04-03 15:07:57 -04:00
|
|
|
create_dir_if_not_exists!(&config.dirs.templates);
|
2025-04-05 17:28:51 -04:00
|
|
|
create_dir_if_not_exists!(&config.dirs.docs);
|
2025-04-03 15:07:57 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
// images
|
|
|
|
create_dir_if_not_exists!(&config.dirs.media);
|
|
|
|
let images_path = PathBufD::current().extend(&[config.dirs.media.as_str(), "images"]);
|
|
|
|
create_dir_if_not_exists!(&images_path);
|
|
|
|
create_dir_if_not_exists!(
|
|
|
|
&PathBufD::current().extend(&[config.dirs.media.as_str(), "avatars"])
|
|
|
|
);
|
2025-03-29 00:26:56 -04:00
|
|
|
create_dir_if_not_exists!(
|
|
|
|
&PathBufD::current().extend(&[config.dirs.media.as_str(), "community_avatars"])
|
|
|
|
);
|
2025-03-23 12:31:48 -04:00
|
|
|
create_dir_if_not_exists!(
|
|
|
|
&PathBufD::current().extend(&[config.dirs.media.as_str(), "banners"])
|
|
|
|
);
|
2025-03-29 00:26:56 -04:00
|
|
|
create_dir_if_not_exists!(
|
|
|
|
&PathBufD::current().extend(&[config.dirs.media.as_str(), "community_banners"])
|
|
|
|
);
|
2025-03-23 12:31:48 -04:00
|
|
|
|
|
|
|
write_if_track!(images_path->"default-avatar.svg"(DEFAULT_AVATAR) --config=config);
|
|
|
|
write_if_track!(images_path->"default-banner.svg"(DEFAULT_BANNER) --config=config);
|
|
|
|
write_if_track!(images_path->"favicon.svg"(FAVICON) --config=config);
|
|
|
|
|
|
|
|
// icons
|
|
|
|
create_dir_if_not_exists!(&PathBufD::current().join(config.dirs.icons.as_str()));
|
2025-03-22 22:17:47 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
// langs
|
|
|
|
let langs_path = PathBufD::current().join("langs");
|
|
|
|
create_dir_if_not_exists!(&langs_path);
|
2025-03-22 22:17:47 -04:00
|
|
|
|
2025-03-23 12:31:48 -04:00
|
|
|
write_template!(langs_path->"en-US.toml"(LANG_EN_US));
|
2025-03-22 22:17:47 -04:00
|
|
|
}
|
|
|
|
|
2025-03-23 16:37:43 -04:00
|
|
|
/// A random ASCII value inserted into the URL of static assets to "break" the cache. Essentially just for cache busting.
|
2025-03-31 15:39:49 -04:00
|
|
|
pub(crate) static CACHE_BREAKER: LazyLock<String> = LazyLock::new(salt);
|
2025-03-23 16:37:43 -04:00
|
|
|
|
2025-03-22 22:17:47 -04:00
|
|
|
/// Create the initial template context.
|
2025-03-27 18:10:47 -04:00
|
|
|
pub(crate) async fn initial_context(
|
|
|
|
config: &Config,
|
|
|
|
lang: &LangFile,
|
|
|
|
user: &Option<User>,
|
|
|
|
) -> Context {
|
2025-03-22 22:17:47 -04:00
|
|
|
let mut ctx = Context::new();
|
|
|
|
ctx.insert("config", &config);
|
|
|
|
ctx.insert("user", &user);
|
2025-04-08 15:49:41 -04:00
|
|
|
ctx.insert("use_user_theme", &true);
|
2025-03-29 00:26:56 -04:00
|
|
|
|
|
|
|
if let Some(ua) = user {
|
|
|
|
ctx.insert("is_helper", &ua.permissions.check_helper());
|
|
|
|
ctx.insert("is_manager", &ua.permissions.check_manager());
|
|
|
|
} else {
|
|
|
|
ctx.insert("is_helper", &false);
|
|
|
|
ctx.insert("is_manager", &false);
|
|
|
|
}
|
|
|
|
|
2025-03-23 16:37:43 -04:00
|
|
|
ctx.insert("lang", &lang.data);
|
|
|
|
ctx.insert("random_cache_breaker", &CACHE_BREAKER.clone());
|
2025-03-22 22:17:47 -04:00
|
|
|
ctx
|
|
|
|
}
|