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

Foldable nav behavior changes as of Hugo 0.100.0 #1065

Closed
chalin opened this issue Jun 23, 2022 · 3 comments · Fixed by #1070
Closed

Foldable nav behavior changes as of Hugo 0.100.0 #1065

chalin opened this issue Jun 23, 2022 · 3 comments · Fixed by #1070
Assignees
Labels
bug Something isn't working e0-minutes Effort < 60 min e1-hours p1-high p2-medium

Comments

@chalin
Copy link
Collaborator

chalin commented Jun 23, 2022

Visit a section with children and prior to Hugo 0.100.0 and you'll see the section entry open (with children visible) in the left nav. After 0.100.0, the same left-nav entry isn't open. For example, compare the state of the left-nav for the following two preview builds:

In particular, I'm guessing that we're being hit by the following:

The resources above suggests a means of preserving the old behavior (which we may or may not want to do).

Related:

Screenshots

Hugo 0.98

image

Hugo 0.100.2

image
@raum51
Copy link
Contributor

raum51 commented Jun 23, 2022

I had only time for a short look at this issue:

  • The problem is the not set CSS class "active-path" for die li tags along the current page path.
  • I think we have to redesign line 45 in the sidebar-tree.html partial:
    {{ $activePath := and (not $shouldDelayActive) ($p.IsDescendant $s) -}}

Also possible side effects to the JS it the cached sidebar tree version should get checkt:

<script>
$(function() {
$("#td-section-nav a").removeClass("active");
$("#td-section-nav #{{ $mid }}").addClass("active");
$("#td-section-nav #{{ $mid }}-li span").addClass("td-sidebar-nav-active-item");
$("#td-section-nav #{{ $mid }}").parents("li").addClass("active-path");
$("#td-section-nav li.active-path").addClass("show");
$("#td-section-nav li.active-path").children("input").prop('checked', true);
$("#td-section-nav #{{ $mid }}-li").siblings("li").addClass("show");
$("#td-section-nav #{{ $mid }}-li").children("ul").children("li").addClass("show");
$("#td-sidebar-menu").toggleClass("d-none");
});
</script>

--> After a quick check, I think, the cached version should work fine.

I'm afraid, that I won't find the time to fix it and test it in the 1-2 weeks. So If anybody else can find time, it would be fine. If not, I have a time slot at the beginning of July, where I will update our own Docsy site.

@chalin
Copy link
Collaborator Author

chalin commented Jun 23, 2022

@raum51 - Right. No worries, I have a fix (see open-telemetry/opentelemetry.io#1477), which I'll port this week (and you'll be welcome to comment on if you have the time).

@chalin
Copy link
Collaborator Author

chalin commented Jun 23, 2022

/cc @nate-double-u

@chalin chalin self-assigned this Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working e0-minutes Effort < 60 min e1-hours p1-high p2-medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants