question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues porting existing website with Gatsby

See original GitHub issue

Summary

Basically I have a set up where I have my own index.html page and I use Gatsby to create blog. Since the index.html page is really complicated, rather than try to migrate it’s code to react, I would prefer to have a set up where the ‘/’ routes by default to my index.html page while the Gatsby page/index.js is mapped to ‘/blog’. How can I accomplish this? Is it possible to have Gatby’s index.js map to some other html page like blog.html or something like that?

File contents (if changed)

gatsby-config.js: N/A package.json: N/A gatsby-node.js: N/A gatsby-browser.js: N/A gatsby-ssr.js: N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
und3fined-v01dcommented, May 24, 2020

Ohhhh I see there has been a feature request on it but was held back on the pretext that the maintenance for something this trivial would not be worth it! Thank you so much @herecydev, I think your suggestion is the best way out 😁. I’ll close this issue now!

0reactions
herecydevcommented, May 24, 2020

I see what you’re trying to do, when you use the pathPrefix gatsby will build all the content into the public folder without the blog prefix but will make the links work correctly, e.g. <Link to="/my-first-blog" /> => <Link to="/blog/my-first-blog" />

I think an easy way forward is to:

  1. Build the gatsby blog stuff first
  2. Move all the files to /blog
  3. Add your static index.html to the root
  4. Deploy all that to netlify

Hope that makes sense

Read more comments on GitHub >

github_iconTop Results From Across the Web

Porting to Gatsby
These guides cover the various scenarios in which you may want to convert a web project to Gatsby. There are other possibilities as...
Read more >
Migrating My Gatsby Site to Glitch
So I change the start command in package.json to Gatsby develop --port 3000 . Now a page loads...but nothing is there.
Read more >
How to Migrate WordPress Site to Gatsby without Losing ...
Thankfully, Gatsby makes the reception of other platforms' content fairly easy. The first thing you will need to transfer your content is a...
Read more >
What it's like to migrate a high-traffic website from Gatsby to ...
Building the site was slow · Dealing with images was challenging · Updating the site required too much understanding of Gatsby's underlying ...
Read more >
How to Migrate Your Blog from Gatsby to Next.js
What is excellent about Gatsby is that you can jump-start a website with a couple of commands in your terminal. There is no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found