From bed0f202bb26f7259e5e66e7eac83c47c3b500c0 Mon Sep 17 00:00:00 2001 From: Never Gude Date: Wed, 10 Dec 2025 19:52:48 +0100 Subject: [PATCH] Refactor the build file --- public_html/eh/eh/eh/eh-eh/.html | 134 ---------------- public_html/eh/eh/eh/eh-eh/Makefile | 33 ++-- public_html/eh/eh/eh/eh-eh/about.html | 13 +- .../eh/eh/eh/eh-eh/{articles => }/about.md | 0 public_html/eh/eh/eh/eh-eh/article-1.html | 144 ++++++++++++++++++ public_html/eh/eh/eh/eh-eh/articles.json | 24 +++ .../eh/eh/eh/eh-eh/articles/article-1.md | 30 ++++ .../eh/eh-eh/articles/random-linux-utils.md | 1 + public_html/eh/eh/eh/eh-eh/index.html | 19 ++- .../eh/eh/eh/eh-eh/meta-json-template.txt | 1 - public_html/eh/eh/eh/eh-eh/meta.json | 7 - .../articles-template.txt} | 0 .../eh/eh/eh/eh-eh/pandoc/template.html | 2 +- .../eh/eh/eh/eh-eh/random-linux-utils.html | 9 +- 14 files changed, 243 insertions(+), 174 deletions(-) delete mode 100644 public_html/eh/eh/eh/eh-eh/.html rename public_html/eh/eh/eh/eh-eh/{articles => }/about.md (100%) create mode 100644 public_html/eh/eh/eh/eh-eh/article-1.html create mode 100644 public_html/eh/eh/eh/eh-eh/articles.json create mode 100644 public_html/eh/eh/eh/eh-eh/articles/article-1.md delete mode 100644 public_html/eh/eh/eh/eh-eh/meta-json-template.txt delete mode 100644 public_html/eh/eh/eh/eh-eh/meta.json rename public_html/eh/eh/eh/eh-eh/{meta.txt => pandoc/articles-template.txt} (100%) diff --git a/public_html/eh/eh/eh/eh-eh/.html b/public_html/eh/eh/eh/eh-eh/.html deleted file mode 100644 index af8a3db..0000000 --- a/public_html/eh/eh/eh/eh-eh/.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - - Random linux utilities - - - - - -
-

Random linux utilities

-

Neat things I picked up along the way

-

Never Gude

-

25.7.2025

-
-
- -
-

Merge pdfs

-

Using Ghostscript

-

Ghostscript has a feature to merge multiple pdf files into one. -Although ImageMagick also has this feature, I prefer this one, as it -doesn’t rasterize and scales down the pdf files.

-
-

Block quote time yay

