aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-28 06:45:40 -0700
committerFuwn <[email protected]>2024-06-28 06:45:40 -0700
commit299b53503a76b798b7ce28636644a65c39591551 (patch)
treee1fdea33ee8f39d80ed051cb44a5ae82efcf9802 /src/modules
parentfeat(finger): proxy content as pre-formatted (diff)
downloadlocus-299b53503a76b798b7ce28636644a65c39591551.tar.xz
locus-299b53503a76b798b7ce28636644a65c39591551.zip
feat(blogs): finger_archive
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/blog/module.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/blog/module.rs b/src/modules/blog/module.rs
index 9d00eea..e6fcd06 100644
--- a/src/modules/blog/module.rs
+++ b/src/modules/blog/module.rs
@@ -320,10 +320,21 @@ fn construct_header(
};
}
+ macro_rules! any_is_some {
+ ($($getter:ident),*) => {
+ $(post.$getter().is_some() ||)* false
+ };
+ }
+
Ok((
format!(
- "# {}\n\n{}{}{}{}",
+ "# {}\n{}{}{}{}{}",
post.name().clone().unwrap_or_else(|| name.to_string()),
+ if any_is_some![author, created, last_modified, description] {
+ "\n"
+ } else {
+ ""
+ },
field!(author, "Author: {}\n"),
field!(created, "Created: {}\n"),
field!(last_modified, "Last Modified: {}\n"),