Skip to content
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

Bypass homepage and go straight to a docs page. #871

Open
johnnymatthews opened this issue Aug 17, 2022 · 5 comments
Open

Bypass homepage and go straight to a docs page. #871

johnnymatthews opened this issue Aug 17, 2022 · 5 comments

Comments

@johnnymatthews
Copy link

johnnymatthews commented Aug 17, 2022

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.

@h-enk
Copy link
Member

h-enk commented Aug 18, 2022

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

@johnnymatthews
Copy link
Author

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.

@h-enk h-enk added the keep label Sep 5, 2022
@viraf
Copy link

viraf commented Nov 9, 2022

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.

@smythp
Copy link

smythp commented Aug 1, 2023

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.

@h-enk
Copy link
Member

h-enk commented Aug 9, 2023

See also #343 (reply in thread)

@h-enk h-enk removed the keep label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants