not-matthias / apollo

Modern and minimalistic blog theme.
https://not-matthias.github.io/apollo
MIT License
121 stars 70 forks source link

Add a home page #59

Closed SeniorMars closed 2 months ago

SeniorMars commented 2 months ago

I implemented this for my fork, and I thought perhaps some people might want this too.

Anyway, right now index.html just redirects to /posts. This is fine, but sometimes people want a landing page. Here is mine: https://seniormars.com/.

I already have the code needed for this, but I'm unsure if this is feature that should be pred.

not-matthias commented 2 months ago

Yeah, seems like a feature that can be useful for others :+1:

SeniorMars commented 2 months ago

The only problem is that I couldn't figure out a way to disable this by default in a clean fashion, as we would be modifying the index.html. We could create a hacky solution but it will be messy.

not-matthias commented 2 months ago

You should be able to set a custom template using the following config (like I did in the projects _index.md)

template = "homepage.html"

So default index.html is the normal page view. And you can opt in to use a different template as homepage.


EDIT: Why is a [extra.home] entry not possible? Different options could be defined just like the analytics: https://github.com/not-matthias/apollo/blob/main/config.toml#L40-L49