From dc3f6471e774eaafab92dfcd73dd089707646469 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Wed, 8 Jun 2022 14:58:29 -0400 Subject: Add hero image support with Also lightens the JavaScript load and shifts ad impressions to only when people from Reddit and Hacker News visit. I may have this include Twitter in the future. Signed-off-by: Xe --- templates/blogpost.rs.html | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'templates') diff --git a/templates/blogpost.rs.html b/templates/blogpost.rs.html index 725bb60..b5a7888 100644 --- a/templates/blogpost.rs.html +++ b/templates/blogpost.rs.html @@ -1,8 +1,7 @@ -@use super::{header_html, footer_html, mara}; -@use crate::post::Post; -@use chrono::prelude::*; +@use super::{header_html, footer_html}; +@use crate::{post::Post, tmpl::nag}; -@(post: Post, body: impl ToHtml) +@(post: Post, body: impl ToHtml, referer: Option) @:header_html(Some(&post.front_matter.title.clone()), None) @@ -27,8 +26,6 @@ } - - } -
- +@Html(nag::referer(referer).0)

@post.front_matter.title

-@if Utc::today().num_days_from_ce() < post.date.num_days_from_ce() { -
- @:mara("hacker", "Mara", Html(format!(r#"Hey, this post is set to go live to the public on {} UTC. Right now you are reading a pre-publication version of this post. Please do not share this on social media. This post will automatically go live for everyone on the intended publication date. If you want access to these posts, please join the Patreon. It helps me afford the copyeditor that I contract for the technical content I write."#, post.detri()))) -
-} else { - -} +@Html(nag::prerelease(&post).0) A @post.read_time_estimate_minutes minute read. @body -
-
@if post.front_matter.vod.is_some() { -- cgit v1.2.3