The code and data behind xeiaso.net
5
fork

Configure Feed

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

rename jsonfeed to xe_jsonfeed to prepare for my own extensions

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

Xe Iaso 6be8b24d 03fa2e33

+25 -25
+11 -11
Cargo.lock
··· 1269 1269 ] 1270 1270 1271 1271 [[package]] 1272 - name = "jsonfeed" 1273 - version = "0.3.0" 1274 - dependencies = [ 1275 - "error-chain", 1276 - "serde", 1277 - "serde_derive", 1278 - "serde_json", 1279 - ] 1280 - 1281 - [[package]] 1282 1272 name = "kankyo" 1283 1273 version = "0.3.0" 1284 1274 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3208 3198 ] 3209 3199 3210 3200 [[package]] 3201 + name = "xe_jsonfeed" 3202 + version = "0.3.0" 3203 + dependencies = [ 3204 + "error-chain", 3205 + "serde", 3206 + "serde_derive", 3207 + "serde_json", 3208 + ] 3209 + 3210 + [[package]] 3211 3211 name = "xesite" 3212 3212 version = "2.4.0" 3213 3213 dependencies = [ ··· 3228 3228 "http", 3229 3229 "http-body", 3230 3230 "hyper", 3231 - "jsonfeed", 3232 3231 "kankyo", 3233 3232 "lazy_static", 3234 3233 "log", ··· 3260 3259 "tracing-subscriber", 3261 3260 "url", 3262 3261 "uuid 0.8.2", 3262 + "xe_jsonfeed", 3263 3263 "xml-rs", 3264 3264 ] 3265 3265
+1 -1
Cargo.toml
··· 50 50 51 51 # workspace dependencies 52 52 cfcache = { path = "./lib/cfcache" } 53 - jsonfeed = { path = "./lib/jsonfeed" } 53 + xe_jsonfeed = { path = "./lib/jsonfeed" } 54 54 mi = { path = "./lib/mi" } 55 55 patreon = { path = "./lib/patreon" } 56 56
+5 -5
lib/jsonfeed/Cargo.toml
··· 1 1 [package] 2 - authors = ["Paul Woolcock <paul@woolcock.us>", "Xe Iaso <me@christine.website>"] 3 - description = "Parser for the JSONFeed (http://jsonfeed.org) specification\n" 4 - documentation = "https://docs.rs/jsonfeed" 5 - homepage = "https://github.com/pwoolcoc/jsonfeed" 2 + authors = ["Paul Woolcock <paul@woolcock.us>", "Xe Iaso <me@xeiaso.net>"] 3 + description = "Parser for the JSONFeed (http://jsonfeed.org) specification" 4 + documentation = "https://docs.rs/xe_jsonfeed" 5 + homepage = "https://github.com/Xe/site" 6 6 license = "MIT/Apache-2.0" 7 - name = "jsonfeed" 7 + name = "xe_jsonfeed" 8 8 readme = "README.adoc" 9 9 version = "0.3.0" 10 10
+3 -3
src/app/mod.rs
··· 54 54 pub gallery: Vec<Post>, 55 55 pub talks: Vec<Post>, 56 56 pub everything: Vec<Post>, 57 - pub jf: jsonfeed::Feed, 57 + pub jf: xe_jsonfeed::Feed, 58 58 pub sitemap: Vec<u8>, 59 59 pub patrons: Option<patreon::Users>, 60 60 pub mi: mi::Client, ··· 93 93 .take(5) 94 94 .collect(); 95 95 96 - let mut jfb = jsonfeed::Feed::builder() 96 + let mut jfb = xe_jsonfeed::Feed::builder() 97 97 .title("Xe's Blog") 98 98 .description("My blog posts and rants about various technology things.") 99 99 .author( 100 - jsonfeed::Author::new() 100 + xe_jsonfeed::Author::new() 101 101 .name("Xe") 102 102 .url("https://xeiaso.net") 103 103 .avatar(ICON),
+1 -1
src/handlers/feeds.rs
··· 20 20 } 21 21 22 22 #[instrument(skip(state))] 23 - pub async fn jsonfeed(Extension(state): Extension<Arc<State>>) -> Json<jsonfeed::Feed> { 23 + pub async fn jsonfeed(Extension(state): Extension<Arc<State>>) -> Json<xe_jsonfeed::Feed> { 24 24 HIT_COUNTER.with_label_values(&["json"]).inc(); 25 25 let state = state.clone(); 26 26 Json(state.jf.clone())
+4 -4
src/post/mod.rs
··· 27 27 pub link: String, 28 28 } 29 29 30 - impl Into<jsonfeed::Item> for Post { 31 - fn into(self) -> jsonfeed::Item { 32 - let mut result = jsonfeed::Item::builder() 30 + impl Into<xe_jsonfeed::Item> for Post { 31 + fn into(self) -> xe_jsonfeed::Item { 32 + let mut result = xe_jsonfeed::Item::builder() 33 33 .title(self.front_matter.title) 34 34 .content_html(self.body_html) 35 35 .id(format!("https://xeiaso.net/{}", self.link)) 36 36 .url(format!("https://xeiaso.net/{}", self.link)) 37 37 .date_published(self.date.to_rfc3339()) 38 38 .author( 39 - jsonfeed::Author::new() 39 + xe_jsonfeed::Author::new() 40 40 .name("Xe Iaso") 41 41 .url("https://xeiaso.net") 42 42 .avatar("https://xeiaso.net/static/img/avatar.png"),