Coder Social home page Coder Social logo

Comments (7)

rafgraph avatar rafgraph commented on August 17, 2024 1

Fixed. Just set pathPrefix to true here and it will work with Project Pages sites not using a custom domain. Also updated the readme, so check that out for more info.

Let me know if you have any issues with this.

from spa-github-pages.

rafgraph avatar rafgraph commented on August 17, 2024 1

Just got confirmation from GitHub support that GitHub Pages now serves a custom 404 page for Project Pages sites without using a custom domain (GitHub docs are outdated and will be updated).

from spa-github-pages.

rafgraph avatar rafgraph commented on August 17, 2024

If it's a project pages site, then you have to use a custom domain in order for GitHub Pages to serve a custom 404 page. I talk a bit about how to set this up in the instructions with links to GitHub docs.

from spa-github-pages.

websemantics avatar websemantics commented on August 17, 2024

Thanks for your reply,

When I first used the code, I had all the url after the main domain, for example, https://username.github.io/repo/foo turned into query-string >> https://username.github.io?p=repo/foo, this didn't work well for Project Pages where the repo name should stay, .. I might be missing on something here,

from spa-github-pages.

rafgraph avatar rafgraph commented on August 17, 2024

You're right, but it's a moot point because you must use a custom domain for GitHub Pages to serve a custom 404 page for a Project Pages site, see here, and the custom domain won't have /repo at the beginning of the path.

I did a few tests this morning and it appears that GitHub Pages now serves a custom 404 page for Project Pages sites without using a custom domain (despite the docs still indicating the opposite). I'll reopen the issue and update the redirect scripts. Thanks for the heads up @websemantics.

Also, don't forget to include author cred along with my code in ghspa.js.

from spa-github-pages.

websemantics avatar websemantics commented on August 17, 2024

I never read the docs, ignorance -sometimes- is a bless hh

I already had a link to your repo in the original README.md and now clearly in ghspa.js,

The only added contribution I had was the switch between Project Pages and User/Org pages which your library now supports too,

I also had it packaged as Bower/Node package, and the setup/steps are slightly easier to follow (maybe),

  • Include ghspa.js in index.html and 404.html
  • Set the title of 404.html to 404
  • Done,

If you could probably make it as such, I really don't need that repo,

Thanks @RAFREX for the original contribution,

from spa-github-pages.

websemantics avatar websemantics commented on August 17, 2024

Oh, and a really fancy demo page which took way longer to build than writing code hhh

from spa-github-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.