diff options
| author | realtradam <[email protected]> | 2022-04-22 07:17:49 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-04-22 07:17:49 -0400 |
| commit | 99099c284982863480ffc6d4aa741d29dc2ea92a (patch) | |
| tree | 66a2f4c543617f647d970db6fce07622feafd393 /template/src/articles/index.post.rb | |
| parent | 6150ed8ba86e960a2833b4000c2f9474a2292129 (diff) | |
| download | Justicar-1.0.0.tar.gz Justicar-1.0.0.zip | |
version 1.0v1.0.0
Diffstat (limited to 'template/src/articles/index.post.rb')
| -rw-r--r-- | template/src/articles/index.post.rb | 28 |
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 |
