resume cleanups
This commit is contained in:
parent
160b2ea74e
commit
dfc55be049
28
src/app.rs
28
src/app.rs
|
@ -36,17 +36,7 @@ pub struct Config {
|
|||
resume_fname: PathBuf,
|
||||
}
|
||||
|
||||
pub struct State {
|
||||
pub cfg: Config,
|
||||
pub signalboost: Vec<Person>,
|
||||
pub resume: String,
|
||||
}
|
||||
|
||||
pub fn init<'a>() -> Result<State> {
|
||||
let cfg: Config = envy::from_env()?;
|
||||
let sb = serde_dhall::from_file(cfg.signalboost_fname.clone()).parse()?;
|
||||
let resume = fs::read_to_string(cfg.resume_fname.clone())?;
|
||||
let resume: String = {
|
||||
pub fn markdown(inp: &str) -> String {
|
||||
let mut options = ComrakOptions::default();
|
||||
|
||||
options.extension.autolink = true;
|
||||
|
@ -58,8 +48,20 @@ pub fn init<'a>() -> Result<State> {
|
|||
|
||||
options.render.unsafe_ = true;
|
||||
|
||||
markdown_to_html(&resume, &options)
|
||||
};
|
||||
markdown_to_html(inp, &options)
|
||||
}
|
||||
|
||||
pub struct State {
|
||||
pub cfg: Config,
|
||||
pub signalboost: Vec<Person>,
|
||||
pub resume: String,
|
||||
}
|
||||
|
||||
pub fn init<'a>() -> Result<State> {
|
||||
let cfg: Config = envy::from_env()?;
|
||||
let sb = serde_dhall::from_file(cfg.signalboost_fname.clone()).parse()?;
|
||||
let resume = fs::read_to_string(cfg.resume_fname.clone())?;
|
||||
let resume: String = markdown(&resume);
|
||||
|
||||
Ok(State {
|
||||
cfg: cfg,
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
use crate::{
|
||||
app::State,
|
||||
templates::{self, RenderRucte, Html},
|
||||
templates::{self, Html, RenderRucte},
|
||||
};
|
||||
use std::sync::Arc;
|
||||
use warp::{
|
||||
http::{Response, StatusCode},
|
||||
path, Filter, Rejection, Reply,
|
||||
};
|
||||
use warp::{http::Response, Rejection, Reply};
|
||||
|
||||
pub async fn index() -> Result<impl Reply, Rejection> {
|
||||
Response::builder().html(|o| templates::index_html(o))
|
||||
|
|
|
@ -6,4 +6,8 @@
|
|||
|
||||
@resume
|
||||
|
||||
<hr />
|
||||
|
||||
<a href="/static/resume/resume.md">Plain-text version of this resume here</a>
|
||||
|
||||
@:footer_html()
|
||||
|
|
Loading…
Reference in New Issue