diff options
author | scottj <jones.scott0391@gmail.com> | 2021-08-13 12:41:10 -0700 |
---|---|---|
committer | scottj <jones.scott0391@gmail.com> | 2021-08-13 12:41:10 -0700 |
commit | 4e625b8fc30c578b013374d2a0bad9ff4718b96b (patch) | |
tree | 6c059eb5fe11db0162fbb9ed683d6c5f3b2f814c | |
parent | cf27be8bbe76173ca6094ae3a0d416a910c85150 (diff) |
initial project setup
-rwxr-xr-x | build.sh | 1 | ||||
-rw-r--r-- | build_page.rb | 19 | ||||
-rw-r--r-- | design/pantry-of-plants.fig | bin | 0 -> 789826 bytes | |||
-rw-r--r-- | footer.html.erb | 4 | ||||
-rw-r--r-- | header.html.erb | 5 | ||||
-rw-r--r-- | images/pantry-of-plants-logo-half.png | bin | 0 -> 20591 bytes | |||
-rw-r--r-- | images/pantry-of-plants-logo.png | bin | 0 -> 43380 bytes | |||
-rw-r--r-- | posts/my-new-recipe.md | 10 | ||||
-rw-r--r-- | posts/my-newer-recipe.md | 3 | ||||
-rw-r--r-- | template.html.erb | 10 |
10 files changed, 52 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 0000000..f3029b2 --- /dev/null +++ b/design/pantry-of-plants.fig 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 @@ +<footer> + <a>Contact: scott@pantryofplants.ca</a> + <p>© 2021 Pantry of Plants</p> +</footer> 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 @@ +<nav> + <a href="#"><img src="image/pantry-of-plants-logo.png"></a> + <a href="#">Recipes</a> + <a href="#">About</a> +</nav> diff --git a/images/pantry-of-plants-logo-half.png b/images/pantry-of-plants-logo-half.png Binary files differnew file mode 100644 index 0000000..fc56bce --- /dev/null +++ b/images/pantry-of-plants-logo-half.png diff --git a/images/pantry-of-plants-logo.png b/images/pantry-of-plants-logo.png Binary files differnew file mode 100644 index 0000000..509a932 --- /dev/null +++ b/images/pantry-of-plants-logo.png 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 @@ +<html> + <head> + <title>Hello</title> + </head> + <body> + <%= render "header.html.erb" %> + <%= content %> + <%= render "footer.html.erb" %> + </body> +</html> |