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 mode: history on the vue-router by using a SPA hack for Github Pages #393

Closed
wants to merge 1 commit into from

Conversation

zebateira
Copy link
Contributor

@zebateira zebateira commented Feb 21, 2020

This PR implements a hack that enables non-hashing routing to github-pages-powered websites. It's working locally in dev and production mode.

Hack can be found here: https://github.com/rafrex/spa-github-pages

SEO Note from the repo:

A quick SEO note - while it's never good to have a 404 response, it appears based on Search Engine Land's testing that Google's crawler will treat the JavaScript window.location redirect in the 404.html file the same as a 301 redirect for its indexing. From my testing I can confirm that Google will index all pages without issue, the only caveat is that the redirect query is what Google indexes as the url. For example, the url example.tld/about will get indexed as example.tld/?p=/about. When the user clicks on the search result, the url will change back to example.tld/about once the site loads.

closes #388, #105
Will enable us to start working on: #258

@zebateira zebateira added the enhancement New feature or request label Feb 21, 2020
@zebateira zebateira changed the title Use mode: history on the vue-router by using a SPA hack for Github Pages WIP: Use mode: history on the vue-router by using a SPA hack for Github Pages Feb 21, 2020
@zebateira zebateira force-pushed the fix/routes-mode-history branch 2 times, most recently from 0a4bc0e to ba4b2a6 Compare February 21, 2020 12:23
@zebateira zebateira changed the title WIP: Use mode: history on the vue-router by using a SPA hack for Github Pages Use mode: history on the vue-router by using a SPA hack for Github Pages Feb 21, 2020
@zebateira zebateira force-pushed the fix/routes-mode-history branch from 5da1e88 to 90bd5d0 Compare February 24, 2020 13:35
@zebateira
Copy link
Contributor Author

Let's revisit this later when we can say for sure all the implications of this are tackled.
For now the main issue to fix is the 404 Github page.

@zebateira zebateira closed this Feb 25, 2020
@zebateira zebateira deleted the fix/routes-mode-history branch February 27, 2020 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Loading GitHub default 404
1 participant