zjedi / hugo-scroll

Clean, responsive, single-page Hugo website theme.
https://themes.gohugo.io/hugo-scroll/
MIT License
256 stars 187 forks source link

Add flexibility to index.html to be used in subdirectories #196

Open chatziko opened 4 days ago

chatziko commented 4 days ago

This is a simple PR that does not change the theme's behaviour for existing users in any way (the example page renders exactly the same).

On the other hand, it adds the flexibility of reusing the scrolling index.html template in multiple pages (not just the homepage) in a very simple way:

An example can be found in this commit (not part of the PR).

The changes are straightforward:

I don't know if you'd like to have full support for multiple scrolling pages in the future, or you prefer to keep the theme simple. But in any case this PR is simple and only adds flexibility, so I hope it can be merged.

zjedi commented 3 days ago

Always good idea to add more flexibility, I just wonder what is the use case? Do you have an example published already somewhere?

Are you aiming to produce separate pages of the same template? Or is it going to be somehow interlinked?

chatziko commented 3 days ago

Here's an example:

It's a single site for a theater company. Each actor has lots of info in several sub-sections, so it makes sense to have their own scrolling subdirectory page (a single internal page would look too flat and packed). These subdirectories are still part of the company site, so there's a "back" link to the homepage.

zjedi commented 5 hours ago

Interesting. It's like multiple websites sharing the theme. Perhaps you are also touching the topic of redesigning the "detail" pages #116 , which is currently of trivial nature. I can imagine we abondon it completely in favor of your solution.

Just throwing in some ideas how this could be developed in the future:

Let me know what you think of the navigation.

There's a small conflict by the way :)

chatziko commented 4 hours ago

I fixed the conflict (trivial one introduced by #197).

I'm actually using all 3 types of pages:

I think having all three should cover most needs of small-to-medium websites. And of course someone could choose to use only a subset of them, eg not use detail pages and use internal scrolling pages instead.

We should use clear and consistent names for these btw.

I would propose the following plan to move forward: