The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

xeiaso.net

Signed-off-by: Xe Iaso <me@christine.website>

Xe Iaso bdc64f78 ff64215d

+50 -45
+1 -9
lib/mi/src/lib.rs
··· 29 29 .build()?; 30 30 31 31 Ok(Self { 32 - cli: cli, 32 + cli, 33 33 base_url: "https://mi.within.website".to_string(), 34 34 }) 35 35 } ··· 63 63 pub source: String, 64 64 pub title: Option<String>, 65 65 } 66 - 67 - #[cfg(test)] 68 - mod tests { 69 - #[test] 70 - fn it_works() { 71 - assert_eq!(2 + 2, 4); 72 - } 73 - }
+4 -4
src/app/markdown.rs
··· 37 37 let mut data = node.data.borrow_mut(); 38 38 match &mut data.value { 39 39 &mut NodeValue::Link(ref mut link) => { 40 - let base = Url::parse("https://christine.website/")?; 40 + let base = Url::parse("https://xeiaso.net/")?; 41 41 let u = base.join(std::str::from_utf8(&link.url.clone())?)?; 42 42 if u.scheme() != "conversation" { 43 43 return Ok(()); ··· 85 85 <div class="conversation"> 86 86 <div class="conversation-picture conversation-smol"> 87 87 <picture> 88 - <source srcset="https://cdn.christine.website/file/christine-static/stickers/{name_lower}/{mood}.avif" type="image/avif"> 89 - <source srcset="https://cdn.christine.website/file/christine-static/stickers/{name_lower}/{mood}.webp" type="image/webp"> 90 - <img src="https://cdn.christine.website/file/christine-static/stickers/{name_lower}/{mood}.png" alt="{name} is {mood}"> 88 + <source srcset="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.avif" type="image/avif"> 89 + <source srcset="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.webp" type="image/webp"> 90 + <img src="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.png" alt="{name} is {mood}"> 91 91 </picture> 92 92 </div> 93 93 <div class="conversation-chat">&lt;<b>{name}</b>&gt; "#), ContentType::Html);
+10 -10
src/app/mod.rs
··· 54 54 } 55 55 } 56 56 57 - pub const ICON: &'static str = "https://christine.website/static/img/avatar.png"; 57 + pub const ICON: &'static str = "https://xeiaso.net/static/img/avatar.png"; 58 58 59 59 pub struct State { 60 60 pub cfg: Config, ··· 106 106 .author( 107 107 jsonfeed::Author::new() 108 108 .name("Xe") 109 - .url("https://christine.website") 109 + .url("https://xeiaso.net") 110 110 .avatar(ICON), 111 111 ) 112 - .feed_url("https://christine.website/blog.json") 112 + .feed_url("https://xeiaso.net/blog.json") 113 113 .user_comment("This is a JSON feed of my blogposts. For more information read: https://jsonfeed.org/version/1") 114 - .home_page_url("https://christine.website") 114 + .home_page_url("https://xeiaso.net") 115 115 .icon(ICON) 116 116 .favicon(ICON); 117 117 ··· 124 124 let smw = sitemap::writer::SiteMapWriter::new(&mut sm); 125 125 let mut urlwriter = smw.start_urlset()?; 126 126 for url in &[ 127 - "https://christine.website/resume", 128 - "https://christine.website/contact", 129 - "https://christine.website/", 130 - "https://christine.website/blog", 131 - "https://christine.website/signalboost", 127 + "https://xeiaso.net/resume", 128 + "https://xeiaso.net/contact", 129 + "https://xeiaso.net/", 130 + "https://xeiaso.net/blog", 131 + "https://xeiaso.net/signalboost", 132 132 ] { 133 133 urlwriter.url(*url)?; 134 134 } 135 135 136 136 for post in &everything { 137 - urlwriter.url(format!("https://christine.website/{}", post.link))?; 137 + urlwriter.url(format!("https://xeiaso.net/{}", post.link))?; 138 138 } 139 139 140 140 urlwriter.end()?;
+13 -13
src/app/poke.rs
··· 29 29 async fn bing() -> Result<()> { 30 30 let cli = reqwest::Client::new(); 31 31 cli.get("https://www.bing.com/ping") 32 - .query(&[("sitemap", "https://christine.website/sitemap.xml")]) 32 + .query(&[("sitemap", "https://xeiaso.net/sitemap.xml")]) 33 33 .header("User-Agent", crate::APPLICATION_NAME) 34 34 .send() 35 35 .await? ··· 42 42 async fn google() -> Result<()> { 43 43 let cli = reqwest::Client::new(); 44 44 cli.get("https://www.google.com/ping") 45 - .query(&[("sitemap", "https://christine.website/sitemap.xml")]) 45 + .query(&[("sitemap", "https://xeiaso.net/sitemap.xml")]) 46 46 .header("User-Agent", crate::APPLICATION_NAME) 47 47 .send() 48 48 .await? ··· 56 56 let cli = cfcache::Client::new(env::var("CF_TOKEN")?, env::var("CF_ZONE_ID")?)?; 57 57 cli.purge( 58 58 vec![ 59 - "https://christine.website/sitemap.xml", 60 - "https://christine.website", 61 - "https://christine.website/blog", 62 - "https://christine.website/blog.atom", 63 - "https://christine.website/blog.json", 64 - "https://christine.website/blog.rss", 65 - "https://christine.website/gallery", 66 - "https://christine.website/talks", 67 - "https://christine.website/resume", 68 - "https://christine.website/signalboost", 69 - "https://christine.website/feeds", 59 + "https://xeiaso.net/sitemap.xml", 60 + "https://xeiaso.net", 61 + "https://xeiaso.net/blog", 62 + "https://xeiaso.net/blog.atom", 63 + "https://xeiaso.net/blog.json", 64 + "https://xeiaso.net/blog.rss", 65 + "https://xeiaso.net/gallery", 66 + "https://xeiaso.net/talks", 67 + "https://xeiaso.net/resume", 68 + "https://xeiaso.net/signalboost", 69 + "https://xeiaso.net/feeds", 70 70 ] 71 71 .into_iter() 72 72 .map(|i| i.to_string())
+15 -2
src/handlers/mod.rs
··· 5 5 http::StatusCode, 6 6 response::{Html, IntoResponse, Response}, 7 7 }; 8 - use chrono::{Datelike, Timelike, Utc}; 8 + use chrono::{Datelike, Timelike, Utc, Weekday}; 9 9 use lazy_static::lazy_static; 10 10 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 11 11 use std::sync::Arc; ··· 16 16 pub mod gallery; 17 17 pub mod talks; 18 18 19 + fn weekday_to_name(w: Weekday) -> &'static str { 20 + use Weekday::*; 21 + match w { 22 + Sun => "Sun", 23 + Mon => "Mon", 24 + Tue => "Tue", 25 + Wed => "Wed", 26 + Thu => "Thu", 27 + Fri => "Fri", 28 + Sat => "Sat", 29 + } 30 + } 31 + 19 32 lazy_static! { 20 33 static ref HIT_COUNTER: IntCounterVec = 21 34 register_int_counter_vec!(opts!("hits", "Number of hits to various pages"), &["page"]) ··· 24 37 let now = Utc::now(); 25 38 format!( 26 39 "{dayname}, {day} {month} {year} {hour}:{minute}:{second} GMT", 27 - dayname = now.weekday(), 40 + dayname = weekday_to_name(now.weekday()), 28 41 day = now.day(), 29 42 month = now.month(), 30 43 year = now.year(),
+1 -1
src/main.rs
··· 268 268 templates::gitea_html( 269 269 &mut buffer, 270 270 "christine.website/jsonfeed", 271 - "https://christine.website/metrics", 271 + "https://tulpa.dev/Xe/jsonfeed", 272 272 "master", 273 273 ) 274 274 .unwrap();
+6 -6
src/post/mod.rs
··· 31 31 let mut result = jsonfeed::Item::builder() 32 32 .title(self.front_matter.title) 33 33 .content_html(self.body_html) 34 - .id(format!("https://christine.website/{}", self.link)) 35 - .url(format!("https://christine.website/{}", self.link)) 34 + .id(format!("https://xeiaso.net/{}", self.link)) 35 + .url(format!("https://xeiaso.net/{}", self.link)) 36 36 .date_published(self.date.to_rfc3339()) 37 37 .author( 38 38 jsonfeed::Author::new() 39 39 .name("Xe Iaso") 40 - .url("https://christine.website") 41 - .avatar("https://christine.website/static/img/avatar.png"), 40 + .url("https://xeiaso.net") 41 + .avatar("https://xeiaso.net/static/img/avatar.png"), 42 42 ); 43 43 44 44 let mut tags: Vec<String> = vec![]; ··· 105 105 106 106 let mentions: Vec<mi::WebMention> = match cli { 107 107 Some(cli) => cli 108 - .mentioners(format!("https://christine.website/{}", link)) 108 + .mentioners(format!("https://xeiaso.net/{}", link)) 109 109 .await 110 110 .map_err(|why| tracing::error!("error: can't load mentions for {}: {}", link, why)) 111 111 .unwrap_or(vec![]) ··· 130 130 let new_post = NewPost { 131 131 title: front_matter.title.clone(), 132 132 summary: format!("{} minute read", read_time_estimate_minutes), 133 - link: format!("https://christine.website/{}", link), 133 + link: format!("https://xeiaso.net/{}", link), 134 134 }; 135 135 136 136 Ok(Post {