top menu color is incorrect with recent Zola #39

Closed
opened 2020-09-21 19:32:43 +08:00 by sb10q · 1 comment

Problem is reproducible with zola 0.12.0

image

Top elements "Experiment control"... are light blue instead of the dark color used in the current version on https://m-labs.hk

Problem is reproducible with zola 0.12.0 ![image](/attachments/233582e8-6eda-4122-b7ad-8355e7d5c6b9) Top elements "Experiment control"... are light blue instead of the dark color used in the current version on https://m-labs.hk
256 KiB
sovanna self-assigned this 2021-02-16 21:34:04 +08:00
sovanna was unassigned by sb10q 2021-05-13 18:37:48 +08:00
occheung was assigned by sb10q 2021-05-13 18:45:52 +08:00
Collaborator

This line is supposed to make the dropdown item active conditionally.

49488577f8/templates/_base.html (L79)

I think the intended behavior is to show the corresponding top element in lighter color when the page is opened. For example:

  • At the Control loop page, the top element "Experiment control" is active and it is in a lighter blue color.
  • At the Milkymist SoC page, the top element "Gateware" is active, and it is in the lighter blue.

And so on...
The line of code implements this logic by checking the first segment of the paths. But the behavior of current_path and other kinds of path in zola 0.12.0 was changed by this PR (corresponding issue).

After that PR, all path starts with a slash (/), the first element is always an empty string. The top elements are always active.

This [line](https://git.m-labs.hk/M-Labs/web2019/src/commit/49488577f8077caffbfa050d72b38ce3c61568fa/templates/_base.html#L79) is supposed to make the dropdown item active conditionally. https://git.m-labs.hk/M-Labs/web2019/src/commit/49488577f8077caffbfa050d72b38ce3c61568fa/templates/_base.html#L79 I think the intended behavior is to show the corresponding top element in lighter color when the page is opened. For example: * At the [Control loop page](http://m-labs.hk/experiment-control/control-loops/), the top element "Experiment control" is active and it is in a lighter blue color. * At the [Milkymist SoC page](http://m-labs.hk/gateware/m1/), the top element "Gateware" is active, and it is in the lighter blue. And so on... The line of code implements this logic by checking the first segment of the paths. But the behavior of `current_path` and other kinds of path in zola 0.12.0 was changed by this [PR](https://github.com/getzola/zola/pull/1101) (corresponding [issue](https://github.com/getzola/zola/issues/1086)). After that PR, all path starts with a slash (/), the first element is always an empty string. The top elements are always active.
sb10q closed this issue 2021-06-02 15:11:15 +08:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/web2019#39
There is no content yet.