-
Notifications
You must be signed in to change notification settings - Fork 27
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
[FEATURE] Add custom error page #29
Comments
Clearing assignee in case someone else wants to give this a stab. If anyone starts development, please post a comment here to discuss approach (and look of the 404 page) 🙂 |
@VeckoTheGecko Any ideas on what we may want the page to look like? I can create a standard error page that will give a standard response. It's as simple as creating a |
Updated title to match. The site at the moment doesn't yet have a unified style (#70), so I'm not particular about the look of the error page. If you want to design something with CSS, then somewhat fitting within the general themes of the site (climate, knowledge) and having it look good would be the only requirements. Having the simple error page you've already implemented is a great addition anyway, and enough to close this issue. Just know if you do a custom CSS design that someone working on #70 may redo the page as part of the site redesign. |
Hmm. I'm not sure if this is working after merging #171 @tutterown? |
It looks like it may be because Svelte and Github Pages use two different methods of producing an error page. Svelte looks for It seems that Github Pages takes priority, so I would assume we can design this by using Github Pages method rather than Svelte. It may be a few days before I'm able to do this. |
Hmmm. In the build process all Svelte pages get converted to HTML, so a I'll check the build process to ensure an error page is created. It might be something to do with it being served from https://climatetown.github.io/knowledge-hub and not a root domain. |
An conclusive investigation? A preliminary search led me to this Stackoverflow answer from 2013 mentioning that 404s can only be served from root domains. Given the age of this article, and the fact that there is no mention on this is the current custom 404 help article leads me to believe that this is no longer an issue. Instead, I think the source of the issue is in how Svelte Kit renders the static site. Using From our config: const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
- fallback: null,
+ fallback: "404.html",
precompress: false
}),
alias: { 'lib/': './src/lib/' },
prerender: {
entries: ['*']
},
paths: {
base: dev ? '' : '/knowledge-hub',
},
}
}; Doing this, and running |
No description provided.
The text was updated successfully, but these errors were encountered: