jamesknelson / create-react-blog

Start and deploy your own statically rendered blog with create-react-app
https://create-react-blog.netlify.com/
MIT License
550 stars 69 forks source link

Docs on mounting blog under a path like /blog #11

Open jamesknelson opened 5 years ago

jamesknelson commented 5 years ago

Often times you'll want the blog to be mounted not at the root path, but under a path like blog.

To do this, there are a couple options:

  1. If mounting the blog in an app using Navi, you can just pass the blog's routes object to the parent up using its root mount: mount({ '/blog': blogRoutes })
  2. You can use the basename prop and PUBLIC_URL to build the blog so that it can be mounted under a non-root URL

Would appreciate any help on writing these docs, as it's not something I've done with create-react-blog, although I know other users are doing so.

einsmein commented 4 years ago

@jamesknelson I've done it by changing the root mount, but couldn't figure out how to do it with the second option. Do you have any example on how that works? I can probably write the docs for that.

sviho commented 4 years ago

Hey @jamesknelson did you have any success with this? I am very confused on how to do it, I keep getting a 404 error whenever I change the routes. I'm doing it in multiple places, should I do it in just one place?