Hey,
I have a source hut page (https://e-topy.srht.site) and I've made a custom 404 page a while back,
however visiting an invalid URL (e.g. https://e-topy.srht.site/asd) doesn't redirect
to the 404 page (https://e-topy.srht.site/404.html).
I was wondering if it could be possible to specify a 404 page, and add it to the documentation if it exists.
Thanks,
Topy.
Hey Topy!
On Thu Sep 8, 2022 at 4:55 PM -03, E-Topy wrote:
> I was wondering if it could be possible to specify a 404 page, and add> it to the documentation if it exists.
Yes you can, I think you should use the GraphQL API to do that, as you
can see on the Site Entity:
> "A published website"> type Site {> id: Int!> created: Time!>> (... Trimmed for obvious reasons ...)> > "Path to the file to serve for 404 Not Found responses"> notFound: String
I'm pretty sure if you browse the archives you'll see some other tips or
discussion on the matter. If you use hut on your deployment process you
can use the flag --not-found which you can read more at the hut man page
(man hut) or here:
https://git.sr.ht/~emersion/hut/tree/master/item/doc/hut.1.scd#L456)
Cheers,
Pedro Lucas Porcellis
Hi,
On 9/8/22 21:55, E-Topy wrote:
> I was wondering if it could be possible to specify a 404 page, and> add it to the documentation if it exists.
If you use hut to publish your site (like e.g. described here: [1]), you
can specify a 404 page by adding e.g. `--not-found /404.html` to the
command. See also `hut pages publish -h`.
Hope that helps,
Conrad
[1]: https://srht.site/automating-deployments