From 665598c6d4d16a0cb3ac8a9eecc3a24cc40ca225 Mon Sep 17 00:00:00 2001 From: Benaiah Mischenko Date: Wed, 6 Dec 2017 16:54:28 -0800 Subject: Move Values page into the CMS --- site/content/values.md | 52 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) (limited to 'site/content/values.md') diff --git a/site/content/values.md b/site/content/values.md index 3dcd089..98bf92c 100644 --- a/site/content/values.md +++ b/site/content/values.md @@ -1,5 +1,47 @@ -+++ -title = "Values" -type = "values" -page="/values.html" -+++ +--- +title: "Values" +type: "values" +page: "/values.html" +image: /img/about-jumbotron.jpg +values: + - heading: "Shade-grown coffee" + text: > + Coffee is a small tree or shrub that grows in the forest + understory in its wild form, and traditionally was grown + commercially under other trees that provided shade. The + forest-like structure of shade coffee farms provides habitat for + a great number of migratory and resident species. + imageUrl: "/img/about-shade-grown.jpg" + - heading: "Single origin" + text: > + Single-origin coffee is coffee grown within a single known + geographic origin. Sometimes, this is a single farm or a + specific collection of beans from a single country. The name of + the coffee is then usually the place it was grown to whatever + degree available. + imageUrl: "/img/about-single-origin.jpg" + - heading: "Sustainable farming" + text: > + Sustainable agriculture is farming in sustainable ways based on + an understanding of ecosystem services, the study of + relationships between organisms and their environment. What + grows where and how it is grown are a matter of choice and + careful consideration for nature and communities. + imageUrl: "/img/about-sustainable-farming.jpg" + - heading: "Direct sourcing" + text: > + We want to truly empower the communities that bring amazing + coffee to you. That’s why we reinvest 20% of our profits into + farms, local businesses and schools everywhere our coffee is + grown. You can see the communities grow and learn more about + coffee farming on our blog. + imageUrl: "/img/about-direct-sourcing.jpg" + - heading: "Reinvest profits" + text: > + We want to truly empower the communities that bring amazing + coffee to you. That’s why we reinvest 20% of our profits into + farms, local businesses and schools everywhere our coffee is + grown. You can see the communities grow and learn more about + coffee farming on our blog. + imageUrl: "/img/about-reinvest-profits.jpg" +--- -- cgit v1.3 From d91206659bd17c190e2940a2c564f371cafc7ebc Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Christensen Date: Thu, 7 Dec 2017 00:21:51 -0800 Subject: Update hugo and content structure; add home page to CMS This updates to hugo v0.31 It also adapts the content model to follow the convention for sections with _index.md files and makes the home page a fully editable section --- bin/hugo.darwin | Bin 17009148 -> 37453092 bytes bin/hugo.exe | Bin 17067008 -> 28099072 bytes bin/hugo.linux | Bin 17064750 -> 27993152 bytes gulpfile.babel.js | 4 + site/content/_index.md | 20 ++++ site/content/contact.md | 21 ----- site/content/contact/_index.md | 19 ++++ site/content/products.md | 103 --------------------- site/content/products/_index.md | 102 ++++++++++++++++++++ site/content/values.md | 47 ---------- site/content/values/_index.md | 45 +++++++++ site/layouts/contact/single.html | 26 ------ site/layouts/index.html | 8 +- site/layouts/partials/2-up.html | 23 ++--- site/layouts/partials/text-and-image.html | 2 +- site/layouts/products/single.html | 32 ------- site/layouts/section/contact.html | 26 ++++++ site/layouts/section/products.html | 32 +++++++ site/layouts/section/values.html | 17 ++++ site/layouts/values/single.html | 17 ---- site/static/admin/config.yml | 31 +++++-- .../cms-preview-templates/components/jumbotron.js | 3 +- src/js/cms-preview-templates/home.js | 69 ++++++++++++++ src/js/cms.js | 2 + 24 files changed, 374 insertions(+), 275 deletions(-) create mode 100644 site/content/_index.md delete mode 100644 site/content/contact.md create mode 100644 site/content/contact/_index.md delete mode 100644 site/content/products.md create mode 100644 site/content/products/_index.md delete mode 100644 site/content/values.md create mode 100644 site/content/values/_index.md delete mode 100644 site/layouts/contact/single.html delete mode 100644 site/layouts/products/single.html create mode 100644 site/layouts/section/contact.html create mode 100644 site/layouts/section/products.html create mode 100644 site/layouts/section/values.html delete mode 100644 site/layouts/values/single.html create mode 100644 src/js/cms-preview-templates/home.js (limited to 'site/content/values.md') diff --git a/bin/hugo.darwin b/bin/hugo.darwin index a1e4260..99151d6 100755 Binary files a/bin/hugo.darwin and b/bin/hugo.darwin differ diff --git a/bin/hugo.exe b/bin/hugo.exe index e0b713b..144e2ce 100755 Binary files a/bin/hugo.exe and b/bin/hugo.exe differ diff --git a/bin/hugo.linux b/bin/hugo.linux index 5915625..0f34c02 100755 Binary files a/bin/hugo.linux and b/bin/hugo.linux differ diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 4bc694a..a93dc8a 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -17,6 +17,10 @@ const browserSync = BrowserSync.create(); const hugoBin = `./bin/hugo.${process.platform === "win32" ? "exe" : process.platform}`; const defaultArgs = ["-d", "../dist", "-s", "site"]; +if (process.env.DEBUG) { + defaultArgs.unshift("--debug") +} + gulp.task("hugo", (cb) => buildSite(cb)); gulp.task("hugo-preview", (cb) => buildSite(cb, ["--buildDrafts", "--buildFuture"])); gulp.task("build", ["css", "js", "cms-assets", "hugo"]); diff --git a/site/content/_index.md b/site/content/_index.md new file mode 100644 index 0000000..02e819d --- /dev/null +++ b/site/content/_index.md @@ -0,0 +1,20 @@ +--- +title: "Great coffee with a conscience" +subtitle: Support sustainable farming while enjoying a cup +image: /img/home-jumbotron.jpg +blurb: + heading: Why Kaldi? + text: "Kaldi is the coffee store for everyone who believes that great coffee shouldn't just taste good, it should do good too. We source all of our beans directly from small scale sustainable farmers and make sure part of the profits are reinvested in their communities." +intro: + heading: "What we offer" + text: "Kaldi is the ultimate spot for coffee lovers who want to learn about their java’s origin and support the farmers that grew it. We take coffee production, roasting and brewing seriously and we’re glad to pass that knowledge to anyone." +products: + - image: img/illustrations-coffee.svg + text: "We sell green and roasted coffee beans that are sourced directly from independent farmers and farm cooperatives. We’re proud to offer a variety of coffee beans grown with great care for the environment and local communities. Check our post or contact us directly for current availability." + - image: /img/illustrations-coffee-gear.svg + text: "We offer a small, but carefully curated selection of brewing gear and tools for every taste and experience level. No matter if you roast your own beans or just bought your first french press, you’ll find a gadget to fall in love with in our shop." +values: + heading: Our values + text: Coffee is an amazing part of human culture but it has a dark side too – one of colonialism and mindless abuse of natural resources and human lives. We want to turn this around and return the coffee trade to the drink’s exhilarating, empowering and unifying nature. +--- + diff --git a/site/content/contact.md b/site/content/contact.md deleted file mode 100644 index 2e3c24e..0000000 --- a/site/content/contact.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Contact" -type: "contact" -page: "/contact.html" -logo: "/img/logo.svg" -contact_entries: - - heading: Location - text: "3153 Lynn Avenue, South San Francisco, California 94080" - - heading: Working hours - text: "Monday – Saturday: 9AM – 7PM We’re closed on Sundays" ---- - -We’d love to get in touch with you and hear your ideas and -questions. We strive to grow and improve constantly and your feedback -is valuable for us. - -

