rename jsonfeed to xe_jsonfeed to prepare for my own extensions

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-07-04 14:44:00 +00:00
parent 03fa2e33a1
commit 6be8b24dd2
6 changed files with 25 additions and 25 deletions

22
Cargo.lock generated
View File

@ -1268,16 +1268,6 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "jsonfeed"
version = "0.3.0"
dependencies = [
"error-chain",
"serde",
"serde_derive",
"serde_json",
]
[[package]] [[package]]
name = "kankyo" name = "kankyo"
version = "0.3.0" version = "0.3.0"
@ -3207,6 +3197,16 @@ dependencies = [
"dirs", "dirs",
] ]
[[package]]
name = "xe_jsonfeed"
version = "0.3.0"
dependencies = [
"error-chain",
"serde",
"serde_derive",
"serde_json",
]
[[package]] [[package]]
name = "xesite" name = "xesite"
version = "2.4.0" version = "2.4.0"
@ -3228,7 +3228,6 @@ dependencies = [
"http", "http",
"http-body", "http-body",
"hyper", "hyper",
"jsonfeed",
"kankyo", "kankyo",
"lazy_static", "lazy_static",
"log", "log",
@ -3260,6 +3259,7 @@ dependencies = [
"tracing-subscriber", "tracing-subscriber",
"url", "url",
"uuid 0.8.2", "uuid 0.8.2",
"xe_jsonfeed",
"xml-rs", "xml-rs",
] ]

View File

@ -50,7 +50,7 @@ uuid = { version = "0.8", features = ["serde", "v4"] }
# workspace dependencies # workspace dependencies
cfcache = { path = "./lib/cfcache" } cfcache = { path = "./lib/cfcache" }
jsonfeed = { path = "./lib/jsonfeed" } xe_jsonfeed = { path = "./lib/jsonfeed" }
mi = { path = "./lib/mi" } mi = { path = "./lib/mi" }
patreon = { path = "./lib/patreon" } patreon = { path = "./lib/patreon" }

View File

@ -1,10 +1,10 @@
[package] [package]
authors = ["Paul Woolcock <paul@woolcock.us>", "Xe Iaso <me@christine.website>"] authors = ["Paul Woolcock <paul@woolcock.us>", "Xe Iaso <me@xeiaso.net>"]
description = "Parser for the JSONFeed (http://jsonfeed.org) specification\n" description = "Parser for the JSONFeed (http://jsonfeed.org) specification"
documentation = "https://docs.rs/jsonfeed" documentation = "https://docs.rs/xe_jsonfeed"
homepage = "https://github.com/pwoolcoc/jsonfeed" homepage = "https://github.com/Xe/site"
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
name = "jsonfeed" name = "xe_jsonfeed"
readme = "README.adoc" readme = "README.adoc"
version = "0.3.0" version = "0.3.0"

View File

@ -54,7 +54,7 @@ pub struct State {
pub gallery: Vec<Post>, pub gallery: Vec<Post>,
pub talks: Vec<Post>, pub talks: Vec<Post>,
pub everything: Vec<Post>, pub everything: Vec<Post>,
pub jf: jsonfeed::Feed, pub jf: xe_jsonfeed::Feed,
pub sitemap: Vec<u8>, pub sitemap: Vec<u8>,
pub patrons: Option<patreon::Users>, pub patrons: Option<patreon::Users>,
pub mi: mi::Client, pub mi: mi::Client,
@ -93,11 +93,11 @@ pub async fn init(cfg: PathBuf) -> Result<State> {
.take(5) .take(5)
.collect(); .collect();
let mut jfb = jsonfeed::Feed::builder() let mut jfb = xe_jsonfeed::Feed::builder()
.title("Xe's Blog") .title("Xe's Blog")
.description("My blog posts and rants about various technology things.") .description("My blog posts and rants about various technology things.")
.author( .author(
jsonfeed::Author::new() xe_jsonfeed::Author::new()
.name("Xe") .name("Xe")
.url("https://xeiaso.net") .url("https://xeiaso.net")
.avatar(ICON), .avatar(ICON),

View File

@ -20,7 +20,7 @@ lazy_static! {
} }
#[instrument(skip(state))] #[instrument(skip(state))]
pub async fn jsonfeed(Extension(state): Extension<Arc<State>>) -> Json<jsonfeed::Feed> { pub async fn jsonfeed(Extension(state): Extension<Arc<State>>) -> Json<xe_jsonfeed::Feed> {
HIT_COUNTER.with_label_values(&["json"]).inc(); HIT_COUNTER.with_label_values(&["json"]).inc();
let state = state.clone(); let state = state.clone();
Json(state.jf.clone()) Json(state.jf.clone())

View File

@ -27,16 +27,16 @@ pub struct NewPost {
pub link: String, pub link: String,
} }
impl Into<jsonfeed::Item> for Post { impl Into<xe_jsonfeed::Item> for Post {
fn into(self) -> jsonfeed::Item { fn into(self) -> xe_jsonfeed::Item {
let mut result = jsonfeed::Item::builder() let mut result = xe_jsonfeed::Item::builder()
.title(self.front_matter.title) .title(self.front_matter.title)
.content_html(self.body_html) .content_html(self.body_html)
.id(format!("https://xeiaso.net/{}", self.link)) .id(format!("https://xeiaso.net/{}", self.link))
.url(format!("https://xeiaso.net/{}", self.link)) .url(format!("https://xeiaso.net/{}", self.link))
.date_published(self.date.to_rfc3339()) .date_published(self.date.to_rfc3339())
.author( .author(
jsonfeed::Author::new() xe_jsonfeed::Author::new()
.name("Xe Iaso") .name("Xe Iaso")
.url("https://xeiaso.net") .url("https://xeiaso.net")
.avatar("https://xeiaso.net/static/img/avatar.png"), .avatar("https://xeiaso.net/static/img/avatar.png"),