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 --- src/js/cms-preview-templates/home.js | 69 ++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/js/cms-preview-templates/home.js (limited to 'src/js/cms-preview-templates/home.js') 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 -- cgit v1.3