How can I get…?

- -You can also use the form below for any inquiries about coffee -availability, monthly subscriptions and scheduling a 1-on-1 session -with our baristas. Don’t be shy, drop us a line! diff --git a/site/content/contact/_index.md b/site/content/contact/_index.md new file mode 100644 index 0000000..1b34ee8 --- /dev/null +++ b/site/content/contact/_index.md @@ -0,0 +1,19 @@ +--- +title: "Contact" +logo: "/img/logo.svg" +contact_entries: + - heading: Location + text: "3153 Lynn Avenue, South San Francisco, California 94080" + - heading: Working hours + text: "Monday – Saturday: 9AM – 7PM We’re closed on Sundays" +--- + +We’d love to get in touch with you and hear your ideas and +questions. We strive to grow and improve constantly and your feedback +is valuable for us. + +

How can I get…?

+ +You can also use the form below for any inquiries about coffee +availability, monthly subscriptions and scheduling a 1-on-1 session +with our baristas. Don’t be shy, drop us a line! diff --git a/site/content/products.md b/site/content/products.md deleted file mode 100644 index 67fd186..0000000 --- a/site/content/products.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: Our Coffee -type: products -page: /products.html -image: /img/products-jumbotron.jpg -heading: What we offer -description: >- - Kaldi is the ultimate spot for coffee lovers who want to learn about their - java’s origin and support the farmers that grew it. We take coffee production, - roasting and brewing seriously and we’re glad to pass that knowledge to - anyone. -intro: - blurbs: - - image: /img/illustrations-coffee.svg - text: > - We sell green and roasted coffee beans that are sourced directly from - independent farmers and farm cooperatives. We’re proud to offer a - variety of coffee beans grown with great care for the environment and - local communities. Check our post or contact us directly for current - availability. - - image: /img/illustrations-coffee-gear.svg - text: > - We offer a small, but carefully curated selection of brewing gear and - tools for every taste and experience level. No matter if you roast your - own beans or just bought your first french press, you’ll find a gadget - to fall in love with in our shop. - - image: /img/illustrations-tutorials.svg - text: > - Love a great cup of coffee, but never knew how to make one? Bought a - fancy new Chemex but have no clue how to use it? Don't worry, we’re here - to help. You can schedule a custom 1-on-1 consultation with our baristas - to learn anything you want to know about coffee roasting and brewing. - Email us or call the store for details. - - image: /img/illustrations-meeting-space.svg - text: > - We believe that good coffee has the power to bring people together. - That’s why we decided to turn a corner of our shop into a cozy meeting - space where you can hang out with fellow coffee lovers and learn about - coffee making techniques. All of the artwork on display there is for - sale. The full price you pay goes to the artist. - heading: What we offer - description: > - Kaldi is the ultimate spot for coffee lovers who want to learn about their - java’s origin and support the farmers that grew it. We take coffee - production, roasting and brewing seriously and we’re glad to pass that - knowledge to anyone. This is an edit via identity... -main: - heading: Great coffee with no compromises - description: > - We hold our coffee to the highest standards from the shrub to the cup. - That’s why we’re meticulous and transparent about each step of the coffee’s - journey. We personally visit each farm to make sure the conditions are - optimal for the plants, farmers and the local environment. - image1: - alt: A close-up of a paper filter filled with ground coffee - image: /img/products-grid3.jpg - image2: - alt: A green cup of a coffee on a wooden table - image: /img/products-grid2.jpg - image3: - alt: Coffee beans - image: /img/products-grid1.jpg -testimonials: - - author: Elisabeth Kaurismäki - quote: >- - The first time I tried Kaldi’s coffee, I couldn’t even believe that was - the same thing I’ve been drinking every morning. - - author: Philipp Trommler - quote: >- - Kaldi is the place to go if you want the best quality coffee. I love their - stance on empowering farmers and transparency. -full_image: /img/products-full-width.jpg -pricing: - heading: Monthly subscriptions - description: >- - We make it easy to make great coffee a part of your life. Choose one of our - monthly subscription plans to receive great coffee at your doorstep each - month. Contact us about more details and payment info. - plans: - - description: Perfect for the drinker who likes to enjoy 1-2 cups per day. - items: - - 3 lbs of coffee per month - - Green or roasted beans" - - One or two varieties of beans" - plan: Small - price: '50' - - description: 'Great for avid drinkers, java-nsoving couples and bigger crowds' - items: - - 6 lbs of coffee per month - - Green or roasted beans - - Up to 4 different varieties of beans - plan: Big - price: '80' - - description: Want a few tiny batches from different varieties? Try our custom plan - items: - - Whatever you need - - Green or roasted beans - - Unlimited varieties - plan: Custom - price: '?' ---- - - diff --git a/site/content/products/_index.md b/site/content/products/_index.md new file mode 100644 index 0000000..b8d4b63 --- /dev/null +++ b/site/content/products/_index.md @@ -0,0 +1,102 @@ +--- +title: Our Coffee +type: products +image: /img/products-jumbotron.jpg +heading: What we offer +description: >- + Kaldi is the ultimate spot for coffee lovers who want to learn about their + java’s origin and support the farmers that grew it. We take coffee production, + roasting and brewing seriously and we’re glad to pass that knowledge to + anyone. +intro: + blurbs: + - image: /img/illustrations-coffee.svg + text: > + We sell green and roasted coffee beans that are sourced directly from + independent farmers and farm cooperatives. We’re proud to offer a + variety of coffee beans grown with great care for the environment and + local communities. Check our post or contact us directly for current + availability. + - image: /img/illustrations-coffee-gear.svg + text: > + We offer a small, but carefully curated selection of brewing gear and + tools for every taste and experience level. No matter if you roast your + own beans or just bought your first french press, you’ll find a gadget + to fall in love with in our shop. + - image: /img/illustrations-tutorials.svg + text: > + Love a great cup of coffee, but never knew how to make one? Bought a + fancy new Chemex but have no clue how to use it? Don't worry, we’re here + to help. You can schedule a custom 1-on-1 consultation with our baristas + to learn anything you want to know about coffee roasting and brewing. + Email us or call the store for details. + - image: /img/illustrations-meeting-space.svg + text: > + We believe that good coffee has the power to bring people together. + That’s why we decided to turn a corner of our shop into a cozy meeting + space where you can hang out with fellow coffee lovers and learn about + coffee making techniques. All of the artwork on display there is for + sale. The full price you pay goes to the artist. + heading: What we offer + description: > + Kaldi is the ultimate spot for coffee lovers who want to learn about their + java’s origin and support the farmers that grew it. We take coffee + production, roasting and brewing seriously and we’re glad to pass that + knowledge to anyone. This is an edit via identity... +main: + heading: Great coffee with no compromises + description: > + We hold our coffee to the highest standards from the shrub to the cup. + That’s why we’re meticulous and transparent about each step of the coffee’s + journey. We personally visit each farm to make sure the conditions are + optimal for the plants, farmers and the local environment. + image1: + alt: A close-up of a paper filter filled with ground coffee + image: /img/products-grid3.jpg + image2: + alt: A green cup of a coffee on a wooden table + image: /img/products-grid2.jpg + image3: + alt: Coffee beans + image: /img/products-grid1.jpg +testimonials: + - author: Elisabeth Kaurismäki + quote: >- + The first time I tried Kaldi’s coffee, I couldn’t even believe that was + the same thing I’ve been drinking every morning. + - author: Philipp Trommler + quote: >- + Kaldi is the place to go if you want the best quality coffee. I love their + stance on empowering farmers and transparency. +full_image: /img/products-full-width.jpg +pricing: + heading: Monthly subscriptions + description: >- + We make it easy to make great coffee a part of your life. Choose one of our + monthly subscription plans to receive great coffee at your doorstep each + month. Contact us about more details and payment info. + plans: + - description: Perfect for the drinker who likes to enjoy 1-2 cups per day. + items: + - 3 lbs of coffee per month + - Green or roasted beans" + - One or two varieties of beans" + plan: Small + price: '50' + - description: 'Great for avid drinkers, java-nsoving couples and bigger crowds' + items: + - 6 lbs of coffee per month + - Green or roasted beans + - Up to 4 different varieties of beans + plan: Big + price: '80' + - description: Want a few tiny batches from different varieties? Try our custom plan + items: + - Whatever you need + - Green or roasted beans + - Unlimited varieties + plan: Custom + price: '?' +--- + + diff --git a/site/content/values.md b/site/content/values.md deleted file mode 100644 index 98bf92c..0000000 --- a/site/content/values.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: "Values" -type: "values" -page: "/values.html" -image: /img/about-jumbotron.jpg -values: - - heading: "Shade-grown coffee" - text: > - Coffee is a small tree or shrub that grows in the forest - understory in its wild form, and traditionally was grown - commercially under other trees that provided shade. The - forest-like structure of shade coffee farms provides habitat for - a great number of migratory and resident species. - imageUrl: "/img/about-shade-grown.jpg" - - heading: "Single origin" - text: > - Single-origin coffee is coffee grown within a single known - geographic origin. Sometimes, this is a single farm or a - specific collection of beans from a single country. The name of - the coffee is then usually the place it was grown to whatever - degree available. - imageUrl: "/img/about-single-origin.jpg" - - heading: "Sustainable farming" - text: > - Sustainable agriculture is farming in sustainable ways based on - an understanding of ecosystem services, the study of - relationships between organisms and their environment. What - grows where and how it is grown are a matter of choice and - careful consideration for nature and communities. - imageUrl: "/img/about-sustainable-farming.jpg" - - heading: "Direct sourcing" - text: > - We want to truly empower the communities that bring amazing - coffee to you. That’s why we reinvest 20% of our profits into - farms, local businesses and schools everywhere our coffee is - grown. You can see the communities grow and learn more about - coffee farming on our blog. - imageUrl: "/img/about-direct-sourcing.jpg" - - heading: "Reinvest profits" - text: > - We want to truly empower the communities that bring amazing - coffee to you. That’s why we reinvest 20% of our profits into - farms, local businesses and schools everywhere our coffee is - grown. You can see the communities grow and learn more about - coffee farming on our blog. - imageUrl: "/img/about-reinvest-profits.jpg" ---- diff --git a/site/content/values/_index.md b/site/content/values/_index.md new file mode 100644 index 0000000..b92073d --- /dev/null +++ b/site/content/values/_index.md @@ -0,0 +1,45 @@ +--- +title: "Values" +image: /img/about-jumbotron.jpg +values: + - heading: "Shade-grown coffee" + text: > + Coffee is a small tree or shrub that grows in the forest + understory in its wild form, and traditionally was grown + commercially under other trees that provided shade. The + forest-like structure of shade coffee farms provides habitat for + a great number of migratory and resident species. + imageUrl: "/img/about-shade-grown.jpg" + - heading: "Single origin" + text: > + Single-origin coffee is coffee grown within a single known + geographic origin. Sometimes, this is a single farm or a + specific collection of beans from a single country. The name of + the coffee is then usually the place it was grown to whatever + degree available. + imageUrl: "/img/about-single-origin.jpg" + - heading: "Sustainable farming" + text: > + Sustainable agriculture is farming in sustainable ways based on + an understanding of ecosystem services, the study of + relationships between organisms and their environment. What + grows where and how it is grown are a matter of choice and + careful consideration for nature and communities. + imageUrl: "/img/about-sustainable-farming.jpg" + - heading: "Direct sourcing" + text: > + We want to truly empower the communities that bring amazing + coffee to you. That’s why we reinvest 20% of our profits into + farms, local businesses and schools everywhere our coffee is + grown. You can see the communities grow and learn more about + coffee farming on our blog. + imageUrl: "/img/about-direct-sourcing.jpg" + - heading: "Reinvest profits" + text: > + We want to truly empower the communities that bring amazing + coffee to you. That’s why we reinvest 20% of our profits into + farms, local businesses and schools everywhere our coffee is + grown. You can see the communities grow and learn more about + coffee farming on our blog. + imageUrl: "/img/about-reinvest-profits.jpg" +--- diff --git a/site/layouts/contact/single.html b/site/layouts/contact/single.html deleted file mode 100644 index 205d92e..0000000 --- a/site/layouts/contact/single.html +++ /dev/null @@ -1,26 +0,0 @@ -{{ partial "head" . }} - -{{ partial "nav" . }} - -
-
- - - - {{ .Content }} - -
- {{ range .Params.contact_entries }} -
-

