-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Sticky Header option bug #2935
Comments
This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review. This issue will automatically close soon if no further activity occurs. Thank you for your contributions. |
I suggest you submit a PR, @Agos95 |
Ok, I submitted a PR! |
This issue is stale because it has not had any recent activity. The resources of the project maintainers are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, and you feel that it is still relevant and valuable, consider contributing a Pull Request for review. This issue will automatically close soon if no further activity occurs. Thank you for your contributions. |
Prerequisites
Proposal
My proposal is to change this code
https://github.com/wowchemy/wowchemy-hugo-themes/blob/57e374fe08d8bb0eee34b160d479a77dc13b8503/modules/wowchemy/layouts/partials/site_js.html#L131
In fact, instead of looking at
actually the code searches for
header.on_scroll:
I suggest to:
sticky
instead ofon_scroll
, which in my opinion is more clear.option to configure the header. Now, the value must be set to "disappear" to have a disappearing header, while everything else creates a sticky one. The use of true/false instead may be more clear.
params.yaml
configuration file, or a per page one by using the single page Front Matter.The logic to set the behaviour of the header should be:
params.yaml
to set the options to the whole site:I already fix this behaviour in my fork. If you think this can be useful, I can proceed with a PR.
Motivation and context
As stated in this discussion on Discord, there is a bug in the syntax to set the header sticky. In particular, this is the buggy code:
https://github.com/wowchemy/wowchemy-hugo-themes/blob/57e374fe08d8bb0eee34b160d479a77dc13b8503/modules/wowchemy/layouts/partials/site_js.html#L131
As for now, to make the header sticky you need to set the parameter
but looking at the code it should be:
In addition, it actually checks if
sticky.header
is set and equal to "disappear", but I think this should be a boolean value.The text was updated successfully, but these errors were encountered: