diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/mod.rs | 1 | ||||
| -rw-r--r-- | src/modules/remarks.rs | 44 |
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 + ) + }), + ); +} |