doks icon indicating copy to clipboard operation
doks copied to clipboard

Bypass homepage and go straight to a docs page.

Open johnnymatthews opened this issue 2 years ago • 5 comments

Summary

Have an option within params.toml that forwards the user to a specific docs page instead of the index.html page.

Basic example

  1. Web developer sets `set_homepage = "/lorem/ipsum".
  2. The user visits the site example.com.
  3. The user sees the content from /content/en/docs/lorem/ipsum/index.md.

Another example:

  1. The web developer sets set_homepage = "".
  2. The user visits the site example.com.
  3. 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.

johnnymatthews avatar Aug 17 '22 15:08 johnnymatthews

Definitely a good one to make this simpler — hopefully with just setting an option. I will look into this.

h-enk avatar Aug 18 '22 16:08 h-enk

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.

johnnymatthews avatar Aug 18 '22 16:08 johnnymatthews

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.

viraf avatar Nov 09 '22 19:11 viraf

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.

smythp avatar Aug 01 '23 00:08 smythp

See also https://github.com/h-enk/doks/discussions/343#discussioncomment-6613354

h-enk avatar Aug 09 '23 18:08 h-enk