summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorscottj <jones.scott0391@gmail.com>2021-08-13 12:41:10 -0700
committerscottj <jones.scott0391@gmail.com>2021-08-13 12:41:10 -0700
commit4e625b8fc30c578b013374d2a0bad9ff4718b96b (patch)
tree6c059eb5fe11db0162fbb9ed683d6c5f3b2f814c
parentcf27be8bbe76173ca6094ae3a0d416a910c85150 (diff)
initial project setup
-rwxr-xr-xbuild.sh1
-rw-r--r--build_page.rb19
-rw-r--r--design/pantry-of-plants.figbin0 -> 789826 bytes
-rw-r--r--footer.html.erb4
-rw-r--r--header.html.erb5
-rw-r--r--images/pantry-of-plants-logo-half.pngbin0 -> 20591 bytes
-rw-r--r--images/pantry-of-plants-logo.pngbin0 -> 43380 bytes
-rw-r--r--posts/my-new-recipe.md10
-rw-r--r--posts/my-newer-recipe.md3
-rw-r--r--template.html.erb10
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
new file mode 100644
index 0000000..f3029b2
--- /dev/null
+++ b/design/pantry-of-plants.fig
Binary files 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 @@
+<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
new file mode 100644
index 0000000..fc56bce
--- /dev/null
+++ b/images/pantry-of-plants-logo-half.png
Binary files differ
diff --git a/images/pantry-of-plants-logo.png b/images/pantry-of-plants-logo.png
new file mode 100644
index 0000000..509a932
--- /dev/null
+++ b/images/pantry-of-plants-logo.png
Binary files 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 @@
+<html>
+ <head>
+ <title>Hello</title>
+ </head>
+ <body>
+ <%= render "header.html.erb" %>
+ <%= content %>
+ <%= render "footer.html.erb" %>
+ </body>
+</html>