{{ .heading }}

-

{{ .text }}

-
- {{ end }} -
- - {{ partial "contact-form" . }} - -
-
- -{{ partial "footer" . }} diff --git a/site/layouts/index.html b/site/layouts/index.html index 9ce8a17..a21df24 100644 --- a/site/layouts/index.html +++ b/site/layouts/index.html @@ -2,13 +2,13 @@ {{ partial "nav" . }} -{{ partial "jumbotron" (dict "imageUrl" "/img/home-jumbotron.jpg" "title" "Great coffee with a conscience" "subtitle" "Support sustainable farming while enjoying a cup") }} +{{ partial "jumbotron" (dict "imageUrl" .Params.image "title" .Title "subtitle" .Params.subtitle) }} -{{ partial "short-text" (dict "heading" "Why Kaldi?" "text" "Kaldi is the coffee store for everyone who believes that great coffee shouldn't just taste good, it should do good too. We source all of our beans directly from small scale sustainable farmers and make sure part of the profits are reinvested in their communities.")}} +{{ partial "short-text" .Params.blurb}} -{{ partial "2-up" (dict "heading" "What we offer" "description" "Kaldi is the ultimate spot for coffee lovers who want to learn about their java’s origin and support the farmers that grew it. We take coffee production, roasting and brewing seriously and we’re glad to pass that knowledge to anyone." "svg1" "img/illustrations-coffee.svg" "text1" "We sell green and roasted coffee beans that are sourced directly from independent farmers and farm cooperatives. We’re proud to offer a variety of coffee beans grown with great care for the environment and local communities. Check our post or contact us directly for current availability." "svg2" "/img/illustrations-coffee-gear.svg" "text2" "We offer a small, but carefully curated selection of brewing gear and tools for every taste and experience level. No matter if you roast your own beans or just bought your first french press, you’ll find a gadget to fall in love with in our shop." "buttonText" "See all products" "buttonLink" "/products" ) }} +{{ partial "2-up" .Params }} -{{ partial "text-and-image" (dict "heading" "Our values" "text" "Coffee is an amazing part of human culture but it has a dark side too – one of colonialism and mindless abuse of natural resources and human lives. We want to turn this around and return the coffee trade to the drink’s exhilarating, empowering and unifying nature." "buttonText" "Read more" "buttonLink" "/values") }} +{{ partial "text-and-image" (dict "heading" .Params.values.heading "text" .Params.values.text "buttonText" "Read more" "buttonLink" "/values") }} {{ partial "blog" . }} diff --git a/site/layouts/partials/2-up.html b/site/layouts/partials/2-up.html index 06849f0..ab827b4 100644 --- a/site/layouts/partials/2-up.html +++ b/site/layouts/partials/2-up.html @@ -1,24 +1,19 @@
-

