diff options
| author | Xe Iaso <me@christine.website> | 2022-06-08 14:58:29 -0400 |
|---|---|---|
| committer | Xe Iaso <me@christine.website> | 2022-06-08 15:02:52 -0400 |
| commit | dc3f6471e774eaafab92dfcd73dd089707646469 (patch) | |
| tree | 3b69a8d6f1f05b6c59086f14ae0cbef9ae248a24 /templates | |
| parent | 396150f72bcd4545864d96f50afbf39cb6c15afb (diff) | |
| download | xesite-dc3f6471e774eaafab92dfcd73dd089707646469.tar.xz xesite-dc3f6471e774eaafab92dfcd73dd089707646469.zip | |
Add hero image support with <xeblog-hero>
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 <me@christine.website>
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/blogpost.rs.html | 22 |
1 files changed, 5 insertions, 17 deletions
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<String>) @:header_html(Some(&post.front_matter.title.clone()), None) @@ -27,8 +26,6 @@ <link rel="canonical" href="@post.front_matter.redirect_to.as_ref().unwrap()" /> } -<script type="module" src="/static/js/conversation.js"></script> - <script type="application/ld+json"> @{ "@@context": "http://schema.org", @@ -59,25 +56,16 @@ </script> } -<div id="refererNotice"></div> -<script type="module" src="/static/js/hnwarn.js"></script> +@Html(nag::referer(referer).0) <h1>@post.front_matter.title</h1> -@if Utc::today().num_days_from_ce() < post.date.num_days_from_ce() { -<div class="warning"> - @: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 <a href="https://patreon.com/cadey">Patreon</a>. It helps me afford the copyeditor that I contract for the technical content I write."#, post.detri()))) -</div> -} else { -<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script> -} +@Html(nag::prerelease(&post).0) <small>A @post.read_time_estimate_minutes minute read.</small> @body -<div class="adaptive" data-ea-publisher="christinewebsite" data-ea-type="image" data-ea-style="stickybox"></div> - <hr /> @if post.front_matter.vod.is_some() { |
