add contact and feeds pages

This commit is contained in:
Cadey Ratio 2020-07-12 18:58:38 -04:00
parent db7998bbed
commit 6a375cb218
5 changed files with 68 additions and 8 deletions

View File

@ -38,4 +38,5 @@ mkShell {
];
CLACK_SET = "Ashlynn,Terry Davis,Dennis Ritchie";
RUST_LOG = "info";
}

View File

@ -7,3 +7,11 @@ use warp::{
pub async fn index() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::index_html(o))
}
pub async fn contact() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::contact_html(o))
}
pub async fn feeds() -> Result<impl Reply, Rejection> {
Response::builder().html(|o| templates::feeds_html(o))
}

View File

@ -13,19 +13,16 @@ async fn main() -> Result<()> {
let state = app::init()?;
// GET /hello/warp => 200 OK with body "Hello, warp!"
let hello = warp::path!("hello" / String).map(|name| format!("Hello, {}!", name));
let routes = warp::get()
.and(path::end().and_then(handlers::index))
.or(warp::path!("contact").and_then(handlers::contact))
.or(warp::path!("feeds").and_then(handlers::feeds));
let files = warp::path("static")
.and(warp::fs::dir("./static"))
.or(warp::path("css").and(warp::fs::dir("./css")));
let site = warp::get()
.and(path::end())
.and_then(handlers::index)
.or(hello)
.or(files)
.with(warp::log(APPLICATION_NAME));
let site = routes.or(files).with(warp::log(APPLICATION_NAME));
warp::serve(site).run(([127, 0, 0, 1], 3030)).await;

39
templates/contact.rs.html Normal file
View File

@ -0,0 +1,39 @@
@use super::{header_html, footer_html};
@()
@:header_html(Some("Contact"), None)
<h1>Contact Information</h1>
<div class="grid">
<div class="cell -6of12">
<h3>Email</h3>
<p>me@@christine.website</p>
<p>My GPG fingerprint is <code>799F 9134 8118 1111</code>. If you get an email that appears to be from me and the signature does not match that fingerprint, it is not from me. You may download a copy of my public key <a href="/static/gpg.pub">here</a>.</p>
<h3>Social Media</h3>
<ul>
<li><a href="https://github.com/Xe">Github</a></li>
<li><a href="https://twitter.com/theprincessxena">Twitter</a></li>
<li><a href="https://keybase.io/xena">Keybase</a></li>
<li><a href="https://ko-fi.com/A265JE0">Ko-fi</a></li>
<li><a href="https://www.patreon.com/cadey">Patreon</a></li>
<li><a href="https://www.facebook.com/chrissycade1337">Facebook</a></li>
<li><a href="https://mst3k.interlinked.me/@@cadey">@@cadey@@mst3k.interlinked.me</a></li>
<li>Fortnite: Within Reason</li>
</ul>
</div>
<div class="cell -6of12">
<h3>Other Information</h3>
<p>I have a <a href="https://www.patreon.com/cadey">Patreon</a> if you want to send donations, otherwise my <a href="https://ko-fi.com/A265JE0">Ko-Fi</a> works too.</p>
<h4>Telegram</h4>
<p><a href="https://t.me/miamorecadenza">@@miamorecadenza</a></p>
<h4>Discord</h4>
<p><code>Cadey~#1337</code></p>
</div>
</div>
@:footer_html()

15
templates/feeds.rs.html Normal file
View File

@ -0,0 +1,15 @@
@use super::{header_html, footer_html};
@()
@:header_html(Some("Feeds"), None)
<h1>Feeds</h1>
<ul>
<li>Blog: <a href="/blog.rss">RSS</a> - <a href="/blog.json">JSONFeed</a></li>
<li>Twitter: <a href="https://rssbox.herokuapp.com/twitter/2573767249/theprincessxena">RSS</a></li>
<li>Mastodon: <a href="https://mst3k.interlinked.me/users/cadey.rss">RSS</a></li>
</ul>
@:footer_html()