Skip to content

Custom 404 page with content from md file #809

Discussion options

You must be logged in to vote

I would hard code that image into 404.html - or is this template a theme you re-use? Then use a config variable in site.Params to define that image.

I think it's not possible to have individual images for various errors each. The 404 implementation of GoHugo is quite inflexible. You could use Javascript to evaluate what the current URL is and then build dynamic parts based on the path-elements. But everything else is a very static thing and I would just put it into 404.html and put everything you want to configure into data or i18n (depending on the re-use of the theme).

Now try to build a 403 error page ;)

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@py20555sti
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@py20555sti
Comment options

@davidsneighbour
Comment options

Answer selected by py20555sti
@py20555sti
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants