aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-08-29 17:45:29 +0200
committermetamuffin <metamuffin@disroot.org>2022-08-29 17:45:29 +0200
commitda2a95bec7540db923176ae66b8e604011e975e7 (patch)
treeb2ec07f707484d984549f575df951c2498bb0fc3
parentbde6205cd1b268094460c90ccfb7610e52be5dc1 (diff)
downloadmetamuffin-blog-da2a95bec7540db923176ae66b8e604011e975e7.tar
metamuffin-blog-da2a95bec7540db923176ae66b8e604011e975e7.tar.bz2
metamuffin-blog-da2a95bec7540db923176ae66b8e604011e975e7.tar.zst
more stuff
-rw-r--r--code/src/main.rs19
-rw-r--r--content/articles/2022-08-29-blog-test.md4
2 files changed, 14 insertions, 9 deletions
diff --git a/code/src/main.rs b/code/src/main.rs
index bbc0e89..6e281df 100644
--- a/code/src/main.rs
+++ b/code/src/main.rs
@@ -56,7 +56,8 @@ fn scaffold(title: String, body: impl Render) -> impl Render {
),
body!(
nav!(h2!("metamuffin's blog"), a!(href = "./index.html", "index")),
- article!(body)
+ article!(body),
+ footer!(p!("written by metamuffin, licensed under CC-BY-ND-4.0"))
)
)
}
@@ -116,15 +117,15 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
let mut out = String::new();
for e in blocks {
out += match e {
- markdown::Block::Header(text, level) => {
+ Block::Header(text, level) => {
format!("<h{level}>{}</h{level}>", span_to_html(text))
}
- markdown::Block::Paragraph(p) => format!("<p>{}</p>", span_to_html(p)),
- markdown::Block::Blockquote(q) => format!("<quote>{}</quote>", blocks_to_html(q)),
- markdown::Block::CodeBlock(_syntax, content) => {
+ Block::Paragraph(p) => format!("<p>{}</p>", span_to_html(p)),
+ Block::Blockquote(q) => format!("<quote>{}</quote>", blocks_to_html(q)),
+ Block::CodeBlock(_syntax, content) => {
format!("<code><pre>{}</pre></code>", escape(&content)) // TODO syntax highlighting
}
- markdown::Block::OrderedList(els, _) => format!(
+ Block::OrderedList(els, _) => format!(
"<ol>{}</ol>",
els.into_iter()
.map(|e| format!(
@@ -137,7 +138,7 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
.collect::<Vec<_>>()
.join("")
),
- markdown::Block::UnorderedList(els) => {
+ Block::UnorderedList(els) => {
format!(
"<ul>{}</ul>",
els.into_iter()
@@ -152,8 +153,8 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
.join("")
)
}
- markdown::Block::Raw(r) => r,
- markdown::Block::Hr => format!("<hr/>"),
+ Block::Raw(r) => r,
+ Block::Hr => format!("<hr/>"),
}
.as_str();
}
diff --git a/content/articles/2022-08-29-blog-test.md b/content/articles/2022-08-29-blog-test.md
index 6cbe4fd..ea4d166 100644
--- a/content/articles/2022-08-29-blog-test.md
+++ b/content/articles/2022-08-29-blog-test.md
@@ -8,11 +8,15 @@ _italic_ **bold** `code` [Link](https://metamuffin.org/)
### sub heading
+Look at this code here.
+
```
code
block
```
+As you can see, its pointless i.e. no points
+
- list
- list
- list