summaryrefslogtreecommitdiff
path: root/build-files/build_recipe_directory.rb
blob: de61f4feed8cb020c7376e218ac660fe526a373f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'erb'
require 'kramdown'

def render(partial_path)
  ERB.new(File.read(partial_path)).result(binding)
end

def content
  output = ""
  Dir.foreach("./content/main-pages") do |post_filename|
    if post_filename.include?("recipes.md")
      output.concat(Kramdown::Document.new(File.read("./content/main-pages/#{post_filename}")).to_html)
    end
  end
  return output
end

template = ERB.new(File.read('recipe-directory-template.html.erb'))
puts template.result(binding)