aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorXe Iaso <me@christine.website>2022-03-21 20:14:14 -0400
committerGitHub <noreply@github.com>2022-03-21 20:14:14 -0400
commit8b747c1c40876c6668191594eddcb260199cdb7f (patch)
tree86edb9bc382751c6a32f5f2946ff235ea06674ba /lib
parentf45ca40ae1052d46611ff2f27ad281695afc4f8f (diff)
downloadxesite-8b747c1c40876c6668191594eddcb260199cdb7f.tar.xz
xesite-8b747c1c40876c6668191594eddcb260199cdb7f.zip
Rewrite the site routing with Axum (#441)
* broken state Signed-off-by: Xe Iaso <me@christine.website> * fix??? Signed-off-by: Xe Iaso <me@christine.website> * Port everything else to axum Signed-off-by: Xe <me@christine.website> * headers Signed-off-by: Xe Iaso <me@christine.website> * site update post Signed-off-by: Christine Dodrill <me@christine.website> * fix headers Signed-off-by: Xe Iaso <me@christine.website> * remove warp example Signed-off-by: Xe Iaso <me@christine.website> * 80c wrap Signed-off-by: Xe Iaso <me@christine.website> * bump version Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'lib')
-rw-r--r--lib/go_vanity/Cargo.toml15
-rw-r--r--lib/go_vanity/src/build.rs5
-rw-r--r--lib/go_vanity/src/lib.rs12
-rw-r--r--lib/go_vanity/templates/gitea.rs.html14
-rw-r--r--lib/go_vanity/templates/github.rs.html14
-rw-r--r--lib/mi/src/lib.rs4
6 files changed, 2 insertions, 62 deletions
diff --git a/lib/go_vanity/Cargo.toml b/lib/go_vanity/Cargo.toml
deleted file mode 100644
index e6bcf6d..0000000
--- a/lib/go_vanity/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "go_vanity"
-version = "0.2.0"
-authors = ["Xe Iaso <me@christine.website>"]
-edition = "2018"
-build = "src/build.rs"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-mime = "0.3"
-warp = "0.3"
-
-[build-dependencies]
-ructe = { version = "0.13", features = ["warp02"] }
diff --git a/lib/go_vanity/src/build.rs b/lib/go_vanity/src/build.rs
deleted file mode 100644
index f36737c..0000000
--- a/lib/go_vanity/src/build.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-use ructe::{Result, Ructe};
-
-fn main() -> Result<()> {
- Ructe::from_env()?.compile_templates("templates")
-}
diff --git a/lib/go_vanity/src/lib.rs b/lib/go_vanity/src/lib.rs
deleted file mode 100644
index 756c555..0000000
--- a/lib/go_vanity/src/lib.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-use crate::templates::RenderRucte;
-use warp::{http::Response, Rejection, Reply};
-
-include!(concat!(env!("OUT_DIR"), "/templates.rs"));
-
-pub async fn gitea(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> {
- Response::builder().html(|o| templates::gitea_html(o, pkg_name, git_repo, branch))
-}
-
-pub async fn github(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> {
- Response::builder().html(|o| templates::github_html(o, pkg_name, git_repo, branch))
-}
diff --git a/lib/go_vanity/templates/gitea.rs.html b/lib/go_vanity/templates/gitea.rs.html
deleted file mode 100644
index f062d91..0000000
--- a/lib/go_vanity/templates/gitea.rs.html
+++ /dev/null
@@ -1,14 +0,0 @@
-@(pkg_name: &str, git_repo: &str, branch: &str)
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta name="go-import" content="@pkg_name git @git_repo">
- <meta name="go-source" content="@pkg_name @git_repo @git_repo/src/@branch@{/dir@} @git_repo/src/@branch@{/dir@}/@{file@}#L@{line@}">
- <meta http-equiv="refresh" content="0; url=https://godoc.org/@pkg_name">
- </head>
- <body>
- Please see <a href="https://godoc.org/@pkg_name">here</a> for documentation on this package.
- </body>
-</html>
diff --git a/lib/go_vanity/templates/github.rs.html b/lib/go_vanity/templates/github.rs.html
deleted file mode 100644
index 9782b1c..0000000
--- a/lib/go_vanity/templates/github.rs.html
+++ /dev/null
@@ -1,14 +0,0 @@
-@(pkg_name: &str, git_repo: &str, branch: &str)
-
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta name="go-import" content="@pkg_name git @git_repo">
- <meta name="go-source" content="@pkg_name @git_repo @git_repo/tree/@branch@{/dir@} @git_repo/blob/@branch@{/dir@}/@{file@}#L@{line@}">
- <meta http-equiv="refresh" content="0; url=https://godoc.org/@pkg_name">
- </head>
- <body>
- Please see <a href="https://godoc.org/@pkg_name">here</a> for documentation on this package.
- </body>
-</html>
diff --git a/lib/mi/src/lib.rs b/lib/mi/src/lib.rs
index 0e19bec..4263970 100644
--- a/lib/mi/src/lib.rs
+++ b/lib/mi/src/lib.rs
@@ -1,6 +1,6 @@
use color_eyre::eyre::Result;
use reqwest::header;
-use serde::Deserialize;
+use serde::{Deserialize, Serialize};
use tracing::instrument;
const USER_AGENT_BASE: &str = concat!(
@@ -58,7 +58,7 @@ impl Client {
}
}
-#[derive(Debug, Deserialize, Eq, PartialEq, Clone)]
+#[derive(Debug, Deserialize, Eq, PartialEq, Clone, Serialize)]
pub struct WebMention {
pub source: String,
pub title: Option<String>,