From f56d727b6efba99954db379b1e3b3f0827a1668f Mon Sep 17 00:00:00 2001 From: Jinksi Date: Fri, 13 Oct 2017 08:20:26 +1000 Subject: [PATCH 01/61] parse-markdown --- .gitignore | 2 + content/pages/home.md | 13 ++ package.json | 16 +- public/admin/config.yml | 6 + public/admin/index.html | 16 ++ src/App.js | 7 +- src/views/Home.js | 22 +-- utils/parse-markdown.js | 61 ++++++ yarn.lock | 404 +++++++++++++++++++++++++++++++++++++++- 9 files changed, 520 insertions(+), 27 deletions(-) create mode 100644 content/pages/home.md create mode 100644 public/admin/config.yml create mode 100644 public/admin/index.html create mode 100644 utils/parse-markdown.js diff --git a/.gitignore b/.gitignore index 6c96c5c..b0beecc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ build .DS_Store .env npm-debug.log + +src/data.json diff --git a/content/pages/home.md b/content/pages/home.md new file mode 100644 index 0000000..08f4d05 --- /dev/null +++ b/content/pages/home.md @@ -0,0 +1,13 @@ +--- +title: __Home__ +subtitle: +--- + +# 🍉 HyperStatic + +A not-so-static site boilerplate: +- **Create React App** for simplicity +- **Styled Components** for component-based css +- **React Router** for routing (v4) +- **React Helmet** for document titles, descriptions, meta +- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️ diff --git a/package.json b/package.json index 9cc4f48..a879710 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,19 @@ "eslint-plugin-promise": "^3.5.0", "eslint-plugin-react": "^7.4.0", "eslint-plugin-standard": "^3.0.1", + "glob": "^7.1.2", "react-scripts": "^1.0.10", + "remark": "^8.0.0", + "remark-frontmatter": "^1.1.0", + "remark-html": "^6.0.1", + "remark-parse": "^4.0.0", "snazzy": "^7.0.0", "standard": "^10.0.2", - "sw-precache": "^5.2.0" + "sw-precache": "^5.2.0", + "to-vfile": "^2.1.2", + "unified": "^6.1.5", + "vfile-reporter": "^4.0.0", + "yamljs": "^0.3.0" }, "dependencies": { "polished": "^1.2.1", @@ -28,8 +37,9 @@ "styled-components": "^2.1.0" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build && react-snapshot && npm run sw", + "start": "npm run parse-content && react-scripts start", + "build": "npm run parse-content && react-scripts build && react-snapshot && npm run sw", + "parse-content": "node ./utils/parse-markdown.js", "sw": "sw-precache --config='sw-precache-config.js'", "test": "standard | snazzy && react-scripts test --env=jsdom", "eject": "react-scripts eject" diff --git a/public/admin/config.yml b/public/admin/config.yml new file mode 100644 index 0000000..be79ef5 --- /dev/null +++ b/public/admin/config.yml @@ -0,0 +1,6 @@ +backend: + name: git-gateway + branch: master # Branch to update (optional; defaults to master) + +media_folder: "public/images/uploads" # Media files will be stored in the repo under static/images/uploads +public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads diff --git a/public/admin/index.html b/public/admin/index.html new file mode 100644 index 0000000..c9131ee --- /dev/null +++ b/public/admin/index.html @@ -0,0 +1,16 @@ + + + + + + Content Manager + + + + + + + + + + diff --git a/src/App.js b/src/App.js index 9d26173..96393b7 100644 --- a/src/App.js +++ b/src/App.js @@ -14,13 +14,16 @@ import GithubCorner from './components/GithubCorner' import ServiceWorkerNotifications from './components/ServiceWorkerNotifications' import globalStyles from './globalStyles' +import data from './data.json' + export const siteTitle = 'HyperStatic' + const routes = [ { - title: 'Home', path: '/', comp: Home, - exact: true + exact: true, + page: data.pages.home }, { title: 'About', path: '/about/', diff --git a/src/views/Home.js b/src/views/Home.js index 3c77a4f..365d1f9 100644 --- a/src/views/Home.js +++ b/src/views/Home.js @@ -1,29 +1,17 @@ import React from 'react' import Helmet from 'react-helmet' + import Page from '../components/Page' import { Container, Section } from '../components/common' import PageHeader from '../components/PageHeader' -import Marked from 'react-markdown' -const content = ` - # 🍉 HyperStatic - - A not-so-static site boilerplate: - - **Create React App** for simplicity - - **Styled Components** for component-based css - - **React Router** for routing (v4) - - **React Helmet** for document titles, descriptions, meta - - **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️ -` - -export default ({ title }) => { +export default ({ page }) => { + const { title, subtitle } = page.data return ( - +
- - - +
{title} diff --git a/utils/parse-markdown.js b/utils/parse-markdown.js new file mode 100644 index 0000000..e7f1bac --- /dev/null +++ b/utils/parse-markdown.js @@ -0,0 +1,61 @@ +const fs = require('fs') +const path = require('path') +const _set = require('lodash/set') +const globCb = require('glob') +const util = require('util') +const unified = require('unified') +const parse = require('remark-parse') +const frontmatter = require('remark-frontmatter') +const vfile = require('to-vfile') +const report = require('vfile-reporter') +const html = require('remark-html') +const yaml = require('yamljs') + +const glob = util.promisify(globCb) + +const options = { + markdownDir: './content/', + outputFile: './src/data.json' +} + +const addYamlData = () => (data, file) => { + const yamlData = data.children.find(item => item.type === 'yaml') + file.data = yaml.parse(yamlData.value) +} + +const parseFile = path => new Promise((resolve, reject) => { + unified() + .use(parse) + .use(frontmatter, ['yaml']) + .use(addYamlData) + .use(html) + .process(vfile.readSync(path), (err, file) => { + if (err) reject(report(err || file)) + resolve(file) + }) +}) + +const parseFiles = async files => { + const results = await Promise.all(files.map(parseFile)) + return results +} + +const makeJSON = async () => { + const paths = await glob(`${options.markdownDir}/**/**.md`) + const results = await parseFiles(paths) + let data = {} + results.map(item => { + const pathParsed = path.parse(item.history[0]) + const objectKey = pathParsed.dir.replace(options.markdownDir, '').replace(/\//g, '.') + const nest = `${objectKey}.${pathParsed.name}` + _set(data, nest, {...item}) + }) + return JSON.stringify(data, null, 2) +} + +const markdownToJson = async () => { + const json = await makeJSON() + fs.writeFileSync(options.outputFile, json) +} + +markdownToJson() diff --git a/yarn.lock b/yarn.lock index 9aff676..90ffb4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -235,6 +235,10 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" +array-iterate@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.1.tgz#865bf7f8af39d6b0982c60902914ac76bc0108f6" + array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -1082,6 +1086,10 @@ babylon@^6.13.0, babylon@^6.17.0, babylon@^6.17.2: version "6.17.4" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" +bail@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.2.tgz#f7d6c1731630a9f9f0d4d35ed1f962e2074a1764" + balanced-match@^0.4.1, balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -1398,6 +1406,10 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" +ccount@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.2.tgz#53b6a2f815bb77b9c2871f7b9a72c3a25f1d8e89" + center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -1423,6 +1435,22 @@ chalk@^2.0.0, chalk@^2.1.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +character-entities-html4@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50" + +character-entities-legacy@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.1.tgz#f40779df1a101872bb510a3d295e1fccf147202f" + +character-entities@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.1.tgz#f76871be5ef66ddb7f8f8e3478ecc374c27d6dca" + +character-reference-invalid@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.1.tgz#942835f750e4ec61a308e60c2ef8cc1011202efc" + chokidar@^1.6.0, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -1518,6 +1546,10 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.3.tgz#4b906f670e5a963a87b76b0e1689643341b6023c" + color-convert@^1.0.0, color-convert@^1.3.0, color-convert@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" @@ -1560,6 +1592,12 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.4.tgz#72083e58d4a462f01866f6617f4d98a3cd3b8a46" + dependencies: + trim "0.0.1" + commander@2.9.x, commander@^2.9.0, commander@~2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -2047,6 +2085,12 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +detab@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.1.tgz#531f5e326620e2fd4f03264a905fb3bcc8af4df4" + dependencies: + repeat-string "^1.5.4" + detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -2811,6 +2855,10 @@ express@^4.13.3, express@^4.15.2: utils-merge "1.0.0" vary "~1.1.1" +extend@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" + extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" @@ -2854,6 +2902,12 @@ fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" +fault@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.1.tgz#de8d350dfd48be24b5dc1b02867e0871b9135092" + dependencies: + format "^0.2.2" + faye-websocket@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -3041,6 +3095,10 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +format@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" + forwarded@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" @@ -3347,6 +3405,36 @@ hash.js@^1.0.0, hash.js@^1.0.3: dependencies: inherits "^2.0.1" +hast-util-is-element@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.0.tgz#3f7216978b2ae14d98749878782675f33be3ce00" + +hast-util-sanitize@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.1.2.tgz#d10bd6757a21e59c13abc8ae3530dd3b6d7d679e" + dependencies: + xtend "^4.0.1" + +hast-util-to-html@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-3.1.0.tgz#882c99849e40130e991c042e456d453d95c36cff" + dependencies: + ccount "^1.0.0" + comma-separated-tokens "^1.0.1" + hast-util-is-element "^1.0.0" + hast-util-whitespace "^1.0.0" + html-void-elements "^1.0.0" + kebab-case "^1.0.0" + property-information "^3.1.0" + space-separated-tokens "^1.0.0" + stringify-entities "^1.0.1" + unist-util-is "^2.0.0" + xtend "^4.0.1" + +hast-util-whitespace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.0.tgz#bd096919625d2936e1ff17bc4df7fd727f17ece9" + hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -3443,6 +3531,10 @@ html-minifier@^3.2.3: relateurl "0.2.x" uglify-js "3.0.x" +html-void-elements@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.2.tgz#9d22e0ca32acc95b3f45b8d5b4f6fbdc05affd55" + html-webpack-plugin@2.29.0: version "2.29.0" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-2.29.0.tgz#e987f421853d3b6938c8c4c8171842e5fd17af23" @@ -3684,6 +3776,21 @@ is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" +is-alphabetical@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.1.tgz#c77079cc91d4efac775be1034bf2d243f95e6f08" + +is-alphanumeric@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" + +is-alphanumerical@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.1.tgz#dfb4aa4d1085e33bdb61c2dee9c80e9c6c19f53b" + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3698,6 +3805,10 @@ is-buffer@^1.0.2: version "1.1.4" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-buffer@^1.1.4: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -3718,6 +3829,10 @@ is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" +is-decimal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.1.tgz#f5fb6a94996ad9e8e3761fbfbd091f1fca8c4e82" + is-dotfile@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" @@ -3772,6 +3887,10 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" +is-hexadecimal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" + is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: version "2.15.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" @@ -3811,7 +3930,7 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-obj@^1.0.0: +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -3883,10 +4002,18 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-whitespace-character@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.1.tgz#9ae0176f3282b65457a1992cdb084f8a5f833e3b" + is-windows@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" +is-word-character@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.1.tgz#5a03fa1ea91ace8a6eb0c7cd770eb86d65c8befb" + is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" @@ -4372,6 +4499,10 @@ jsx-ast-utils@^2.0.0: dependencies: array-includes "^3.0.3" +kebab-case@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" + kind-of@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" @@ -4546,6 +4677,10 @@ loglevel@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.5.0.tgz#3863984a2c326b986fbb965f378758a6dc8a4324" +longest-streak@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.1.tgz#42d291b5411e40365c00e63193497e2247316e35" + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -4598,13 +4733,50 @@ map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" +markdown-escapes@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.1.tgz#1994df2d3af4811de59a6714934c2b2292734518" + +markdown-table@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.1.tgz#4b3dd3a133d1518b8ef0dbc709bf2a1b4824bc8c" + math-expression-evaluator@^1.2.14: version "1.2.15" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.15.tgz#38dc5f0194c5bf5ff1c690ad4c4b64df71ac0187" dependencies: lodash.indexof "^4.0.5" -"mdurl@~ 1.0.1": +mdast-util-compact@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz#cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a" + dependencies: + unist-util-modify-children "^1.0.0" + unist-util-visit "^1.1.0" + +mdast-util-definitions@^1.2.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.2.tgz#673f4377c3e23d3de7af7a4fe2214c0e221c5ac7" + dependencies: + unist-util-visit "^1.0.0" + +mdast-util-to-hast@^2.1.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.5.0.tgz#f087844d255c7540f36906da30ba106c0ee5ee2f" + dependencies: + collapse-white-space "^1.0.0" + detab "^2.0.0" + mdast-util-definitions "^1.2.0" + mdurl "^1.0.1" + trim "0.0.1" + trim-lines "^1.0.0" + unist-builder "^1.0.1" + unist-util-generated "^1.1.0" + unist-util-position "^3.0.0" + unist-util-visit "^1.1.0" + xtend "^4.0.1" + +mdurl@^1.0.1, "mdurl@~ 1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -5103,6 +5275,17 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" +parse-entities@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.1.tgz#8112d88471319f27abae4d64964b122fe4e1b890" + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -5654,6 +5837,10 @@ prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" +property-information@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.2.0.tgz#fd1483c8fbac61808f5fe359e7693a1f48a58331" + proxy-addr@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3" @@ -6112,6 +6299,69 @@ relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" +remark-frontmatter@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-1.1.0.tgz#9d23c2b376f56617bdb5c5560f1b56e45b19788b" + dependencies: + fault "^1.0.1" + xtend "^4.0.1" + +remark-html@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.1.tgz#5094d2c71f7941fdb2ae865bac76627757ce09c1" + dependencies: + hast-util-sanitize "^1.0.0" + hast-util-to-html "^3.0.0" + mdast-util-to-hast "^2.1.1" + xtend "^4.0.1" + +remark-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-4.0.0.tgz#99f1f049afac80382366e2e0d0bd55429dd45d8b" + dependencies: + collapse-white-space "^1.0.2" + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + is-word-character "^1.0.0" + markdown-escapes "^1.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + trim "0.0.1" + trim-trailing-lines "^1.0.0" + unherit "^1.0.4" + unist-util-remove-position "^1.0.0" + vfile-location "^2.0.0" + xtend "^4.0.1" + +remark-stringify@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-4.0.0.tgz#4431884c0418f112da44991b4e356cfe37facd87" + dependencies: + ccount "^1.0.0" + is-alphanumeric "^1.0.0" + is-decimal "^1.0.0" + is-whitespace-character "^1.0.0" + longest-streak "^2.0.1" + markdown-escapes "^1.0.0" + markdown-table "^1.1.0" + mdast-util-compact "^1.0.0" + parse-entities "^1.0.2" + repeat-string "^1.5.4" + state-toggle "^1.0.0" + stringify-entities "^1.0.1" + unherit "^1.0.4" + xtend "^4.0.1" + +remark@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-8.0.0.tgz#287b6df2fe1190e263c1d15e486d3fa835594d6d" + dependencies: + remark-parse "^4.0.0" + remark-stringify "^4.0.0" + unified "^6.0.0" + renderkid@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.0.tgz#1859753e7a5adbf35443aba0d4e4579e78abee85" @@ -6126,7 +6376,7 @@ repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" -repeat-string@^1.5.2: +repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -6136,6 +6386,10 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +replace-ext@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + request@^2.55.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -6556,6 +6810,12 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" +space-separated-tokens@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.1.tgz#9695b9df9e65aec1811d4c3f9ce52520bc2f7e4d" + dependencies: + trim "0.0.1" + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -6641,6 +6901,10 @@ standard@^10.0.2: eslint-plugin-standard "~3.0.1" standard-engine "~7.0.0" +state-toggle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" + "statuses@>= 1.3.1 < 2", statuses@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" @@ -6672,7 +6936,7 @@ string-length@^1.0.1: dependencies: strip-ansi "^3.0.0" -string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.0, string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -6708,6 +6972,15 @@ string_decoder@~1.0.0: dependencies: safe-buffer "^5.0.1" +stringify-entities@^1.0.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.1.tgz#b150ec2d72ac4c1b5f324b51fb6b28c9cdff058c" + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -6793,7 +7066,7 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" -supports-color@^4.2.1, supports-color@^4.4.0: +supports-color@^4.1.0, supports-color@^4.2.1, supports-color@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" dependencies: @@ -6954,6 +7227,13 @@ to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" +to-vfile@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-2.1.2.tgz#63f410e3b72937be84e8198961caf74be2da4388" + dependencies: + is-buffer "^1.1.4" + vfile "^2.0.0" + toposort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.2.tgz#be1de72431320fcefe35a7b539c1c336cbcfd32c" @@ -6968,6 +7248,10 @@ tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" +trim-lines@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.0.tgz#9926d03ede13ba18f7d42222631fb04c79ff26fe" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -6976,6 +7260,18 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +trim-trailing-lines@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684" + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + +trough@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.1.tgz#a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86" + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" @@ -7060,6 +7356,25 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" +unherit@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.0.tgz#6b9aaedfbf73df1756ad9e316dd981885840cd7d" + dependencies: + inherits "^2.0.1" + xtend "^4.0.1" + +unified@^6.0.0, unified@^6.1.5: + version "6.1.5" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.5.tgz#716937872621a63135e62ced2f3ac6a063c6fb87" + dependencies: + bail "^1.0.0" + extend "^3.0.0" + is-plain-obj "^1.1.0" + trough "^1.0.0" + vfile "^2.0.0" + x-is-function "^1.0.4" + x-is-string "^0.1.0" + uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" @@ -7074,6 +7389,44 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" +unist-builder@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-1.0.2.tgz#8c3b9903ef64bcfb117dd7cf6a5d98fc1b3b27b6" + dependencies: + object-assign "^4.1.0" + +unist-util-generated@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.1.tgz#99f16c78959ac854dee7c615c291924c8bf4de7f" + +unist-util-is@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.1.tgz#0c312629e3f960c66e931e812d3d80e77010947b" + +unist-util-modify-children@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.1.tgz#66d7e6a449e6f67220b976ab3cb8b5ebac39e51d" + dependencies: + array-iterate "^1.0.0" + +unist-util-position@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.0.0.tgz#e6e1e03eeeb81c5e1afe553e8d4adfbd7c0d8f82" + +unist-util-remove-position@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz#5a85c1555fc1ba0c101b86707d15e50fa4c871bb" + dependencies: + unist-util-visit "^1.1.0" + +unist-util-stringify-position@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" + +unist-util-visit@^1.0.0, unist-util-visit@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.3.tgz#ec268e731b9d277a79a5b5aa0643990e405d600b" + universalify@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" @@ -7202,6 +7555,32 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" +vfile-location@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.2.tgz#d3675c59c877498e492b4756ff65e4af1a752255" + +vfile-reporter@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-4.0.0.tgz#ea6f0ae1342f4841573985e05f941736f27de9da" + dependencies: + repeat-string "^1.5.0" + string-width "^1.0.0" + supports-color "^4.1.0" + unist-util-stringify-position "^1.0.0" + vfile-statistics "^1.1.0" + +vfile-statistics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.0.tgz#02104c60fdeed1d11b1f73ad65330b7634b3d895" + +vfile@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.2.0.tgz#ce47a4fb335922b233e535db0f7d8121d8fced4e" + dependencies: + is-buffer "^1.1.4" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -7433,6 +7812,14 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" +x-is-function@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" + +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + xdg-basedir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" @@ -7463,6 +7850,13 @@ yallist@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" +yamljs@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.3.0.tgz#dc060bf267447b39f7304e9b2bfbe8b5a7ddb03b" + dependencies: + argparse "^1.0.7" + glob "^7.0.5" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" From b60d68d1c538f89cbc8fc3f1af1112f8d1c08710 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Fri, 13 Oct 2017 08:21:56 +1000 Subject: [PATCH 02/61] Add .nvmrc --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +8 From 9db5d41346981ed0c32830765358b741626da3aa Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 10:13:46 +1000 Subject: [PATCH 03/61] Add about.json --- content/pages/about.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 content/pages/about.json diff --git a/content/pages/about.json b/content/pages/about.json new file mode 100644 index 0000000..25c9df8 --- /dev/null +++ b/content/pages/about.json @@ -0,0 +1,3 @@ +{ + "title": "about" +} From ff37736a068f94f3679437bd00c2dadda12f426a Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 00:17:11 +0000 Subject: [PATCH 04/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/pages/about.json b/content/pages/about.json index 25c9df8..b2537ea 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1,3 +1 @@ -{ - "title": "about" -} +{"title":"About page title"} \ No newline at end of file From 837c4c0fd1efe96e68ea2342eee71ed2a5d08c50 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 10:18:11 +1000 Subject: [PATCH 05/61] Update admin --- public/admin/config.yml | 17 ++++++++++++++++- public/admin/index.html | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/public/admin/config.yml b/public/admin/config.yml index be79ef5..ef1b414 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -1,6 +1,21 @@ backend: name: git-gateway - branch: master # Branch to update (optional; defaults to master) + branch: netlify-cms # Branch to update (optional; defaults to master) media_folder: "public/images/uploads" # Media files will be stored in the repo under static/images/uploads public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads + +collections: # A list of collections the CMS should be able to edit + - name: "pages" + label: "Pages" + files: + - file: "content/pages/home.md" + label: "Home Page" + name: "home-page" + fields: + - {label: Title, name: title, widget: string} + - file: "content/pages/about.json" + label: "About Page" + name: "about-page" + fields: + - {label: Title, name: title, widget: string} diff --git a/public/admin/index.html b/public/admin/index.html index c9131ee..1ef4650 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -12,5 +12,6 @@ + From 95f4dcdf74b65b3847b33065ef3d35b272646aab Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 00:20:52 +0000 Subject: [PATCH 06/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/content/pages/home.md b/content/pages/home.md index 08f4d05..fd701c7 100644 --- a/content/pages/home.md +++ b/content/pages/home.md @@ -1,13 +1,4 @@ --- -title: __Home__ -subtitle: +title: Home page update --- -# 🍉 HyperStatic - -A not-so-static site boilerplate: -- **Create React App** for simplicity -- **Styled Components** for component-based css -- **React Router** for routing (v4) -- **React Helmet** for document titles, descriptions, meta -- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️ From f0d52816249a44d941f0fd3b56fda569ae835e81 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 10:22:52 +1000 Subject: [PATCH 07/61] Link to example config --- public/admin/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/public/admin/config.yml b/public/admin/config.yml index ef1b414..9734aa1 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -1,3 +1,4 @@ +# See https://github.com/netlify/netlify-cms/blob/master/example/config.yml backend: name: git-gateway branch: netlify-cms # Branch to update (optional; defaults to master) From a744e586203eaff34bcf838be55d525bf6256fce Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 00:25:32 +0000 Subject: [PATCH 08/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/pages/home.md b/content/pages/home.md index fd701c7..c247331 100644 --- a/content/pages/home.md +++ b/content/pages/home.md @@ -1,4 +1,5 @@ --- title: Home page update +contents: "# \U0001F349 HyperStatic\n\nA not-so-static site boilerplate:\n- **Create React App** for simplicity\n- **Styled Components** for component-based css\n- **React Router** for routing (v4)\n- **React Helmet** for document titles, descriptions, meta\n- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️" --- From 123da31c555634bfb8d9a10f2ea091d266dec033 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 00:27:03 +0000 Subject: [PATCH 09/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/pages/home.md b/content/pages/home.md index c247331..3b88815 100644 --- a/content/pages/home.md +++ b/content/pages/home.md @@ -1,5 +1,11 @@ --- title: Home page update -contents: "# \U0001F349 HyperStatic\n\nA not-so-static site boilerplate:\n- **Create React App** for simplicity\n- **Styled Components** for component-based css\n- **React Router** for routing (v4)\n- **React Helmet** for document titles, descriptions, meta\n- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️" --- +# 🍉 HyperStatic +A not-so-static site boilerplate: +- **Create React App** for simplicity +- **Styled Components** for component-based css +- **React Router** for routing (v4) +- **React Helmet** for document titles, descriptions, meta +- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️ From e87ac463b822a501138535bf9996225f09148049 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 00:28:09 +0000 Subject: [PATCH 10/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/about.json b/content/pages/about.json index b2537ea..81cd872 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1 +1 @@ -{"title":"About page title"} \ No newline at end of file +{"title":"About page title","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file From 794994539fc62a498d77234e2b5d7c89ff581d4a Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 10:29:12 +1000 Subject: [PATCH 11/61] Update config.yml --- public/admin/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/admin/config.yml b/public/admin/config.yml index 9734aa1..f27a187 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -15,8 +15,10 @@ collections: # A list of collections the CMS should be able to edit name: "home-page" fields: - {label: Title, name: title, widget: string} + - {label: Body, name: body, widget: markdown} - file: "content/pages/about.json" label: "About Page" name: "about-page" fields: - {label: Title, name: title, widget: string} + - {label: Body, name: body, widget: markdown} From 22073d6db2f2a2c6b2cc50705ecb8803ee954c3b Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 17:23:27 +1000 Subject: [PATCH 12/61] Add home.json --- content/pages/home.json | 1 + public/admin/config.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 content/pages/home.json diff --git a/content/pages/home.json b/content/pages/home.json new file mode 100644 index 0000000..81cd872 --- /dev/null +++ b/content/pages/home.json @@ -0,0 +1 @@ +{"title":"About page title","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file diff --git a/public/admin/config.yml b/public/admin/config.yml index f27a187..1ed2dc9 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -10,7 +10,7 @@ collections: # A list of collections the CMS should be able to edit - name: "pages" label: "Pages" files: - - file: "content/pages/home.md" + - file: "content/pages/home.json" label: "Home Page" name: "home-page" fields: From b7e57f43cccd71f5b73d1ee351a3b2132ca10375 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 07:31:28 +0000 Subject: [PATCH 13/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/home.json b/content/pages/home.json index 81cd872..6ce01b2 100644 --- a/content/pages/home.json +++ b/content/pages/home.json @@ -1 +1 @@ -{"title":"About page title","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file +{"title":"Home","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n- **Create React App** for simplicity\n- **Styled Components** for component-based css\n- **React Router** for routing (v4)\n- **React Helmet** for document titles, descriptions, meta\n- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️"} \ No newline at end of file From f51c8a0e138811732053741bdff12fdb10d20e91 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 07:32:34 +0000 Subject: [PATCH 14/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/home.json b/content/pages/home.json index 6ce01b2..c64af19 100644 --- a/content/pages/home.json +++ b/content/pages/home.json @@ -1 +1 @@ -{"title":"Home","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n- **Create React App** for simplicity\n- **Styled Components** for component-based css\n- **React Router** for routing (v4)\n- **React Helmet** for document titles, descriptions, meta\n- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️"} \ No newline at end of file +{"title":"Home","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n\n* **Create React App** for simplicity\n* **Styled Components** for component-based css\n* **React Router** for routing (v4)\n* **React Helmet** for document titles, descriptions, meta\n* **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️\n* [**Netlify CMS**](https://netlifycms.org)"} \ No newline at end of file From 063ed17192520c91f6c4ecd12f8bb6909e26cd5c Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 17:33:32 +1000 Subject: [PATCH 15/61] RM home.md --- content/pages/home.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 content/pages/home.md diff --git a/content/pages/home.md b/content/pages/home.md deleted file mode 100644 index 3b88815..0000000 --- a/content/pages/home.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Home page update ---- -# 🍉 HyperStatic - -A not-so-static site boilerplate: -- **Create React App** for simplicity -- **Styled Components** for component-based css -- **React Router** for routing (v4) -- **React Helmet** for document titles, descriptions, meta -- **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️ From bd130d0f961862fc6668e391f0c81cedfab5ff81 Mon Sep 17 00:00:00 2001 From: Eric Jinks Date: Fri, 13 Oct 2017 17:54:47 +1000 Subject: [PATCH 16/61] parse JSON WIP --- utils/parse-posts.js | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 utils/parse-posts.js diff --git a/utils/parse-posts.js b/utils/parse-posts.js new file mode 100644 index 0000000..ad4bd7b --- /dev/null +++ b/utils/parse-posts.js @@ -0,0 +1,45 @@ +const fs = require('fs') +const path = require('path') + +const globCb = require('glob') +const util = require('util') + +const glob = util.promisify(globCb) +const readFile = util.promisify(fs.readFileSync) + +const options = { + contentDir: './content/', + outputFile: './src/data.json' +} + +const getFileContents = async file => { + const result = await readFile(file, 'utf8') + return result +} + +const readFiles = async paths => { + const results = await Promise.all(paths.map(getFileContents)) + return results +} + +const makeJSON = async () => { + const paths = await glob(`${options.contentDir}/**/**.json`) + const results = await parseFiles(paths) + return console.log(results) + let data = {} + results.map(item => { + const pathParsed = path.parse(item.history[0]) + const objectKey = pathParsed.dir.replace(options.markdownDir, '').replace(/\//g, '.') + const nest = `${objectKey}.${pathParsed.name}` + _set(data, nest, {...item}) + }) + return JSON.stringify(data, null, 2) +} + +const markdownToJson = async () => { + const json = await makeJSON() + return console.log(json) + fs.writeFileSync(options.outputFile, json) +} + +markdownToJson() From 1cf9fa1a249aab27a0ec8d508835bee9b22b10f2 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Fri, 13 Oct 2017 22:15:55 +1000 Subject: [PATCH 17/61] parse-content (JSON) --- utils/parse-content.js | 44 +++++++++++++++++++++++++++++++++++++++++ utils/parse-posts.js | 45 ------------------------------------------ 2 files changed, 44 insertions(+), 45 deletions(-) create mode 100644 utils/parse-content.js delete mode 100644 utils/parse-posts.js diff --git a/utils/parse-content.js b/utils/parse-content.js new file mode 100644 index 0000000..689c4bf --- /dev/null +++ b/utils/parse-content.js @@ -0,0 +1,44 @@ +const fs = require('fs') +const path = require('path') +const _set = require('lodash/set') +const _merge = require('lodash/merge') +const globCb = require('glob') +const util = require('util') + +const glob = util.promisify(globCb) +const readFile = util.promisify(fs.readFile) + +const options = { + contentDir: './content/', + outputFile: './src/data.json' +} + +const getNestedKey = filePath => { + const pathParsed = path.parse(filePath) + const objectKey = pathParsed.dir.replace(options.contentDir, '').replace(/\//g, '.') + return `${objectKey}.${pathParsed.name}` +} + +const getFileContents = filePath => + readFile(filePath, 'utf8') + .then(data => { + let obj = {} + _set(obj, getNestedKey(filePath), data) + return obj + }) + +const readFiles = async paths => Promise.all(paths.map(getFileContents)) + +const combineJSON = async () => { + const paths = await glob(`${options.contentDir}/**/**.json`) + const results = await readFiles(paths) + const data = _merge({}, ...results) + return JSON.stringify(data, null, 2) +} + +const writeJSON = async () => { + const json = await combineJSON() + fs.writeFileSync(options.outputFile, json) +} + +writeJSON() diff --git a/utils/parse-posts.js b/utils/parse-posts.js deleted file mode 100644 index ad4bd7b..0000000 --- a/utils/parse-posts.js +++ /dev/null @@ -1,45 +0,0 @@ -const fs = require('fs') -const path = require('path') - -const globCb = require('glob') -const util = require('util') - -const glob = util.promisify(globCb) -const readFile = util.promisify(fs.readFileSync) - -const options = { - contentDir: './content/', - outputFile: './src/data.json' -} - -const getFileContents = async file => { - const result = await readFile(file, 'utf8') - return result -} - -const readFiles = async paths => { - const results = await Promise.all(paths.map(getFileContents)) - return results -} - -const makeJSON = async () => { - const paths = await glob(`${options.contentDir}/**/**.json`) - const results = await parseFiles(paths) - return console.log(results) - let data = {} - results.map(item => { - const pathParsed = path.parse(item.history[0]) - const objectKey = pathParsed.dir.replace(options.markdownDir, '').replace(/\//g, '.') - const nest = `${objectKey}.${pathParsed.name}` - _set(data, nest, {...item}) - }) - return JSON.stringify(data, null, 2) -} - -const markdownToJson = async () => { - const json = await makeJSON() - return console.log(json) - fs.writeFileSync(options.outputFile, json) -} - -markdownToJson() From a578271fdcdf704ecdc05d3795c22be0bb2863aa Mon Sep 17 00:00:00 2001 From: Jinksi Date: Fri, 13 Oct 2017 22:37:04 +1000 Subject: [PATCH 18/61] Integrating content data --- content/pages/contact.json | 1 + package.json | 2 +- src/App.js | 50 +++++++++----------------------------- src/components/Nav.js | 11 ++++++++- src/components/NavLink.js | 6 ++--- src/views/About.js | 10 ++++---- src/views/Contact.js | 6 ++--- src/views/Home.js | 8 +++--- utils/parse-content.js | 2 +- 9 files changed, 40 insertions(+), 56 deletions(-) create mode 100644 content/pages/contact.json diff --git a/content/pages/contact.json b/content/pages/contact.json new file mode 100644 index 0000000..469b3c2 --- /dev/null +++ b/content/pages/contact.json @@ -0,0 +1 @@ +{"title":"Contact","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n\n* **Create React App** for simplicity\n* **Styled Components** for component-based css\n* **React Router** for routing (v4)\n* **React Helmet** for document titles, descriptions, meta\n* **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️\n* [**Netlify CMS**](https://netlifycms.org)"} diff --git a/package.json b/package.json index a879710..5be0319 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "scripts": { "start": "npm run parse-content && react-scripts start", "build": "npm run parse-content && react-scripts build && react-snapshot && npm run sw", - "parse-content": "node ./utils/parse-markdown.js", + "parse-content": "node ./utils/parse-content.js", "sw": "sw-precache --config='sw-precache-config.js'", "test": "standard | snazzy && react-scripts test --env=jsdom", "eject": "react-scripts eject" diff --git a/src/App.js b/src/App.js index 96393b7..607872f 100644 --- a/src/App.js +++ b/src/App.js @@ -8,8 +8,6 @@ import About from './views/About' import Contact from './views/Contact' import NoMatch from './views/NoMatch' import Nav from './components/Nav' -import NavLink from './components/NavLink' -import Logo from './components/Logo' import GithubCorner from './components/GithubCorner' import ServiceWorkerNotifications from './components/ServiceWorkerNotifications' import globalStyles from './globalStyles' @@ -18,25 +16,6 @@ import data from './data.json' export const siteTitle = 'HyperStatic' -const routes = [ - { - path: '/', - comp: Home, - exact: true, - page: data.pages.home - }, { - title: 'About', - path: '/about/', - comp: About, - exact: true - }, { - title: 'Contact', - path: '/contact/', - comp: Contact, - exact: true - } -] - class App extends Component { componentWillMount () { globalStyles() @@ -47,27 +26,20 @@ class App extends Component {
- + - +
diff --git a/src/components/Nav.js b/src/components/Nav.js index a69b786..df2eebb 100644 --- a/src/components/Nav.js +++ b/src/components/Nav.js @@ -1,6 +1,8 @@ import React from 'react' import styled from 'styled-components' import { Container, Flex } from './common' +import NavLink from './NavLink' +import Logo from './Logo' const Nav = styled.div` background: white; @@ -11,7 +13,14 @@ const Nav = styled.div` export default (props) => ( ) diff --git a/src/components/NavLink.js b/src/components/NavLink.js index 093a5b9..0f34342 100644 --- a/src/components/NavLink.js +++ b/src/components/NavLink.js @@ -20,10 +20,10 @@ const NavLink = styled.span` } ` -export default ({ path, exact, ...props }) => ( - ( +export default ({ to, exact, match, children }) => ( + ( - {props.title} + {children} )} /> ) diff --git a/src/views/About.js b/src/views/About.js index 0fb7f6d..13ee661 100644 --- a/src/views/About.js +++ b/src/views/About.js @@ -4,9 +4,12 @@ import Page from '../components/Page' import PageHeader from '../components/PageHeader' import { Container, Section } from '../components/common' -export default ({ title }) => ( +export default ({ page }) => ( - + + {page.title} + +

Hello World!

@@ -19,8 +22,5 @@ export default ({ title }) => (

A sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

- - {title} -
) diff --git a/src/views/Contact.js b/src/views/Contact.js index 8263d0d..f38e18c 100644 --- a/src/views/Contact.js +++ b/src/views/Contact.js @@ -18,9 +18,9 @@ const content = ` Find out more in the [Netlify Docs](https://www.netlify.com/docs/form-handling/). ` -export default ({ title }) => ( +export default ({ page }) => ( - +
@@ -33,7 +33,7 @@ export default ({ title }) => (
- {title} + {page.title}
) diff --git a/src/views/Home.js b/src/views/Home.js index 365d1f9..b2901ac 100644 --- a/src/views/Home.js +++ b/src/views/Home.js @@ -1,17 +1,19 @@ import React from 'react' import Helmet from 'react-helmet' - +import Marked from 'react-markdown' import Page from '../components/Page' import { Container, Section } from '../components/common' import PageHeader from '../components/PageHeader' export default ({ page }) => { - const { title, subtitle } = page.data + const { title, subtitle } = page return (
- + + +
{title} diff --git a/utils/parse-content.js b/utils/parse-content.js index 689c4bf..eba261a 100644 --- a/utils/parse-content.js +++ b/utils/parse-content.js @@ -23,7 +23,7 @@ const getFileContents = filePath => readFile(filePath, 'utf8') .then(data => { let obj = {} - _set(obj, getNestedKey(filePath), data) + _set(obj, getNestedKey(filePath), JSON.parse(data)) return obj }) From 0bd1c419d6d119fd5e18a279487d03f9107f4454 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 12:51:06 +0000 Subject: [PATCH 19/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Ccontact-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/contact.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/contact.json b/content/pages/contact.json index 469b3c2..bf3a0ba 100644 --- a/content/pages/contact.json +++ b/content/pages/contact.json @@ -1 +1 @@ -{"title":"Contact","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n\n* **Create React App** for simplicity\n* **Styled Components** for component-based css\n* **React Router** for routing (v4)\n* **React Helmet** for document titles, descriptions, meta\n* **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️\n* [**Netlify CMS**](https://netlifycms.org)"} +{"title":"Contact","subtitle":"","body":"# Example contact form\n\nThis form is setup to use Netlify's form handling:\n\n- the form action is set to the current absolute url: \\`action: '/contact/'\\`\n- a name attribute is sent with the form's data \\`'form-name': 'Contact'\\`\n- netlify data attributes are added to the form \\`data-netlify data-netlify-honeypot\\`\n\nFind out more in the [Netlify Docs](https://www.netlify.com/docs/form-handling/).\n"} \ No newline at end of file From 961547d3b22c8dd4dd445aea9a5c3a3428f58658 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 12:52:45 +0000 Subject: [PATCH 20/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/about.json b/content/pages/about.json index 81cd872..7352514 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1 +1 @@ -{"title":"About page title","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file +{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file From 298a29856cc077ef2696a5e8e0b73ab2f0beb1fc Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 12:55:09 +0000 Subject: [PATCH 21/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/about.json b/content/pages/about.json index 7352514..03f6238 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1 +1 @@ -{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n"} \ No newline at end of file +{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n","section1":"## Hello World!\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.\n","section2":"## This is a skinny center-aligned {'\\'}\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

\n"} \ No newline at end of file From ebf801162a872d7a1009c93103b6ec8beefd960c Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 12:57:21 +0000 Subject: [PATCH 22/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/about.json b/content/pages/about.json index 03f6238..ce7194e 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1 +1 @@ -{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n","section1":"## Hello World!\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.\n","section2":"## This is a skinny center-aligned {'\\'}\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

\n"} \ No newline at end of file +{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n","section1":"## Hello World!\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.\n","section2":"## This is a skinny center-aligned \n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

\n"} \ No newline at end of file From 85cce0a28f65efe3205ffd83eaeeab96689bc3cc Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 12:58:16 +0000 Subject: [PATCH 23/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Chome-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/home.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/home.json b/content/pages/home.json index c64af19..387f25c 100644 --- a/content/pages/home.json +++ b/content/pages/home.json @@ -1 +1 @@ -{"title":"Home","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n\n* **Create React App** for simplicity\n* **Styled Components** for component-based css\n* **React Router** for routing (v4)\n* **React Helmet** for document titles, descriptions, meta\n* **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️\n* [**Netlify CMS**](https://netlifycms.org)"} \ No newline at end of file +{"title":"Home","subtitle":"","body":"# 🍉 HyperStatic\n\nA not-so-static site boilerplate:\n\n* **Create React App** for simplicity\n* **Styled Components** for component-based css\n* **React Router** for routing (v4)\n* **React Helmet** for document titles, descriptions, meta\n* **React Snapshot** for pre-rendering to static html so it works without Javascript ⭐️\n* [**Netlify CMS**](https://netlifycms.org)"} \ No newline at end of file From 2caf96afbf118fb6c7e925b2e48ec5bf608667f8 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Fri, 13 Oct 2017 23:01:30 +1000 Subject: [PATCH 24/61] Integrate extra content and fields --- public/admin/config.yml | 11 +++++++++++ public/admin/index.html | 4 ++-- src/views/About.js | 8 ++++---- src/views/Contact.js | 14 +------------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/public/admin/config.yml b/public/admin/config.yml index 1ed2dc9..5f76acd 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -15,10 +15,21 @@ collections: # A list of collections the CMS should be able to edit name: "home-page" fields: - {label: Title, name: title, widget: string} + - {label: Subtitle, name: subtitle, widget: string} - {label: Body, name: body, widget: markdown} - file: "content/pages/about.json" label: "About Page" name: "about-page" fields: - {label: Title, name: title, widget: string} + - {label: Subtitle, name: subtitle, widget: string} + - {label: Body, name: body, widget: markdown} + - {label: Section 1, name: section1, widget: markdown} + - {label: Section 2, name: section2, widget: markdown} + - file: "content/pages/contact.json" + label: "Contact Page" + name: "contact-page" + fields: + - {label: Title, name: title, widget: string} + - {label: Subtitle, name: subtitle, widget: string} - {label: Body, name: body, widget: markdown} diff --git a/public/admin/index.html b/public/admin/index.html index 1ef4650..76c205b 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -6,12 +6,12 @@ Content Manager - + - + diff --git a/src/views/About.js b/src/views/About.js index 13ee661..ac1406e 100644 --- a/src/views/About.js +++ b/src/views/About.js @@ -1,5 +1,7 @@ import React from 'react' import Helmet from 'react-helmet' +import Marked from 'react-markdown' + import Page from '../components/Page' import PageHeader from '../components/PageHeader' import { Container, Section } from '../components/common' @@ -12,14 +14,12 @@ export default ({ page }) => (
-

Hello World!

-

A sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

+
-

This is a skinny center-aligned {''}

-

A sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

+
diff --git a/src/views/Contact.js b/src/views/Contact.js index f38e18c..9025dd5 100644 --- a/src/views/Contact.js +++ b/src/views/Contact.js @@ -6,24 +6,12 @@ import NetlifyForm from '../components/NetlifyForm' import { Container, Section } from '../components/common' import Marked from 'react-markdown' -const content = ` - # Example contact form - - This form is setup to use Netlify's form handling: - - - the form action is set to the current absolute url: \`action: '/contact/'\` - - a name attribute is sent with the form's data \`'form-name': 'Contact'\` - - netlify data attributes are added to the form \`data-netlify data-netlify-honeypot\` - - Find out more in the [Netlify Docs](https://www.netlify.com/docs/form-handling/). -` - export default ({ page }) => (
- +

{''}

From 55f6b81b56a79b904e42471ddabff4137c914324 Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 13:04:27 +0000 Subject: [PATCH 25/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Ccontact-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/contact.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/contact.json b/content/pages/contact.json index bf3a0ba..7f9736c 100644 --- a/content/pages/contact.json +++ b/content/pages/contact.json @@ -1 +1 @@ -{"title":"Contact","subtitle":"","body":"# Example contact form\n\nThis form is setup to use Netlify's form handling:\n\n- the form action is set to the current absolute url: \\`action: '/contact/'\\`\n- a name attribute is sent with the form's data \\`'form-name': 'Contact'\\`\n- netlify data attributes are added to the form \\`data-netlify data-netlify-honeypot\\`\n\nFind out more in the [Netlify Docs](https://www.netlify.com/docs/form-handling/).\n"} \ No newline at end of file +{"title":"Contact","subtitle":"","body":"# Example contact form\n\nThis form is setup to use Netlify's form handling:\n\n- the form action is set to the current absolute url: `action: '/contact/'`\n- a name attribute is sent with the form's data `'form-name': 'Contact'`\n- netlify data attributes are added to the form `data-netlify data-netlify-honeypot`\n\nFind out more in the [Netlify Docs](https://www.netlify.com/docs/form-handling/).\n"} \ No newline at end of file From ff7dc18f4ac12ff32b1d72dd64a3e572a1e5086f Mon Sep 17 00:00:00 2001 From: ericjinks Date: Fri, 13 Oct 2017 13:10:07 +0000 Subject: [PATCH 26/61] =?UTF-8?q?Update=20Pages=20=E2=80=9Cabout-page?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/pages/about.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/about.json b/content/pages/about.json index ce7194e..e1c16ea 100644 --- a/content/pages/about.json +++ b/content/pages/about.json @@ -1 +1 @@ -{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n","section1":"## Hello World!\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.\n","section2":"## This is a skinny center-aligned \n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.

\n"} \ No newline at end of file +{"title":"About page title","subtitle":"","body":"#### This is the about page body!\n\n`inline-code`\n","section1":"## Hello World!\n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum.\n","section2":"## This is a skinny center-aligned \n\nA sem vel nec sodales mi vivamus senectus sed potenti a parturient nascetur tincidunt nisi pulvinar rhoncus a. Risus imperdiet taciti suspendisse facilisi a per metus cubilia varius a nostra adipiscing amet ultrices quisque ac mi a. Dictumst a ultrices mi a dignissim ad fermentum eget a nam et a blandit scelerisque. Taciti lorem tempor quam vestibulum dis habitasse vestibulum diam vel est ut proin dis auctor. Suscipit scelerisque orci magna interdum vel bibendum duis netus a consectetur dui magnis ac aliquet sem posuere tincidunt vestibulum."} \ No newline at end of file From 7a6d9dd223383ca77187d97f2930ee7113b81474 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Sat, 14 Oct 2017 11:26:26 +1000 Subject: [PATCH 27/61] Improve netlifyIdentity process --- package.json | 1 + public/admin/index.html | 11 +++++++++-- src/index.js | 1 + src/netlifyIdentity.js | 12 ++++++++++++ yarn.lock | 4 ++++ 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/netlifyIdentity.js diff --git a/package.json b/package.json index 5be0319..93edce7 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "yamljs": "^0.3.0" }, "dependencies": { + "netlify-identity-widget": "^1.2.0", "polished": "^1.2.1", "react": "^16.0.0", "react-dom": "^16.0.0", diff --git a/public/admin/index.html b/public/admin/index.html index 76c205b..02a110f 100644 --- a/public/admin/index.html +++ b/public/admin/index.html @@ -6,12 +6,19 @@ Content Manager - + - + + + diff --git a/src/index.js b/src/index.js index b34a9f7..841aab3 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import React from 'react' import { render } from 'react-snapshot' import App from './App' import registerServiceWorker from './registerServiceWorker' +import './netlifyIdentity' const rootEl = document.getElementById('root') render(, rootEl) diff --git a/src/netlifyIdentity.js b/src/netlifyIdentity.js new file mode 100644 index 0000000..39f6ba8 --- /dev/null +++ b/src/netlifyIdentity.js @@ -0,0 +1,12 @@ +import netlifyIdentity from 'netlify-identity-widget' + +// check for netlifyIdentity, redirect to admin if user is logging in +netlifyIdentity.on('init', user => { + if (!user) { + netlifyIdentity.on('login', () => { + document.location.href = '/admin/' + }) + } +}) + +netlifyIdentity.init() diff --git a/yarn.lock b/yarn.lock index 90ffb4d..4599b91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4956,6 +4956,10 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" +netlify-identity-widget@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/netlify-identity-widget/-/netlify-identity-widget-1.2.0.tgz#c3cb2498b3550fae4deb133de17ff6a3b2cb6ebf" + no-case@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081" From 522b9a694d4b536a943fe06227d4469b374ea5ba Mon Sep 17 00:00:00 2001 From: Jinksi Date: Sat, 14 Oct 2017 11:34:41 +1000 Subject: [PATCH 28/61] Dynamically import netlifyIdentity --- src/App.js | 1 + src/index.js | 1 - src/netlifyIdentity.js | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 607872f..ac45eaa 100644 --- a/src/App.js +++ b/src/App.js @@ -19,6 +19,7 @@ export const siteTitle = 'HyperStatic' class App extends Component { componentWillMount () { globalStyles() + import('./netlifyIdentity') } render () { diff --git a/src/index.js b/src/index.js index 841aab3..b34a9f7 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,6 @@ import React from 'react' import { render } from 'react-snapshot' import App from './App' import registerServiceWorker from './registerServiceWorker' -import './netlifyIdentity' const rootEl = document.getElementById('root') render(, rootEl) diff --git a/src/netlifyIdentity.js b/src/netlifyIdentity.js index 39f6ba8..6022436 100644 --- a/src/netlifyIdentity.js +++ b/src/netlifyIdentity.js @@ -9,4 +9,6 @@ netlifyIdentity.on('init', user => { } }) -netlifyIdentity.init() +if (window.localStorage) { + netlifyIdentity.init() +} From be70f3e1a1b97d737d60d0686362bf302202c5c1 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Sat, 14 Oct 2017 15:10:47 +1000 Subject: [PATCH 29/61] Remove unused deps --- package.json | 10 +- yarn.lock | 404 +-------------------------------------------------- 2 files changed, 6 insertions(+), 408 deletions(-) diff --git a/package.json b/package.json index 93edce7..5c8c7f0 100644 --- a/package.json +++ b/package.json @@ -14,17 +14,9 @@ "eslint-plugin-standard": "^3.0.1", "glob": "^7.1.2", "react-scripts": "^1.0.10", - "remark": "^8.0.0", - "remark-frontmatter": "^1.1.0", - "remark-html": "^6.0.1", - "remark-parse": "^4.0.0", "snazzy": "^7.0.0", "standard": "^10.0.2", - "sw-precache": "^5.2.0", - "to-vfile": "^2.1.2", - "unified": "^6.1.5", - "vfile-reporter": "^4.0.0", - "yamljs": "^0.3.0" + "sw-precache": "^5.2.0" }, "dependencies": { "netlify-identity-widget": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index 4599b91..9c8c0b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -235,10 +235,6 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" -array-iterate@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.1.tgz#865bf7f8af39d6b0982c60902914ac76bc0108f6" - array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" @@ -1086,10 +1082,6 @@ babylon@^6.13.0, babylon@^6.17.0, babylon@^6.17.2: version "6.17.4" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" -bail@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.2.tgz#f7d6c1731630a9f9f0d4d35ed1f962e2074a1764" - balanced-match@^0.4.1, balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -1406,10 +1398,6 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -ccount@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.2.tgz#53b6a2f815bb77b9c2871f7b9a72c3a25f1d8e89" - center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" @@ -1435,22 +1423,6 @@ chalk@^2.0.0, chalk@^2.1.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" -character-entities-html4@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50" - -character-entities-legacy@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.1.tgz#f40779df1a101872bb510a3d295e1fccf147202f" - -character-entities@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.1.tgz#f76871be5ef66ddb7f8f8e3478ecc374c27d6dca" - -character-reference-invalid@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.1.tgz#942835f750e4ec61a308e60c2ef8cc1011202efc" - chokidar@^1.6.0, chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -1546,10 +1518,6 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.3.tgz#4b906f670e5a963a87b76b0e1689643341b6023c" - color-convert@^1.0.0, color-convert@^1.3.0, color-convert@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" @@ -1592,12 +1560,6 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -comma-separated-tokens@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.4.tgz#72083e58d4a462f01866f6617f4d98a3cd3b8a46" - dependencies: - trim "0.0.1" - commander@2.9.x, commander@^2.9.0, commander@~2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -2085,12 +2047,6 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" -detab@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.1.tgz#531f5e326620e2fd4f03264a905fb3bcc8af4df4" - dependencies: - repeat-string "^1.5.4" - detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -2855,10 +2811,6 @@ express@^4.13.3, express@^4.15.2: utils-merge "1.0.0" vary "~1.1.1" -extend@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" - extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" @@ -2902,12 +2854,6 @@ fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" -fault@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.1.tgz#de8d350dfd48be24b5dc1b02867e0871b9135092" - dependencies: - format "^0.2.2" - faye-websocket@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -3095,10 +3041,6 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" -format@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" - forwarded@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" @@ -3405,36 +3347,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: dependencies: inherits "^2.0.1" -hast-util-is-element@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.0.tgz#3f7216978b2ae14d98749878782675f33be3ce00" - -hast-util-sanitize@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.1.2.tgz#d10bd6757a21e59c13abc8ae3530dd3b6d7d679e" - dependencies: - xtend "^4.0.1" - -hast-util-to-html@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-3.1.0.tgz#882c99849e40130e991c042e456d453d95c36cff" - dependencies: - ccount "^1.0.0" - comma-separated-tokens "^1.0.1" - hast-util-is-element "^1.0.0" - hast-util-whitespace "^1.0.0" - html-void-elements "^1.0.0" - kebab-case "^1.0.0" - property-information "^3.1.0" - space-separated-tokens "^1.0.0" - stringify-entities "^1.0.1" - unist-util-is "^2.0.0" - xtend "^4.0.1" - -hast-util-whitespace@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.0.tgz#bd096919625d2936e1ff17bc4df7fd727f17ece9" - hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -3531,10 +3443,6 @@ html-minifier@^3.2.3: relateurl "0.2.x" uglify-js "3.0.x" -html-void-elements@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.2.tgz#9d22e0ca32acc95b3f45b8d5b4f6fbdc05affd55" - html-webpack-plugin@2.29.0: version "2.29.0" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-2.29.0.tgz#e987f421853d3b6938c8c4c8171842e5fd17af23" @@ -3776,21 +3684,6 @@ is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" -is-alphabetical@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.1.tgz#c77079cc91d4efac775be1034bf2d243f95e6f08" - -is-alphanumeric@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" - -is-alphanumerical@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.1.tgz#dfb4aa4d1085e33bdb61c2dee9c80e9c6c19f53b" - dependencies: - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3805,10 +3698,6 @@ is-buffer@^1.0.2: version "1.1.4" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" -is-buffer@^1.1.4: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" - is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -3829,10 +3718,6 @@ is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" -is-decimal@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.1.tgz#f5fb6a94996ad9e8e3761fbfbd091f1fca8c4e82" - is-dotfile@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" @@ -3887,10 +3772,6 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-hexadecimal@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" - is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: version "2.15.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" @@ -3930,7 +3811,7 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: +is-plain-obj@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -4002,18 +3883,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -is-whitespace-character@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.1.tgz#9ae0176f3282b65457a1992cdb084f8a5f833e3b" - is-windows@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" -is-word-character@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.1.tgz#5a03fa1ea91ace8a6eb0c7cd770eb86d65c8befb" - is-wsl@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" @@ -4499,10 +4372,6 @@ jsx-ast-utils@^2.0.0: dependencies: array-includes "^3.0.3" -kebab-case@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" - kind-of@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" @@ -4677,10 +4546,6 @@ loglevel@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.5.0.tgz#3863984a2c326b986fbb965f378758a6dc8a4324" -longest-streak@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.1.tgz#42d291b5411e40365c00e63193497e2247316e35" - longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -4733,50 +4598,13 @@ map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" -markdown-escapes@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.1.tgz#1994df2d3af4811de59a6714934c2b2292734518" - -markdown-table@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.1.tgz#4b3dd3a133d1518b8ef0dbc709bf2a1b4824bc8c" - math-expression-evaluator@^1.2.14: version "1.2.15" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.15.tgz#38dc5f0194c5bf5ff1c690ad4c4b64df71ac0187" dependencies: lodash.indexof "^4.0.5" -mdast-util-compact@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz#cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a" - dependencies: - unist-util-modify-children "^1.0.0" - unist-util-visit "^1.1.0" - -mdast-util-definitions@^1.2.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.2.tgz#673f4377c3e23d3de7af7a4fe2214c0e221c5ac7" - dependencies: - unist-util-visit "^1.0.0" - -mdast-util-to-hast@^2.1.1: - version "2.5.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.5.0.tgz#f087844d255c7540f36906da30ba106c0ee5ee2f" - dependencies: - collapse-white-space "^1.0.0" - detab "^2.0.0" - mdast-util-definitions "^1.2.0" - mdurl "^1.0.1" - trim "0.0.1" - trim-lines "^1.0.0" - unist-builder "^1.0.1" - unist-util-generated "^1.1.0" - unist-util-position "^3.0.0" - unist-util-visit "^1.1.0" - xtend "^4.0.1" - -mdurl@^1.0.1, "mdurl@~ 1.0.1": +"mdurl@~ 1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" @@ -5279,17 +5107,6 @@ parse-asn1@^5.0.0: evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" -parse-entities@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.1.tgz#8112d88471319f27abae4d64964b122fe4e1b890" - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -5841,10 +5658,6 @@ prop-types@^15.6.0: loose-envify "^1.3.1" object-assign "^4.1.1" -property-information@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.2.0.tgz#fd1483c8fbac61808f5fe359e7693a1f48a58331" - proxy-addr@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.4.tgz#27e545f6960a44a627d9b44467e35c1b6b4ce2f3" @@ -6303,69 +6116,6 @@ relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" -remark-frontmatter@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-1.1.0.tgz#9d23c2b376f56617bdb5c5560f1b56e45b19788b" - dependencies: - fault "^1.0.1" - xtend "^4.0.1" - -remark-html@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.1.tgz#5094d2c71f7941fdb2ae865bac76627757ce09c1" - dependencies: - hast-util-sanitize "^1.0.0" - hast-util-to-html "^3.0.0" - mdast-util-to-hast "^2.1.1" - xtend "^4.0.1" - -remark-parse@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-4.0.0.tgz#99f1f049afac80382366e2e0d0bd55429dd45d8b" - dependencies: - collapse-white-space "^1.0.2" - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - is-word-character "^1.0.0" - markdown-escapes "^1.0.0" - parse-entities "^1.0.2" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - trim "0.0.1" - trim-trailing-lines "^1.0.0" - unherit "^1.0.4" - unist-util-remove-position "^1.0.0" - vfile-location "^2.0.0" - xtend "^4.0.1" - -remark-stringify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-4.0.0.tgz#4431884c0418f112da44991b4e356cfe37facd87" - dependencies: - ccount "^1.0.0" - is-alphanumeric "^1.0.0" - is-decimal "^1.0.0" - is-whitespace-character "^1.0.0" - longest-streak "^2.0.1" - markdown-escapes "^1.0.0" - markdown-table "^1.1.0" - mdast-util-compact "^1.0.0" - parse-entities "^1.0.2" - repeat-string "^1.5.4" - state-toggle "^1.0.0" - stringify-entities "^1.0.1" - unherit "^1.0.4" - xtend "^4.0.1" - -remark@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-8.0.0.tgz#287b6df2fe1190e263c1d15e486d3fa835594d6d" - dependencies: - remark-parse "^4.0.0" - remark-stringify "^4.0.0" - unified "^6.0.0" - renderkid@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.0.tgz#1859753e7a5adbf35443aba0d4e4579e78abee85" @@ -6380,7 +6130,7 @@ repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" -repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: +repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -6390,10 +6140,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -replace-ext@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" - request@^2.55.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -6814,12 +6560,6 @@ source-map@~0.2.0: dependencies: amdefine ">=0.0.4" -space-separated-tokens@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.1.tgz#9695b9df9e65aec1811d4c3f9ce52520bc2f7e4d" - dependencies: - trim "0.0.1" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -6905,10 +6645,6 @@ standard@^10.0.2: eslint-plugin-standard "~3.0.1" standard-engine "~7.0.0" -state-toggle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" - "statuses@>= 1.3.1 < 2", statuses@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" @@ -6940,7 +6676,7 @@ string-length@^1.0.1: dependencies: strip-ansi "^3.0.0" -string-width@^1.0.0, string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -6976,15 +6712,6 @@ string_decoder@~1.0.0: dependencies: safe-buffer "^5.0.1" -stringify-entities@^1.0.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.1.tgz#b150ec2d72ac4c1b5f324b51fb6b28c9cdff058c" - dependencies: - character-entities-html4 "^1.0.0" - character-entities-legacy "^1.0.0" - is-alphanumerical "^1.0.0" - is-hexadecimal "^1.0.0" - stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -7070,7 +6797,7 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" -supports-color@^4.1.0, supports-color@^4.2.1, supports-color@^4.4.0: +supports-color@^4.2.1, supports-color@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" dependencies: @@ -7231,13 +6958,6 @@ to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" -to-vfile@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-2.1.2.tgz#63f410e3b72937be84e8198961caf74be2da4388" - dependencies: - is-buffer "^1.1.4" - vfile "^2.0.0" - toposort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.2.tgz#be1de72431320fcefe35a7b539c1c336cbcfd32c" @@ -7252,10 +6972,6 @@ tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" -trim-lines@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.0.tgz#9926d03ede13ba18f7d42222631fb04c79ff26fe" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -7264,18 +6980,6 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -trim-trailing-lines@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684" - -trim@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" - -trough@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.1.tgz#a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86" - tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" @@ -7360,25 +7064,6 @@ uid-number@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" -unherit@^1.0.4: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.0.tgz#6b9aaedfbf73df1756ad9e316dd981885840cd7d" - dependencies: - inherits "^2.0.1" - xtend "^4.0.1" - -unified@^6.0.0, unified@^6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.5.tgz#716937872621a63135e62ced2f3ac6a063c6fb87" - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-plain-obj "^1.1.0" - trough "^1.0.0" - vfile "^2.0.0" - x-is-function "^1.0.4" - x-is-string "^0.1.0" - uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" @@ -7393,44 +7078,6 @@ uniqs@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" -unist-builder@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-1.0.2.tgz#8c3b9903ef64bcfb117dd7cf6a5d98fc1b3b27b6" - dependencies: - object-assign "^4.1.0" - -unist-util-generated@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.1.tgz#99f16c78959ac854dee7c615c291924c8bf4de7f" - -unist-util-is@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.1.tgz#0c312629e3f960c66e931e812d3d80e77010947b" - -unist-util-modify-children@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.1.tgz#66d7e6a449e6f67220b976ab3cb8b5ebac39e51d" - dependencies: - array-iterate "^1.0.0" - -unist-util-position@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.0.0.tgz#e6e1e03eeeb81c5e1afe553e8d4adfbd7c0d8f82" - -unist-util-remove-position@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz#5a85c1555fc1ba0c101b86707d15e50fa4c871bb" - dependencies: - unist-util-visit "^1.1.0" - -unist-util-stringify-position@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" - -unist-util-visit@^1.0.0, unist-util-visit@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.3.tgz#ec268e731b9d277a79a5b5aa0643990e405d600b" - universalify@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" @@ -7559,32 +7206,6 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" -vfile-location@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.2.tgz#d3675c59c877498e492b4756ff65e4af1a752255" - -vfile-reporter@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-4.0.0.tgz#ea6f0ae1342f4841573985e05f941736f27de9da" - dependencies: - repeat-string "^1.5.0" - string-width "^1.0.0" - supports-color "^4.1.0" - unist-util-stringify-position "^1.0.0" - vfile-statistics "^1.1.0" - -vfile-statistics@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.0.tgz#02104c60fdeed1d11b1f73ad65330b7634b3d895" - -vfile@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.2.0.tgz#ce47a4fb335922b233e535db0f7d8121d8fced4e" - dependencies: - is-buffer "^1.1.4" - replace-ext "1.0.0" - unist-util-stringify-position "^1.0.0" - vm-browserify@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" @@ -7816,14 +7437,6 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -x-is-function@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" - -x-is-string@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" - xdg-basedir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz#edbc903cc385fc04523d966a335504b5504d1bd2" @@ -7854,13 +7467,6 @@ yallist@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4" -yamljs@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.3.0.tgz#dc060bf267447b39f7304e9b2bfbe8b5a7ddb03b" - dependencies: - argparse "^1.0.7" - glob "^7.0.5" - yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" From c3c3d0c5399cca3cdb8c7aa437cabb822c7d8bb5 Mon Sep 17 00:00:00 2001 From: Jinksi Date: Sat, 14 Oct 2017 15:32:14 +1000 Subject: [PATCH 30/61] Update parse-content to return arrays per collection --- utils/parse-content.js | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/utils/parse-content.js b/utils/parse-content.js index eba261a..b7713c6 100644 --- a/utils/parse-content.js +++ b/utils/parse-content.js @@ -1,7 +1,8 @@ const fs = require('fs') const path = require('path') const _set = require('lodash/set') -const _merge = require('lodash/merge') +const _mergeWith = require('lodash/mergeWith') +const _isArray = require('lodash/isArray') const globCb = require('glob') const util = require('util') @@ -13,32 +14,46 @@ const options = { outputFile: './src/data.json' } -const getNestedKey = filePath => { +const getCollectionType = filePath => { const pathParsed = path.parse(filePath) const objectKey = pathParsed.dir.replace(options.contentDir, '').replace(/\//g, '.') - return `${objectKey}.${pathParsed.name}` + return `${objectKey}` } -const getFileContents = filePath => - readFile(filePath, 'utf8') +const getDocumentKey = filePath => { + const pathParsed = path.parse(filePath) + return `${pathParsed.name}` +} + +const getFileContents = filePath => { + return readFile(filePath, 'utf8') .then(data => { let obj = {} - _set(obj, getNestedKey(filePath), JSON.parse(data)) + let documentData = { + [getDocumentKey(filePath)]: JSON.parse(data) + } + _set(obj, getCollectionType(filePath), [documentData]) + console.log(`✨ Processed ${filePath}`) return obj }) +} const readFiles = async paths => Promise.all(paths.map(getFileContents)) const combineJSON = async () => { + // mergeCustomiser concats arrays items + const mergeCustomiser = (objValue, srcValue) => _isArray(objValue) ? objValue.concat(srcValue) : objValue + console.log(`✨ Reading JSON files in ${options.contentDir}`) const paths = await glob(`${options.contentDir}/**/**.json`) const results = await readFiles(paths) - const data = _merge({}, ...results) + const data = _mergeWith({}, ...results, mergeCustomiser) return JSON.stringify(data, null, 2) } const writeJSON = async () => { const json = await combineJSON() fs.writeFileSync(options.outputFile, json) + console.log(`✅ Data saved to ${options.outputFile}`) } writeJSON() From 0b9b8b74108bf1d3fb972d546a2dd63446cb28ce Mon Sep 17 00:00:00 2001 From: Jinksi Date: Sat, 14 Oct 2017 16:04:09 +1000 Subject: [PATCH 31/61] Refactor content parse --- {utils => functions}/parse-content.js | 7 ++- package.json | 2 +- src/App.js | 16 +++++-- utils/parse-markdown.js | 61 --------------------------- 4 files changed, 16 insertions(+), 70 deletions(-) rename {utils => functions}/parse-content.js (92%) delete mode 100644 utils/parse-markdown.js diff --git a/utils/parse-content.js b/functions/parse-content.js similarity index 92% rename from utils/parse-content.js rename to functions/parse-content.js index b7713c6..72778ac 100644 --- a/utils/parse-content.js +++ b/functions/parse-content.js @@ -20,7 +20,7 @@ const getCollectionType = filePath => { return `${objectKey}` } -const getDocumentKey = filePath => { +const getDocumentName = filePath => { const pathParsed = path.parse(filePath) return `${pathParsed.name}` } @@ -28,10 +28,9 @@ const getDocumentKey = filePath => { const getFileContents = filePath => { return readFile(filePath, 'utf8') .then(data => { + let documentData = JSON.parse(data) + documentData.name = getDocumentName(filePath) let obj = {} - let documentData = { - [getDocumentKey(filePath)]: JSON.parse(data) - } _set(obj, getCollectionType(filePath), [documentData]) console.log(`✨ Processed ${filePath}`) return obj diff --git a/package.json b/package.json index 5c8c7f0..1adb2d3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "scripts": { "start": "npm run parse-content && react-scripts start", "build": "npm run parse-content && react-scripts build && react-snapshot && npm run sw", - "parse-content": "node ./utils/parse-content.js", + "parse-content": "node ./functions/parse-content.js", "sw": "sw-precache --config='sw-precache-config.js'", "test": "standard | snazzy && react-scripts test --env=jsdom", "eject": "react-scripts eject" diff --git a/src/App.js b/src/App.js index ac45eaa..95e9289 100644 --- a/src/App.js +++ b/src/App.js @@ -11,17 +11,25 @@ import Nav from './components/Nav' import GithubCorner from './components/GithubCorner' import ServiceWorkerNotifications from './components/ServiceWorkerNotifications' import globalStyles from './globalStyles' - import data from './data.json' export const siteTitle = 'HyperStatic' class App extends Component { + state = { + data + } + componentWillMount () { globalStyles() import('./netlifyIdentity') } + getDocument = (collection, name) => + this.state.data[collection] && this.state.data[collection].filter(page => page.name === name)[0] + + getDocuments = (collection) => this.state.data[collection] + render () { return ( @@ -33,13 +41,13 @@ class App extends Component {