summaryrefslogtreecommitdiff
path: root/build_recipe_directory.rb
blob: 433e1792fd3ea89d17ec1c6161fa1da87b7a9f15 (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/posts") do |post_filename|
    if post_filename.include?("md")
      output.concat(Kramdown::Document.new(File.read("./content/posts/#{post_filename}")).to_html)
    end
  end
  return output
end

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