aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-04-19 23:35:42 -0700
committerFuwn <[email protected]>2022-04-19 23:35:42 -0700
commit3b2164b306326c79af68123a945b2c74a500f4e4 (patch)
tree46154f6e66d595db652f4caac32b06a4e360b69e /src/modules
parentrefactor(modules): move search to modules module (diff)
downloadlocus-3b2164b306326c79af68123a945b2c74a500f4e4.tar.xz
locus-3b2164b306326c79af68123a945b2c74a500f4e4.zip
refactor(modules): move remarks to modules module
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/mod.rs1
-rw-r--r--src/modules/remarks.rs44
2 files changed, 45 insertions, 0 deletions
diff --git a/src/modules/mod.rs b/src/modules/mod.rs
index d59d62c..a41bf2b 100644
--- a/src/modules/mod.rs
+++ b/src/modules/mod.rs
@@ -17,5 +17,6 @@
// SPDX-License-Identifier: GPL-3.0-only
pub mod multi_blog;
+pub mod remarks;
pub mod search;
pub mod sitemap;
diff --git a/src/modules/remarks.rs b/src/modules/remarks.rs
new file mode 100644
index 0000000..83be334
--- /dev/null
+++ b/src/modules/remarks.rs
@@ -0,0 +1,44 @@
+// This file is part of Locus <https://github.com/gemrest/locus>.
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, version 3.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+//
+// Copyright (C) 2022-2022 Fuwn <[email protected]>
+// SPDX-License-Identifier: GPL-3.0-only
+
+use std::lazy::SyncLazy;
+
+pub static REMARKS: SyncLazy<Vec<String>> = SyncLazy::new(|| {
+ serde_json::from_str(include_str!("../../content/json/remarks.json")).unwrap()
+});
+
+pub fn module(router: &mut windmark::Router) {
+ crate::route::track_mount(
+ router,
+ "/remarks",
+ "Fuwn's remarks",
+ Box::new(|context| {
+ crate::success!(
+ format!(
+ "# REMARKS\n\n{}",
+ REMARKS
+ .iter()
+ .map(|r| format!("* {}", r))
+ .collect::<Vec<String>>()
+ .join("\n")
+ ),
+ context
+ )
+ }),
+ );
+}