summaryrefslogtreecommitdiffhomepage
path: root/template/src/articles/index.post.rb
blob: b9c9f6bc6d1fd693817fca5fd2b63125afedd7aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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