summaryrefslogtreecommitdiff
path: root/build-files/build_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'build-files/build_index.rb')
-rw-r--r--build-files/build_index.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/build-files/build_index.rb b/build-files/build_index.rb
new file mode 100644
index 0000000..aae1268
--- /dev/null
+++ b/build-files/build_index.rb
@@ -0,0 +1,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?("index.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('template.html.erb'))
+puts template.result(binding) \ No newline at end of file