aboutsummaryrefslogtreecommitdiff
path: root/src/app/mod.rs
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-11-25 19:01:10 -0500
committerGitHub <noreply@github.com>2022-11-25 19:01:10 -0500
commitcc933b31fd23bb06e95bf41f848a1c99353d44ae (patch)
treeaf8288dbd4db2ad886d6b326bffb1c9d5b568de3 /src/app/mod.rs
parent551e0384c923ff3ee98cfddf7e3eb42c6dbb2941 (diff)
downloadxesite-cc933b31fd23bb06e95bf41f848a1c99353d44ae.tar.xz
xesite-cc933b31fd23bb06e95bf41f848a1c99353d44ae.zip
Start version 3 (#573)
* Start version 3 * Change version to 3.0.0 in Cargo.toml * Add metadata for series * Change types for signal boosts * Add start of LaTeX resume generation at Nix time * Add start of proper author tagging for posts in JSONFeed and ldjson * Convert templates to use Maud * Add start of dynamic resume generation from dhall * Make patrons page embed thumbnails TODO: * [ ] Remove the rest of the old templates * [ ] Bring in Xeact for the share on mastodon button * [ ] Site update post Signed-off-by: Xe <me@christine.website> * fix nix builds Signed-off-by: Xe Iaso <me@christine.website> * fix dhall build Signed-off-by: Xe Iaso <me@christine.website> * fix non-flakes build Signed-off-by: Xe Iaso <me@christine.website> * make new mastodon share button Signed-off-by: Xe Iaso <me@christine.website> * remove the rest of the ructe templates that I can remove Signed-off-by: Xe Iaso <me@christine.website> * refactor blogposts to its own file Signed-off-by: Xe Iaso <me@christine.website> * move resume to be generated by nix Signed-off-by: Xe Iaso <me@christine.website> * write article Signed-off-by: Xe Iaso <me@christine.website> * blog/site-update-v3: hero image Signed-off-by: Xe Iaso <me@christine.website> * add site update series tag to site updates Signed-off-by: Xe Iaso <me@christine.website> Signed-off-by: Xe <me@christine.website> Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'src/app/mod.rs')
-rw-r--r--src/app/mod.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs
index 73320e1..6753ff0 100644
--- a/src/app/mod.rs
+++ b/src/app/mod.rs
@@ -1,7 +1,7 @@
use crate::{post::Post, signalboost::Person};
use chrono::prelude::*;
use color_eyre::eyre::Result;
-use std::{fs, path::PathBuf, sync::Arc};
+use std::{path::PathBuf, sync::Arc};
use tracing::{error, instrument};
pub mod config;
@@ -48,7 +48,6 @@ pub const ICON: &'static str = "https://xeiaso.net/static/img/avatar.png";
pub struct State {
pub cfg: Arc<Config>,
pub signalboost: Vec<Person>,
- pub resume: String,
pub blog: Vec<Post>,
pub gallery: Vec<Post>,
pub talks: Vec<Post>,
@@ -62,8 +61,6 @@ pub struct State {
pub async fn init(cfg: PathBuf) -> Result<State> {
let cfg: Arc<Config> = Arc::new(serde_dhall::from_file(cfg).parse()?);
let sb = cfg.signalboost.clone();
- let resume = fs::read_to_string(cfg.clone().resume_fname.clone())?;
- let resume: String = xesite_markdown::render(&resume)?;
let mi = mi::Client::new(
cfg.clone().mi_token.clone(),
crate::APPLICATION_NAME.to_string(),
@@ -85,7 +82,7 @@ pub async fn init(cfg: PathBuf) -> Result<State> {
everything.sort();
everything.reverse();
- let today = Utc::today();
+ let today = Utc::now().date_naive();
let everything: Vec<Post> = everything
.into_iter()
.filter(|p| today.num_days_from_ce() >= p.date.num_days_from_ce())
@@ -141,7 +138,6 @@ pub async fn init(cfg: PathBuf) -> Result<State> {
mi,
cfg,
signalboost: sb,
- resume,
blog,
gallery,
talks,