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

Add generic home page section generation #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MarekPikula
Copy link
Contributor

This change enables theme user to specify arbitrary order of sections, and add multiple sections of the same type (more generic approach than in #105, which is applicable only to experience blocks).

  • All sections are specified in config as a list, with order of items directly reflecting order on the main page (including navbar).
  • Type of a section is specified with a new type field.
  • If there are multiple sections of the same type, in order to distinguish them for navbar navigation, you need to specify unique id field.
  • Navbar and main page generation is more generic, allowing to add custom section types – the only requirement is a custom partial named after the section type. Styling can be provided in a custom CSS (enabled with customCSS site param).

@MarekPikula MarekPikula force-pushed the variable-sections branch 4 times, most recently from f5c6f9d to 488c25b Compare June 2, 2024 19:05
@gurusabarish
Copy link
Owner

Hi @MarekPikula , Thanks for all your valuable pull requests ❤️ . All your pull requests can make this template to use in more effective way.

@gurusabarish
Copy link
Owner

As it involves more changes, I will check this pull request clearly and merge.

@MarekPikula
Copy link
Contributor Author

MarekPikula commented Jun 15, 2024

Sure thing. The main issue I have with this PR in particular is that it introduces braking changes. I thought about making it backwards-compatible, but couldn't find a way to do it cleanly (yet). I'd say that we have a few options:

  1. Try to make this change backwards-compatible. It may make the code look somewhat uglier, but it won't break people's setup.
  2. Merge as is but provide a clear instructions on how to transition to the new config scheme. The question is where is the right place for this. I'd say that maybe a wiki article, a release pointing to that article, and maybe a note in the README.

What do you think?

@MarekPikula
Copy link
Contributor Author

I just rebased the branch onto the recent master, so that it's directly mergable.

This change enables theme user to specify arbitrary order of sections,
and add multiple sections of the same type (more generic approach than
in gurusabarish#105, which is applicable only to experience blocks).

- All sections are specified in config as a list, with order of items
  directly reflecting order on the main page (including navbar).
- Type of a section is specified with a new `type` field.
- If there are multiple sections of the same type, in order to
  distinguish them for navbar navigation, you need to specify unique
  `id` field.
- Navbar and main page generation is more generic, allowing to add
  custom section types – the only requirement is a custom partial named
  after the section type. Styling can be provided in a custom CSS
  (enabled with `customCSS` site param).

Signed-off-by: Marek Pikuła <[email protected]>
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

Successfully merging this pull request may close these issues.

None yet

2 participants