diff --git a/generate-static.sh b/generate-static.sh
index 2d4084e..c15ef23 100755
--- a/generate-static.sh
+++ b/generate-static.sh
@@ -1,16 +1,15 @@
#!/bin/bash
-
NODE_ENV=development node_modules/.bin/babel-node --presets 'react,es2015' react-dev/render_to_file.js
# sed -i '1 i\---\nlayout: default\n---' src/_layouts/post.html
-staticHTML=( "src/_layouts/post.html" )
+#staticHTML=( "src/_layouts/post.html" )
# add --- layout: default to frontmatter
# React doesn't do front matter very well
-for i in "${staticHTML[@]}"
-do
- sed -i '1 i\---\nlayout: default\n---' $i
-done
+#for i in "${staticHTML[@]}"
+#do
+# sed -i '1 i\---\nlayout: default\n---' $i
+#done
diff --git a/package.json b/package.json
index 00d0c5e..0eb621b 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,6 @@
"ejs": "^2.5.5",
"eslint-config-rallycoding": "^3.1.0",
"flexboxgrid": "^6.3.1",
- "fs": "0.0.1-security",
"fs-extra": "^1.0.0",
"fuzzy": "^0.1.3",
"gzip": "^0.1.0",
diff --git a/react-dev/render_to_file.js b/react-dev/render_to_file.js
index 8e8b75a..cb20b8d 100644
--- a/react-dev/render_to_file.js
+++ b/react-dev/render_to_file.js
@@ -1,17 +1,39 @@
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { html_beautify } from 'js-beautify';
-import fs from 'fs-extra';
+import fse from 'fs-extra';
+import _ from 'lodash';
import Post from './pages/post';
import Default from './pages/default';
+const files = {
+ post: './src/_layouts/post.html' // any files you want to add default layout to
+}; // add them to this object
+
function renderStatic(template, file) {
const html = html_beautify(renderToStaticMarkup(template));
- fs.outputFile(file, html, (err) => {
+ fse.outputFile(file, html, (err) => {
console.log(err);
});
}
-renderStatic(