about summary refs log tree commit diff
path: root/src/frontend/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mod.rs')
-rw-r--r--src/frontend/mod.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs
index daeebd9..106d839 100644
--- a/src/frontend/mod.rs
+++ b/src/frontend/mod.rs
@@ -4,21 +4,12 @@ use serde::{Deserialize, Serialize};
 use futures_util::TryFutureExt;
 use warp::{http::StatusCode, Filter, host::Authority, path::FullPath};
 
-static POSTS_PER_PAGE: usize = 20;
-
 //pub mod login;
 
-mod templates;
 #[allow(unused_imports)]
-use templates::{ErrorPage, MainPage, OnboardingPage, Template};
-
-#[derive(Clone, Serialize, Deserialize)]
-pub struct IndiewebEndpoints {
-    pub authorization_endpoint: String,
-    pub token_endpoint: String,
-    pub webmention: Option<String>,
-    pub microsub: Option<String>,
-}
+use kittybox_templates::{ErrorPage, MainPage, OnboardingPage, Template, POSTS_PER_PAGE};
+
+pub use kittybox_util::IndiewebEndpoints;
 
 #[derive(Deserialize)]
 struct QueryParams {
@@ -364,17 +355,17 @@ pub fn catchall<D: Storage>(db: D, endpoints: IndiewebEndpoints) -> impl Filter<
             {
                 Some("h-entry") => Ok((
                     post_name.unwrap_or("Note").to_string(),
-                    templates::Entry { post: &post }.to_string(),
+                    kittybox_templates::Entry { post: &post }.to_string(),
                     StatusCode::OK
                 )),
                 Some("h-card") => Ok((
                     post_name.unwrap_or("Contact card").to_string(),
-                    templates::VCard { card: &post }.to_string(),
+                    kittybox_templates::VCard { card: &post }.to_string(),
                     StatusCode::OK
                 )),
                 Some("h-feed") => Ok((
                     post_name.unwrap_or("Feed").to_string(),
-                    templates::Feed { feed: &post }.to_string(),
+                    kittybox_templates::Feed { feed: &post }.to_string(),
                     StatusCode::OK
                 )),
                 _ => Err(warp::reject::custom(FrontendError::with_code(