doks
doks copied to clipboard
Bypass homepage and go straight to a docs page.
Summary
Have an option within params.toml
that forwards the user to a specific docs page instead of the index.html
page.
Basic example
- Web developer sets `set_homepage = "/lorem/ipsum".
- The user visits the site
example.com
. - The user sees the content from
/content/en/docs/lorem/ipsum/index.md
.
Another example:
- The web developer sets
set_homepage = ""
. - The user visits the site
example.com
. - The user sees the content of
/layouts/index.html
.
Motivation
Some web developers want to be able to immediately direct the user to .md
content, and don't need a landing page. But the only way to do this currently is to manually edit the content of certain .md
and /layout
files. Mentioned in this discussion.
Definitely a good one to make this simpler — hopefully with just setting an option. I will look into this.
According to that discussion thread, the only thing that might be an issue is that you have to set url: "/"
in the .md
file you want Hugo to list as the homepage. Not sure how to get around that.
As a workaround for now. I am using {{ with .GetPage "/docs/prologue/introduction" }}{{.Render}}{{end}}
in layouts/index.html and commenting out the current landing page.
Thanks for docs, I'm liking it so far, and working to use it for the docs page of a major open source project.
We're aiming to use one of the content pages as our main page. I'll probably use a variation on the solution outlined by @viraf, but I wanted to check in on this and see if there are any thoughts since last year. I do think this would be a useful option to support, as many docs pages start with an overview or introduction rather than a full project website.
See also https://github.com/h-enk/doks/discussions/343#discussioncomment-6613354