diff --git a/blog.janet b/blog.janet
index 5767a7c..afe4502 100644
--- a/blog.janet
+++ b/blog.janet
@@ -65,11 +65,11 @@
(defn ast-to-html
"Convert an AST to html"
[ast]
- (defn to-codeblock [lang value] (string "
" (htmlspecialchars value) "
"))
+ (defn to-codeblock [lang value] (string "" (htmlspecialchars value) "
"))
(defn to-codeline [value] (string "" (ast-to-html value) ""))
- (defn to-heading [level value] (string "" (htmlspecialchars value) ""))
- (defn to-quote [value] (string "" (ast-to-html value) "
"))
- (defn to-line [value] (string "" (ast-to-html value) "
"))
+ (defn to-heading [level value] (string "" (htmlspecialchars value) ""))
+ (defn to-quote [value] (string "" (ast-to-html value) "
"))
+ (defn to-line [value] (string "" (ast-to-html value) "
"))
(defn to-italic [value] (string "" (ast-to-html value) ""))
(defn to-bold [value] (string "" (ast-to-html value) ""))
(defn to-stroke [value] (string "" (ast-to-html value) ""))
@@ -77,26 +77,16 @@
(string/join
(map
|(match $0
- [:code-block lang value]
- (to-codeblock lang value)
- [:heading level value]
- (to-heading level value)
- [:quote value]
- (to-quote value)
- [:hr]
- "
"
- [:line value]
- (to-line value)
- [:text value]
- (htmlspecialchars value)
- [:italic value]
- (to-italic value)
- [:stroke value]
- (to-stroke value)
- [:bold value]
- (to-bold value)
- [:code-line value]
- (to-codeline value)
+ [:code-block lang value] (to-codeblock lang value)
+ [:heading level value] (to-heading level value)
+ [:quote value] (to-quote value)
+ [:hr] "
"
+ [:line value] (to-line value)
+ [:text value] (htmlspecialchars value)
+ [:italic value] (to-italic value)
+ [:stroke value] (to-stroke value)
+ [:bold value] (to-bold value)
+ [:code-line value] (to-codeline value)
_
(error (string "Invalid symbol: " (get $0 0))))
ast)
@@ -113,4 +103,6 @@
(defn main [bin & args]
# (pp-ast (peg/match md-to-ast (read-from-file "raw/~blog/blog.md")))
- (print (ast-to-html (peg/match md-to-ast (read-from-file "raw/~blog/blog.md")))))
+ (print (read-from-file "partial-template/header.html"))
+ (print (ast-to-html (peg/match md-to-ast (read-from-file "raw/~blog/blog.md"))))
+ (print (read-from-file "partial-template/footer.html")))
diff --git a/partial-template/footer.html b/partial-template/footer.html
new file mode 100644
index 0000000..feecd54
--- /dev/null
+++ b/partial-template/footer.html
@@ -0,0 +1,13 @@
+
+
+