{{.heading}}

-

{{.description}}

+

{{.intro.heading}}

+

{{.intro.text}}

+ {{ range .products }}
- -

{{.text1}}

-
- -
- -

{{.text2}}

+ +

{{.text}}

+ {{ end }}
- {{ if .buttonText }} - - {{ end }} +
diff --git a/site/layouts/partials/text-and-image.html b/site/layouts/partials/text-and-image.html index 06baa68..7a55f15 100644 --- a/site/layouts/partials/text-and-image.html +++ b/site/layouts/partials/text-and-image.html @@ -3,7 +3,7 @@
-

{{.heading}}

+

{{.heading}}

{{.text}}

diff --git a/site/layouts/products/single.html b/site/layouts/products/single.html deleted file mode 100644 index bf430ca..0000000 --- a/site/layouts/products/single.html +++ /dev/null @@ -1,32 +0,0 @@ -{{ partial "head" . }} -{{ partial "nav" . }} - -{{ partial "jumbotron" (dict "imageUrl" .Params.image "title" .Title) }} - -{{ partial "4-up" .Params.intro }} - - -{{ with .Params.main }} -
-
-

{{ .heading }}

-

{{ .description }}

-
-
- - -{{ partial "image-grid" . }} -{{ end }} - -
- {{ range .Params.testimonials }} - {{ partial "blockquote" . }} - {{ end }} -
- - - - -{{ partial "table" .Params.pricing }} - -{{ partial "footer" . }} diff --git a/site/layouts/section/contact.html b/site/layouts/section/contact.html new file mode 100644 index 0000000..205d92e --- /dev/null +++ b/site/layouts/section/contact.html @@ -0,0 +1,26 @@ +{{ partial "head" . }} + +{{ partial "nav" . }} + +
+
+ + + + {{ .Content }} + +
+ {{ range .Params.contact_entries }} +
+

