Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static versions.json file instead of hacking one in #5675

Merged
merged 1 commit into from Feb 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.