aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-08-29 16:59:57 +0200
committermetamuffin <metamuffin@disroot.org>2022-08-29 16:59:57 +0200
commit7853c8a551806007c3697a38fa5f929ca45a0985 (patch)
tree52152d615d88a5ef5ca795a58722c4e6a52882e6
parentddc681c7793a990a67ae61ec183bb1a1138ea3ef (diff)
downloadmetamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar
metamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar.bz2
metamuffin-blog-7853c8a551806007c3697a38fa5f929ca45a0985.tar.zst
rename tools to code
-rw-r--r--.gitignore2
-rw-r--r--COPYING2
-rw-r--r--code/Cargo.lock (renamed from tools/Cargo.lock)0
-rw-r--r--code/Cargo.toml (renamed from tools/Cargo.toml)0
-rw-r--r--code/makefile (renamed from tools/makefile)11
-rw-r--r--code/src/main.rs (renamed from tools/src/main.rs)2
-rw-r--r--content/articles/2022-08-29-blog-start.md15
-rw-r--r--content/style.css19
-rw-r--r--readme.md6
9 files changed, 44 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index af81f9b..b80cd42 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-/tools/target
+/code/target
/content/out
diff --git a/COPYING b/COPYING
index 94d171f..b5f4d09 100644
--- a/COPYING
+++ b/COPYING
@@ -1,6 +1,6 @@
This project is split in two parts, with a different license.
-1. Tools (everything in the `tools` directory)
+1. Code (everything in the `code` directory)
metamuffin's blog tools
Copyright (C) 2022 metamuffin
diff --git a/tools/Cargo.lock b/code/Cargo.lock
index b9776eb..b9776eb 100644
--- a/tools/Cargo.lock
+++ b/code/Cargo.lock
diff --git a/tools/Cargo.toml b/code/Cargo.toml
index 62fbb09..62fbb09 100644
--- a/tools/Cargo.toml
+++ b/code/Cargo.toml
diff --git a/tools/makefile b/code/makefile
index 5e8d26d..fa1464d 100644
--- a/tools/makefile
+++ b/code/makefile
@@ -1,17 +1,20 @@
-TOOL := ../tools/target/debug/blog-tool
+TOOL := ../code/target/debug/blog-tool
SRC_ARTICLES := $(shell find articles -type f)
OUT_ARTICLES := $(SRC_ARTICLES:articles/%.md=out/%.html)
all: $(OUT_ARTICLES) out/index.html
+out/style.css: style.css
+ cp $< $@
+
out/index.html: $(TOOL) $(SRC_ARTICLES)
$(TOOL) render-index ./articles > $@
-out/%.html: articles/%.md $(TOOL)
+out/%.html: articles/%.md $(TOOL) out/style.css
mkdir -p out
$(TOOL) render-article $< > $@
-$(TOOL): $(shell find ../tools/src -type f)
- sh -c 'cd ../tools; cargo build'
+$(TOOL): $(shell find ../code/src -type f)
+ sh -c 'cd ../code; cargo build'
diff --git a/tools/src/main.rs b/code/src/main.rs
index 0dc57c0..09ce3d8 100644
--- a/tools/src/main.rs
+++ b/code/src/main.rs
@@ -116,7 +116,7 @@ fn blocks_to_html(blocks: Vec<Block>) -> String {
markdown::Block::Header(text, level) => {
format!("<h{level}>{}</h{level}>", span_to_html(text))
}
- markdown::Block::Paragraph(p) => span_to_html(p),
+ 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) => {
format!("<pre><code>{}</code></pre>", escape(&content)) // TODO syntax highlighting
diff --git a/content/articles/2022-08-29-blog-start.md b/content/articles/2022-08-29-blog-start.md
index 5195263..49c3ba6 100644
--- a/content/articles/2022-08-29-blog-start.md
+++ b/content/articles/2022-08-29-blog-start.md
@@ -1,5 +1,14 @@
-# Starting my blog
+# Blog test
-test
-*blub*
+Hello world!
+## heading
+
+_italic_ **bold** `code`
+
+### sub heading
+
+```
+code
+block
+```
diff --git a/content/style.css b/content/style.css
new file mode 100644
index 0000000..749fcae
--- /dev/null
+++ b/content/style.css
@@ -0,0 +1,19 @@
+:root {
+ --font1: white;
+ --font2: #ff62fc;
+ --bg1: #1a051d;
+ --bg2: #3b1041;
+}
+
+body {
+ margin: 2em;
+ background-color: var(--bg1);
+}
+
+nav {
+ background-color: var(--bg2);
+}
+
+p,h1,h2,h3,h4,h5,h6,span {
+ color: var(--font1)
+}
diff --git a/readme.md b/readme.md
index 754f043..c96fee1 100644
--- a/readme.md
+++ b/readme.md
@@ -4,6 +4,6 @@ TODO
## License
-- For `tools`: GNU-AGPL-3.0-only
-- For `content`: CC-BY-ND-4.0
-- See `COPYING`
+- For `./code`: GNU-AGPL-3.0-only
+- For `./content`: CC-BY-ND-4.0
+- See `./COPYING`