Skip to content

Commit

Permalink
Merge pull request #5675 from storybooks/shilman/5667-deploy-versions…
Browse files Browse the repository at this point in the history
…-json

Use static versions.json file instead of hacking one in
  • Loading branch information
shilman committed Feb 20, 2019
2 parents 57e9190 + 4f75eb8 commit a49b6d0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions docs/gatsby-node.js
Expand Up @@ -3,7 +3,6 @@
const fs = require('fs');
const path = require('path');
const sm = require('sitemap');
const stripIndent = require('common-tags/lib/stripIndent');

function pagesToSitemap(pages) {
return pages
Expand All @@ -24,26 +23,6 @@ function generateSitemap(pages) {
fs.writeFileSync(`${__dirname}/public/sitemap.xml`, sitemap.toString());
}

const generateVersionsFile = () => {
// TODO: hard-coded for now
// must be generated from pr-log / CHANGELOG.md
const data = {
latest: {
version: '4.0.0',
info: {
plain: stripIndent`
- upgrade webpack & babel to latest
- new addParameters and third argument to .add to pass data to addons
- added the ability to theme storybook
- improved ui for mobile devices
- improved performance of addon-knobs
`,
},
},
};
fs.writeFileSync(`${__dirname}/public/versions.json`, JSON.stringify(data));
};

module.exports = {
async onPostBuild({ graphql }) {
const result = await graphql(`
Expand All @@ -57,7 +36,6 @@ module.exports = {
}
}
`);
generateVersionsFile();
generateSitemap(result.data.allSitePage.edges.map(({ node }) => node));
},
onCreateNode({ node, boundActionCreators, getNode }) {
Expand Down
File renamed without changes.

0 comments on commit a49b6d0

Please sign in to comment.