commit fb301b72f5964ec1029b4f717672e484d1cf3512
parent b2d135c5e29ec6d5bdafad0bf7f845d53a08ce41
Author: Charlie Stanton <charlie@shtanton.com>
Date: Sat, 24 Jul 2021 14:39:56 +0100
Restructure html post generation to make more sense
Diffstat:
5 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/Makefile b/Makefile
@@ -7,7 +7,19 @@ GEMINI = $(GEMINI_POSTS) gemini/index.gmi gemini/posts/index.gmi
.PHONY: all clean publish
-all: $(WEB) $(GEMINI)
+all: html html/posts gemini gemini/posts $(WEB) $(GEMINI)
+
+html:
+ mkdir html
+
+html/posts: html
+ mkdir html/posts
+
+gemini:
+ mkdir gemini
+
+gemini/posts: gemini
+ mkdir gemini/posts
html/%.css: html_src/%.css
cp $^ $@
@@ -15,7 +27,7 @@ html/%.css: html_src/%.css
html_src/nav.html: html_src/nav_html.sh posts-config
$^ > $@
-html/posts/%.html: html_src/post_html.sh posts/%.gmi posts-config html_src/post_template.html html_src/nav.html
+html/posts/%.html: html_src/posts/post_html.sh posts/%.gmi posts-config html_src/posts/post_template.html html_src/nav.html
$^ $* > $@
html/posts/index.html: html_src/posts/index.sh html_src/posts/index_template.html html_src/nav.html
@@ -35,6 +47,8 @@ gemini/index.gmi: gemini_src/index.gmi
clean:
rm html_src/nav.html
+ rm -r html/*
+ rm -r gemini/*
publish: all
rsync -vr --delete gemini/ charlie@shtanton.xyz:gemini
diff --git a/html_src/post_template.html b/html_src/post_template.html
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>shtanton's blog</title>
- <link rel="stylesheet" href="post.css"/>
- <link rel="stylesheet" href="colours.css"/>
- </head>
- <body>
- <div>
- <header>
-{header}
- </header>
- </div>
- <div>
- <nav>
-{nav}
- </nav>
- </div>
- <div>
- <article>
-{content}
- </article>
- </div>
- </body>
-</html>
diff --git a/html_src/posts/index_template.html b/html_src/posts/index_template.html
@@ -2,7 +2,7 @@
<html>
<head>
<title>shtanton's blog</title>
- <link rel="stylesheet" href="colours.css"/>
+ <link rel="stylesheet" href="/colours.css"/>
</head>
<body>
<h2>shtanton's Blog</h2>
diff --git a/html_src/post_html.sh b/html_src/posts/post_html.sh
diff --git a/html_src/posts/post_template.html b/html_src/posts/post_template.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>shtanton's blog</title>
+ <link rel="stylesheet" href="/post.css"/>
+ <link rel="stylesheet" href="/colours.css"/>
+ </head>
+ <body>
+ <div>
+ <header>
+{header}
+ </header>
+ </div>
+ <div>
+ <nav>
+{nav}
+ </nav>
+ </div>
+ <div>
+ <article>
+{content}
+ </article>
+ </div>
+ </body>
+</html>