From 4e625b8fc30c578b013374d2a0bad9ff4718b96b Mon Sep 17 00:00:00 2001 From: scottj Date: Fri, 13 Aug 2021 12:41:10 -0700 Subject: initial project setup --- build.sh | 1 + build_page.rb | 19 +++++++++++++++++++ design/pantry-of-plants.fig | Bin 0 -> 789826 bytes footer.html.erb | 4 ++++ header.html.erb | 5 +++++ images/pantry-of-plants-logo-half.png | Bin 0 -> 20591 bytes images/pantry-of-plants-logo.png | Bin 0 -> 43380 bytes posts/my-new-recipe.md | 10 ++++++++++ posts/my-newer-recipe.md | 3 +++ template.html.erb | 10 ++++++++++ 10 files changed, 52 insertions(+) create mode 100755 build.sh create mode 100644 build_page.rb create mode 100644 design/pantry-of-plants.fig create mode 100644 footer.html.erb create mode 100644 header.html.erb create mode 100644 images/pantry-of-plants-logo-half.png create mode 100644 images/pantry-of-plants-logo.png create mode 100644 posts/my-new-recipe.md create mode 100644 posts/my-newer-recipe.md create mode 100644 template.html.erb diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..805217c --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +ruby build_page.rb > output.html diff --git a/build_page.rb b/build_page.rb new file mode 100644 index 0000000..405143d --- /dev/null +++ b/build_page.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("./posts") do |post_filename| + if post_filename.include?("md") + output.concat(Kramdown::Document.new(File.read("./posts/#{post_filename}")).to_html) + end + end + return output +end + +template = ERB.new(File.read('template.html.erb')) +puts template.result(binding) diff --git a/design/pantry-of-plants.fig b/design/pantry-of-plants.fig new file mode 100644 index 0000000..f3029b2 Binary files /dev/null and b/design/pantry-of-plants.fig differ diff --git a/footer.html.erb b/footer.html.erb new file mode 100644 index 0000000..a87e194 --- /dev/null +++ b/footer.html.erb @@ -0,0 +1,4 @@ + diff --git a/header.html.erb b/header.html.erb new file mode 100644 index 0000000..66b3adf --- /dev/null +++ b/header.html.erb @@ -0,0 +1,5 @@ + diff --git a/images/pantry-of-plants-logo-half.png b/images/pantry-of-plants-logo-half.png new file mode 100644 index 0000000..fc56bce Binary files /dev/null and b/images/pantry-of-plants-logo-half.png differ diff --git a/images/pantry-of-plants-logo.png b/images/pantry-of-plants-logo.png new file mode 100644 index 0000000..509a932 Binary files /dev/null and b/images/pantry-of-plants-logo.png differ diff --git a/posts/my-new-recipe.md b/posts/my-new-recipe.md new file mode 100644 index 0000000..9c854aa --- /dev/null +++ b/posts/my-new-recipe.md @@ -0,0 +1,10 @@ +# Big Header Boi + +This is a *bold* recipe + +List it out! +- first thing +- second thing + +1. hello +2. hello diff --git a/posts/my-newer-recipe.md b/posts/my-newer-recipe.md new file mode 100644 index 0000000..28d583e --- /dev/null +++ b/posts/my-newer-recipe.md @@ -0,0 +1,3 @@ +### Sick + +![apple](https://i5.walmartimages.ca/images/Large/094/514/6000200094514.jpg "apple") diff --git a/template.html.erb b/template.html.erb new file mode 100644 index 0000000..4b1cef3 --- /dev/null +++ b/template.html.erb @@ -0,0 +1,10 @@ + + + Hello + + + <%= render "header.html.erb" %> + <%= content %> + <%= render "footer.html.erb" %> + + -- cgit v1.2.3