summaryrefslogtreecommitdiffhomepage
path: root/template/src/articles/index.post.rb
diff options
context:
space:
mode:
Diffstat (limited to 'template/src/articles/index.post.rb')
-rw-r--r--template/src/articles/index.post.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/template/src/articles/index.post.rb b/template/src/articles/index.post.rb
new file mode 100644
index 0000000..b9c9f6b
--- /dev/null
+++ b/template/src/articles/index.post.rb
@@ -0,0 +1,28 @@
+# note: `target` will always be relative to the current directory for
+# postprocessor files
+
+# this generates all of our preprocessed articles we stored
+# note: you need to use the param `|_|` for paggio to allow us
+# to use local variables in the proc
+Justicar::PreProcessor.articles.each do |key, val|
+ target[key] = Paggio.html do |_|
+ _.html do
+ val
+ end
+ end
+end
+
+# this creates the articles page which contains links to
+# all of our articles
+target["index.html"] = Paggio.html do |_|
+ _.html do
+ _.h1 do
+ 'Here is a list of all the articles!'
+ end
+ Justicar::PreProcessor.articles.each do |key, val|
+ _.p do
+ _.a.articles(href: "#{key}") { key.delete_suffix('.html').upcase + "!" }
+ end
+ end
+ end
+end