not-matthias / apollo

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

feat: display section title if provided #52

Closed networkhermit closed 7 months ago

networkhermit commented 7 months ago

Currently the about section displays About as title but the posts section and projects section just displays the site title, even though they both provide a title field:

https://github.com/not-matthias/apollo/blob/4b9787dd5b8ff70167e48f425bc7563196bc3002/content/about.md?plain=1#L2

https://github.com/not-matthias/apollo/blob/4b9787dd5b8ff70167e48f425bc7563196bc3002/content/posts/_index.md?plain=1#L4

This pr changed the behavior to use the section title if provided by the user, otherwise fallback to the site title is available.

For users prefer displaying the site title in section page, ~simply remove the title field in _index.md to keep the old behavior~ this is a breaking change, but I think it should be fine.

By the way, if we want to make the title and section header fully customizable, e.g. like Themes | Zola or Archie | Home style, a new variable seems to be inevitable, and then I could close the pr and let the author to choose between the implementation details.

not-matthias commented 7 months ago

Thanks! :)