diff --git a/blog.conf b/blog.conf index 2592d25..6902b46 100644 --- a/blog.conf +++ b/blog.conf @@ -5,6 +5,7 @@ enable_drafts: false posts_dir: ./posts github: prabirshrestha twitter: prabirshrestha +mastodon: https://mastodon.social/@prabirshrestha syntax_highlight: true # google_analytics: # ga_measurement_id: changeme diff --git a/src/blog.rs b/src/blog.rs index 5bebec2..1ff921f 100644 --- a/src/blog.rs +++ b/src/blog.rs @@ -24,6 +24,7 @@ pub struct BlogConf { enable_drafts: Option, posts_dir: Option, github: Option, + mastodon: Option, twitter: Option, disqus: Option, giscus: Option, @@ -177,6 +178,10 @@ impl BlogConf { self.github.as_deref() } + pub fn get_mastodon(&self) -> Option<&str> { + self.mastodon.as_deref() + } + pub fn get_twitter(&self) -> Option<&str> { self.twitter.as_deref() } diff --git a/templates/base.rs.html b/templates/base.rs.html index bf7dc51..3df9ff3 100644 --- a/templates/base.rs.html +++ b/templates/base.rs.html @@ -22,6 +22,9 @@ @if let Some(github) = blog.get_blog_conf().get_github() { Github } + @if let Some(mastodon) = blog.get_blog_conf().get_mastodon() { + Mastodon + } @if let Some(twitter) = blog.get_blog_conf().get_twitter() { Twitter } @@ -35,6 +38,9 @@ @if let Some(github) = blog.get_blog_conf().get_github() { Github } + @if let Some(mastodon) = blog.get_blog_conf().get_mastodon() { + Mastodon + } @if let Some(twitter) = blog.get_blog_conf().get_twitter() { Twitter }