fix
This commit is contained in:
parent
00f8fdc9e1
commit
c6f15577bb
|
@ -91,15 +91,9 @@ fn main() -> Result<(), maj::server::Error> {
|
||||||
thread::spawn(move || http::run(h.clone(), port));
|
thread::spawn(move || http::run(h.clone(), port));
|
||||||
}
|
}
|
||||||
|
|
||||||
task::block_on(maj::server::serve(
|
task::block_on(maj::server::serve(h.clone(), config, opts.host, opts.port))?;
|
||||||
h.clone(),
|
|
||||||
config,
|
|
||||||
opts.host,
|
|
||||||
opts.port,
|
|
||||||
))?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// And finally, include the generated code for templates and static files.
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/templates.rs"));
|
include!(concat!(env!("OUT_DIR"), "/templates.rs"));
|
||||||
|
|
|
@ -62,8 +62,8 @@ pub fn render(nodes: Vec<Node>, out: &mut impl Write) -> io::Result<()> {
|
||||||
match node {
|
match node {
|
||||||
Text(body) => write!(out, "{}\n", body)?,
|
Text(body) => write!(out, "{}\n", body)?,
|
||||||
Link { to, name } => match name {
|
Link { to, name } => match name {
|
||||||
Some(name) => write!(out, "{} {}\n", to, name)?,
|
Some(name) => write!(out, "=> {} {}\n", to, name)?,
|
||||||
None => write!(out, "{}\n", to)?,
|
None => write!(out, "=> {}\n", to)?,
|
||||||
},
|
},
|
||||||
Preformatted(body) => write!(out, "```\n{}\n```\n", body)?,
|
Preformatted(body) => write!(out, "```\n{}\n```\n", body)?,
|
||||||
Heading { level, body } => write!(out, "{} {}\n", "#".repeat(level as usize), body)?,
|
Heading { level, body } => write!(out, "{} {}\n", "#".repeat(level as usize), body)?,
|
||||||
|
|
Loading…
Reference in New Issue