{{ .heading }}

+

{{ .text }}

+
+ {{ end }} +
+ + {{ partial "contact-form" . }} + +
+
+ +{{ partial "footer" . }} diff --git a/site/layouts/section/products.html b/site/layouts/section/products.html new file mode 100644 index 0000000..bf430ca --- /dev/null +++ b/site/layouts/section/products.html @@ -0,0 +1,32 @@ +{{ partial "head" . }} +{{ partial "nav" . }} + +{{ partial "jumbotron" (dict "imageUrl" .Params.image "title" .Title) }} + +{{ partial "4-up" .Params.intro }} + + +{{ with .Params.main }} +
+
+

{{ .heading }}

+

{{ .description }}

+
+
+ + +{{ partial "image-grid" . }} +{{ end }} + +
+ {{ range .Params.testimonials }} + {{ partial "blockquote" . }} + {{ end }} +
+ + + + +{{ partial "table" .Params.pricing }} + +{{ partial "footer" . }} diff --git a/site/layouts/section/values.html b/site/layouts/section/values.html new file mode 100644 index 0000000..9b6fa13 --- /dev/null +++ b/site/layouts/section/values.html @@ -0,0 +1,17 @@ +{{ partial "head" . }} +{{ partial "nav" . }} +{{ partial "jumbotron" (dict "imageUrl" .Params.image "title" .Title) }} + +
+ + {{ range $index, $element := .Params.values }} + {{ if modBool $index 2 }} + {{ partial "media-block" $element }} + {{ else }} + {{ partial "media-block-reverse" $element }} + {{ end }} + {{ end }} + +
+ +{{ partial "footer" . }} diff --git a/site/layouts/values/single.html b/site/layouts/values/single.html deleted file mode 100644 index 9b6fa13..0000000 --- a/site/layouts/values/single.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ partial "head" . }} -{{ partial "nav" . }} -{{ partial "jumbotron" (dict "imageUrl" .Params.image "title" .Title) }} - -
- - {{ range $index, $element := .Params.values }} - {{ if modBool $index 2 }} - {{ partial "media-block" $element }} - {{ else }} - {{ partial "media-block-reverse" $element }} - {{ end }} - {{ end }} - -
- -{{ partial "footer" . }} diff --git a/site/static/admin/config.yml b/site/static/admin/config.yml index cdb089e..bf0f03d 100644 --- a/site/static/admin/config.yml +++ b/site/static/admin/config.yml @@ -18,13 +18,30 @@ collections: # A list of collections the CMS should be able to edit - name: "pages" label: "Pages" files: - - file: "site/content/contact.md" + - file: "site/content/_index.md" + label: "Home Page" + name: "home" + fields: + - {label: Title, name: title, widget: string} + - {label: Subtitle, name: subtitle, widget: string} + - {label: Image, name: image, widget: image} + - {label: "Blurb", name: blurb, widget: object, fields: [ + {label: "Heading", name: "heading", widget: string}, + {label: "Text", name: "text", widget: "text"}]} + - {label: "Intro", name: intro, widget: object, fields: [ + {label: "Heading", name: "heading", widget: string}, + {label: "Text", name: "text", widget: "text"}]} + - {label: "Products", name: products, widget: list, fields: [ + {label: "Image", name: "image", widget: "image"}, + {label: "Text", name: "text", widget: "text"}]} + - {label: "Values", name: "values", widget: "object", fields: [ + {label: "Heading", name: "heading", widget: string}, + {label: "Text", name: "text", widget: "text"}]} + - file: "site/content/contact/_index.md" label: "Contact Page" name: "contact" fields: - {label: Title, name: title, widget: string} - - {label: Type, name: type, widget: hidden, default: contact} - - {label: Page, name: page, widget: hidden, default: "/contact.html"} - {label: Logo, name: logo, widget: image} - {label: Body, name: body, widget: markdown} - label: Contact Entries @@ -37,13 +54,11 @@ collections: # A list of collections the CMS should be able to edit - label: Text name: text widget: text - - file: "site/content/products.md" + - file: "site/content/products/_index.md" label: "Products Page" name: "products" fields: - {label: Title, name: title, widget: string} - - {label: Type, name: type, widget: hidden, default: products} - - {label: Page, name: page, widget: hidden, default: "/products.html"} - {label: Image, name: image, widget: image} - {label: Heading, name: heading, widget: string} - {label: Description, name: description, widget: string} @@ -52,13 +67,11 @@ collections: # A list of collections the CMS should be able to edit - {label: Testimonials, name: testimonials, widget: list, fields: [{label: Quote, name: quote, widget: string}, {label: Author, name: author, widget: string}]} - {label: Full_image, name: full_image, widget: image} - {label: Pricing, name: pricing, widget: object, fields: [{label: Heading, name: heading, widget: string}, {label: Description, name: description, widget: string}, {label: Plans, name: plans, widget: list, fields: [{label: Plan, name: plan, widget: string}, {label: Price, name: price, widget: string}, {label: Description, name: description, widget: string}, {label: Items, name: items, widget: list}]}]} - - file: "site/content/values.md" + - file: "site/content/values/_index.md" label: "Values Page" name: "values" fields: - {label: Title, name: title, widget: string} - - {label: Type, name: type, widget: hidden, default: values} - - {label: Page, name: page, widget: hidden, default: "/values.html"} - {label: Image, name: image, widget: image} - label: Values name: values diff --git a/src/js/cms-preview-templates/components/jumbotron.js b/src/js/cms-preview-templates/components/jumbotron.js index cb14df9..128a51e 100644 --- a/src/js/cms-preview-templates/components/jumbotron.js +++ b/src/js/cms-preview-templates/components/jumbotron.js @@ -2,7 +2,7 @@ import React from "react"; export default class Jumbotron extends React.Component { render() { - const {image, title} = this.props; + const {image, title, subtitle} = this.props; return
+ {subtitle &&

{ subtitle }

}
diff --git a/src/js/cms-preview-templates/home.js b/src/js/cms-preview-templates/home.js new file mode 100644 index 0000000..ca8c123 --- /dev/null +++ b/src/js/cms-preview-templates/home.js @@ -0,0 +1,69 @@ +import React from "react"; +import format from "date-fns/format"; + +import Jumbotron from "./components/jumbotron"; + +export default class PostPreview extends React.Component { + render() { + const {entry, getAsset} = this.props; + let image = getAsset(entry.getIn(["data", "image"])); + + // Bit of a nasty hack to make relative paths work as expected as a background image here + if (image && !image.fileObj) { + image = window.parent.location.protocol + "//" + window.parent.location.host + image; + } + + return
+ + +
+
+

{entry.getIn(["data", "blurb", "heading"])}

+

{entry.getIn(["data", "blurb", "text"])}

+
+
+ +
+
+

{entry.getIn(["data", "intro", "heading"])}

+

{entry.getIn(["data", "intro", "text"])}

+ +
+ {(entry.getIn(["data", "products"]) || []).map((product, i) =>
+ +

{product.get("text")}

+
)} +
+ + +
+
+ +
+
+ +
+
+

{entry.getIn(["data", "values", "heading"])}

+ +

{entry.getIn(["data", "values", "text"])}

+
+ +
+ +
+
+ +
+ Read more +
+ +
+
+ + +
+ } +} \ No newline at end of file diff --git a/src/js/cms.js b/src/js/cms.js index 3f018b9..ad298dd 100644 --- a/src/js/cms.js +++ b/src/js/cms.js @@ -1,6 +1,7 @@ import React from "react"; import CMS from "netlify-cms"; +import HomePreview from "./cms-preview-templates/home"; import PostPreview from "./cms-preview-templates/post"; import ProductsPreview from "./cms-preview-templates/products"; import ValuesPreview from "./cms-preview-templates/values"; @@ -20,6 +21,7 @@ class ColorControl extends React.Component { } CMS.registerPreviewStyle("/css/main.css"); +CMS.registerPreviewTemplate("home", HomePreview); CMS.registerPreviewTemplate("post", PostPreview); CMS.registerPreviewTemplate("products", ProductsPreview); CMS.registerPreviewTemplate("values", ValuesPreview); -- cgit v1.3