zola icon indicating copy to clipboard operation
zola copied to clipboard

REQUEST: Support specifying a custom landing page/homepage

Open stevenroose opened this issue 8 months ago • 6 comments

Currently the homepage is always content/_index.md. AFAIK the only way to change this is to add a redirect_to field in this file, but this will first of all not work without JS and it briefly shows a redirect page which is both really annoying and bad for page rankings.

Is there a better way to specify a different landing page? If not, can this please be added, it could be a field in the root config.toml like homepage = "/docs/getting-started" or something.

stevenroose avatar Oct 22 '23 03:10 stevenroose

That would be the base_url in the config no? I don't know if it works with paths though

Keats avatar Oct 22 '23 14:10 Keats

I thought base URL was the base on top of which my pages are built..

If my website is https://example.com/ and the page I want to land on is /docs/overview, if I set base_url to either https://example.com/docs/overview or /docs/overview, wouldn't that mean that other pages, like /docs/otherpage will be rendered as https://example.com/docs/overview/docs/otherpage or /docs/overview/docs/otherpage respectively?

That doesn't seem like the right property..

stevenroose avatar Oct 22 '23 17:10 stevenroose

Indeed i misunderstood. That's not supported right now, let's see if more people want that.

Keats avatar Oct 31 '23 13:10 Keats

This is what I have been looking for currently. I've been trying to use Zola and found it challenging to display markdown content directly on the homepage with the default setup. Despite reviewing the documentation, it isn't clear how to bypass the typical focus on sections and pages to have content immediately visible on the main page. As someone new to static site generators, this seems like an area that could be improved, and really liked the stevenroose's idea...

All the best...

altunenes avatar May 09 '24 08:05 altunenes

The homepage is just a section, located at content/_index.md and that is created automatically if not present. You can put and render any markdown you want and it will use a templates/index.html template for rendering.

Keats avatar May 09 '24 21:05 Keats

thank you! I handled it after a while. best...

altunenes avatar May 09 '24 21:05 altunenes