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

Generating a sitemap #12

Closed
johnbrett opened this issue Jul 24, 2015 · 6 comments
Closed

Generating a sitemap #12

johnbrett opened this issue Jul 24, 2015 · 6 comments

Comments

@johnbrett
Copy link
Contributor

Any advice on where to start on generating sitemap either during gatsby serve or build ?

Thinking of using gatsby for my blog: https://johnbrett.me/

@KyleAMathews
Copy link
Contributor

If you add a post-build file in the root of your site, you can do custom stuff like generate a sitemap and rss/atom feed.

https://github.com/gatsbyjs/gatsby/blob/master/lib/utils/build.coffee#L30

See my personal blog where I generate an Atom feed https://github.com/KyleAMathews/blog/blob/master/post-build.coffee

You're in node.js context here so you can write files to disk etc.

@johnbrett
Copy link
Contributor Author

Worked perfectly. Cheers for the responsiveness.

@ivanoats
Copy link
Contributor

JSYK I have a gist here with how to make a sitemap: https://gist.github.com/ivanoats/8d01d9e934fdc17bae9090147f1e799b

@chiedo
Copy link

chiedo commented Sep 15, 2016

I had to modify your work @ivanoats to the following to get it to work for me without setting up babel, etc. and rolling straight off a Gatsby starter template. Thanks for the foundation though!

https://gist.github.com/chiedo/cd1e88ba3db440eb1f44fa6aaf8c3bd5

@ivanoats
Copy link
Contributor

Nice. FWIW I wasn't using babel, just node 6 😎

@chiedo
Copy link

chiedo commented Sep 15, 2016

Ahhh, that's makes sense @ivanoats :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants