Build and deploy demo
- Ignore public page - Add netlify.toml - Add build:demo script
This commit is contained in:
parent
e260c5b53d
commit
f35450130a
|
@ -1,4 +1,5 @@
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
node_modules
|
node_modules
|
||||||
|
public
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
.nyc_output
|
.nyc_output
|
||||||
coverage
|
coverage
|
||||||
|
public
|
||||||
tap-snapshots
|
tap-snapshots
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env node
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const { render } = require('..')
|
||||||
|
const resume = require('../resume.json')
|
||||||
|
|
||||||
|
const dest = path.resolve(__dirname, '../public');
|
||||||
|
const html = render(resume)
|
||||||
|
|
||||||
|
fs.mkdirSync(dest, { recursive: true })
|
||||||
|
fs.writeFileSync(path.resolve(dest, 'index.html'), html)
|
|
@ -0,0 +1,3 @@
|
||||||
|
[build]
|
||||||
|
command = "npm run build:example"
|
||||||
|
publish = "public"
|
|
@ -18,6 +18,7 @@
|
||||||
"style.css"
|
"style.css"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"build:demo": "./bin/build-demo",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"test": "tap"
|
"test": "tap"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const { test } = require('tap')
|
const { test } = require('tap')
|
||||||
|
|
||||||
const { render } = require('..')
|
const { render } = require('..')
|
||||||
const resume = require('./resume.json')
|
const resume = require('../resume.json')
|
||||||
|
|
||||||
test('renders a resume', t => {
|
test('renders a resume', t => {
|
||||||
t.matchSnapshot(render(resume))
|
t.matchSnapshot(render(resume))
|
||||||
|
|
Loading…
Reference in New Issue