-
-
gs -dNOPAUSE -sDEVICE=pdfwrite \
-    -sOUTPUTFILE=output.pdf \
-    -dBATCH 1.pdf 2.pdf
-
-
- - - diff --git a/public_html/eh/eh/eh/eh-eh/Makefile b/public_html/eh/eh/eh/eh-eh/Makefile index cc1f840..14f3409 100644 --- a/public_html/eh/eh/eh/eh-eh/Makefile +++ b/public_html/eh/eh/eh/eh-eh/Makefile @@ -1,12 +1,27 @@ -.PHONY: articles all +template := ./pandoc/template.html +style := ./pandoc/style.css -all: index articles +article_list := ./articles.json +list_template := ./pandoc/meta-json-template.txt -articles: - for file in articles/*.md; do \ - filename="$$(basename $${file} .md)"; \ - pandoc "$${file}" --template pandoc/template.html --css pandoc/style.css --highlight-style zenburn --mathml --toc --output "$${filename}.html"; \ - echo "generated $${filename}.html"; \ - done +articles := $(patsubst %.md,%.html,$(wildcard articles/*.md)) -index: +all: index.html about.html + +clean: + echo '{"articles": []}' > $(article_list); \ + rm $(notdir $(articles)); \ + rm index.html about.html; + + +$(articles): %.html: %.md + pandoc $< --template $(abspath $(template)) --css $(abspath $(style)) --highlight-style zenburn --mathml --toc --output $(notdir $@); \ + jq '.articles += [$(shell pandoc $< --template $(list_template))]' $(article_list) > articles.json.tmp; + cat ./articles.json.tmp > articles.json; + rm ./articles.json.tmp; + +index.html: index.md $(articles) + pandoc $< --template $(template) --css $(style) --metadata-file $(article_list) --output $@ + +about.html: about.md + pandoc $< --template $(template) --css $(style) --output $@ diff --git a/public_html/eh/eh/eh/eh-eh/about.html b/public_html/eh/eh/eh/eh-eh/about.html index 1c64788..b1351f4 100644 --- a/public_html/eh/eh/eh/eh-eh/about.html +++ b/public_html/eh/eh/eh/eh-eh/about.html @@ -20,8 +20,9 @@ margin: 0 0.8em 0.2em -1.6em; vertical-align: middle; } + .display.math{display: block; text-align: center; margin: 0.5rem auto;} - +
-

Stuff

-

i=1ki=k(k+1)2 \sum_{i=1}^k i = \frac{k(k+1)}{2}

+

$$ \sum_{i=1}^k i = \frac{k(k+1)}{2} +$$

diff --git a/public_html/eh/eh/eh/eh-eh/articles/about.md b/public_html/eh/eh/eh/eh-eh/about.md similarity index 100% rename from public_html/eh/eh/eh/eh-eh/articles/about.md rename to public_html/eh/eh/eh/eh-eh/about.md diff --git a/public_html/eh/eh/eh/eh-eh/article-1.html b/public_html/eh/eh/eh/eh-eh/article-1.html new file mode 100644 index 0000000..5ee71d6 --- /dev/null +++ b/public_html/eh/eh/eh/eh-eh/article-1.html @@ -0,0 +1,144 @@ + + + + + + + + Article 1 + + + + + +
+

Article 1

+

Just testimg

+

Never Gude

+

10.12.2025

+
+
+ +
+

Merge pdfs

+

Using Ghostscript

+

Ghostscript has a feature to merge multiple pdf files into one. +Although ImageMagick also has this feature, I prefer this one, as it +doesn’t rasterize and scales down the pdf files.

+
+

Block quote time yay

+
+
gs -dNOPAUSE -sDEVICE=pdfwrite \
+    -sOUTPUTFILE=output.pdf \
+    -dBATCH 1.pdf 2.pdf
+
int hello_world(int x) {
+    printf("Hello World %i", x);
+    return x;
+}
+
+ +
+ + + diff --git a/public_html/eh/eh/eh/eh-eh/articles.json b/public_html/eh/eh/eh/eh-eh/articles.json new file mode 100644 index 0000000..da909f3 --- /dev/null +++ b/public_html/eh/eh/eh/eh-eh/articles.json @@ -0,0 +1,24 @@ +{ + "articles": [ + { + "author": "Never Gude", + "date": "25.7.2025", + "subtitle": "Neat things I picked up along the way", + "summary": "Testing dsa dsa dsa dsa DDDDDDDDDDDa", + "title": "Random linux utilities" + }, + { + "author": "Never Gude", + "date": "10.12.2025", + "subtitle": "Just testimg", + "title": "Article 1" + }, + { + "author": "Never Gude", + "date": "25.7.2025", + "subtitle": "Neat things I picked up along the way", + "summary": "Testing dsa dsa dsa dsa DDDDDDDDDDDa", + "title": "Random linux utilities" + } + ] +} diff --git a/public_html/eh/eh/eh/eh-eh/articles/article-1.md b/public_html/eh/eh/eh/eh-eh/articles/article-1.md new file mode 100644 index 0000000..0b9d14a --- /dev/null +++ b/public_html/eh/eh/eh/eh-eh/articles/article-1.md @@ -0,0 +1,30 @@ +--- +title: Article 1 +subtitle: Just testimg +author: Never Gude +date: 10.12.2025 +--- + +## Merge pdfs +### Using Ghostscript +Ghostscript has a feature to merge multiple pdf files into one. +Although ImageMagick also has this feature, I prefer this one, as it doesn't rasterize and scales down +the pdf files. + +> Block +> quote +> time yay + +```bash {.numberLines} +gs -dNOPAUSE -sDEVICE=pdfwrite \ + -sOUTPUTFILE=output.pdf \ + -dBATCH 1.pdf 2.pdf +``` + +```c +int hello_world(int x) { + printf("Hello World %i", x); + return x; +} + +``` diff --git a/public_html/eh/eh/eh/eh-eh/articles/random-linux-utils.md b/public_html/eh/eh/eh/eh-eh/articles/random-linux-utils.md index 8e3024c..3b4e65d 100644 --- a/public_html/eh/eh/eh/eh-eh/articles/random-linux-utils.md +++ b/public_html/eh/eh/eh/eh-eh/articles/random-linux-utils.md @@ -3,6 +3,7 @@ title: Random linux utilities subtitle: Neat things I picked up along the way author: Never Gude date: 25.7.2025 +summary: Testing dsa dsa dsa dsa DDDDDDDDDDDa --- ## Merge pdfs diff --git a/public_html/eh/eh/eh/eh-eh/index.html b/public_html/eh/eh/eh/eh-eh/index.html index 3091c00..f5fc8a3 100644 --- a/public_html/eh/eh/eh/eh-eh/index.html +++ b/public_html/eh/eh/eh/eh-eh/index.html @@ -22,7 +22,7 @@ } .display.math{display: block; text-align: center; margin: 0.5rem auto;} - +