This commit is contained in:
Rakarake 2026-03-05 19:45:00 +01:00
parent 0fef98efaf
commit d1b04c13d1
5 changed files with 31 additions and 1 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
/target
.direnv/
blog.html
result.html

4
blog.md Normal file
View file

@ -0,0 +1,4 @@
## My Blogpost 1 - wholesome
wuhp
## My blogpost 2 - sadge
bubglub

3
run.sh Executable file
View file

@ -0,0 +1,3 @@
#/bin/sh
cargo run "$@" > blog.html
sed template.html -e '/INSERT_HERE/r blog.html' > result.html

View file

@ -1,3 +1,12 @@
use std::fs::read;
fn main() {
println!("Hello, world!");
// arg 1: src, arg 2: dest
let args: Vec<String> = std::env::args().collect();
let input: String = std::fs::read_to_string(&args[1]).unwrap();
let mut output = input;
// headings: replace # - newline to <h1> - </h1>
println!("{}", output);
}

12
template.html Normal file
View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width,initial-scale=1" />
<title>MDF BLOG</title>
</head>
<body>
<p>MDF BLOG 🍼</p>
INSERT_HERE
</body>
</html>