32
40
Fork
You've already forked website
52

docs: add sidebar #614

Merged
earl-warren merged 1 commit from gusted/sidebar into main 2025年07月17日 06:29:06 +02:00 AGit

No mobile support.

Add a sidebar to the documentation pages. If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed.

No mobile support. Add a sidebar to the documentation pages. If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed.
Gusted force-pushed gusted/sidebar from d6d417e593
Some checks failed
pr / preview (pull_request_target) Failing after 32s
to 969fce0ace
All checks were successful
pr / preview (pull_request_target) Successful in 1m37s
2025年07月11日 02:50:46 +02:00
Compare
Collaborator
Copy link
Preview ready: https://forgejo.codeberg.page/@pull_614/ https://forgejo.codeberg.page/@pull_614/docs/next/user/actions/ https://forgejo.codeberg.page/@pull_614/docs/v12.0/user/actions/ https://forgejo.codeberg.page/@pull_614/docs/v12.0/user/actions/reference/ https://forgejo.codeberg.page/@pull_614/docs/next/user/actions/reference/ https://forgejo.codeberg.page/@pull_614/docs/v12.0/user/actions/basic-concepts/
Contributor
Copy link

Extremely useful: I frequently get lost.

Extremely useful: I frequently get lost.
Gusted force-pushed gusted/sidebar from 969fce0ace
All checks were successful
pr / preview (pull_request_target) Successful in 1m37s
to fb54bdb8ad
All checks were successful
pr / preview (pull_request_target) Successful in 59s
2025年07月11日 21:55:26 +02:00
Compare
earl-warren left a comment
Copy link

Works form me with basic manual testing.

Works form me with basic manual testing.

Thanks, I'll have a look (with desktop) tomorrow or latest on Monday.

Can you rebase it, please? I'd like to see what it does to the new actions pages.

Thanks, I'll have a look (with desktop) tomorrow or latest on Monday. Can you rebase it, please? I'd like to see what it does to the new actions pages.
Gusted force-pushed gusted/sidebar from fb54bdb8ad
All checks were successful
pr / preview (pull_request_target) Successful in 59s
to 261b7a6ba3
All checks were successful
pr / preview (pull_request_target) Successful in 1m6s
2025年07月13日 00:42:46 +02:00
Compare
  • text color on light scheme is wrong
  • sidebar background is overlapping footer
  • links are not working (likely a preview thing, but would be great if it works also there)
  • packages and actions overview links are missing (because unclicklable in head of dropdown)
  • sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions
  • also a bit more structure (like outlined in the index page of the user docs) would be nice, but could also go to future

If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed.

  • at least in the preview this seems not working for me

image

- text color on light scheme is wrong - sidebar background is overlapping footer - links are not working (likely a preview thing, but would be great if it works also there) - packages and actions overview links are missing (because unclicklable in head of dropdown) - sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions - also a bit more structure (like outlined in the index page of the user docs) would be nice, but could also go to future > If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed. - at least in the preview this seems not working for me ![image](/attachments/0f5bd900-4bd7-4b45-a318-802dea910bd9)
Gusted force-pushed gusted/sidebar from 261b7a6ba3
All checks were successful
pr / preview (pull_request_target) Successful in 1m6s
to 21d3832e1b
All checks were successful
pr / preview (pull_request_target) Successful in 1m32s
2025年07月14日 10:12:14 +02:00
Compare
Author
Owner
Copy link

@mahlzahn wrote in #614 (comment):

sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions

Yeah this requires changes in the documentation files to specify their ordering via the frontmatter, so it matches the ordering of the associated index file.

@mahlzahn wrote in #614 (comment):

sidebar background is overlapping footer

Ah oh wow 🤦‍♀️ not sure how I missed that. I do now have another feature, for documentation pages where there's little content (such as /docs/latests) opening the dropdowns will push the footer down this seems unavoidable as you cannot specify the max-height to be that of a sibling element.

@mahlzahn wrote in #614 (comment):

links are not working (likely a preview thing, but would be great if it works also there)

Yeah, not really sure why this is happening as I am now using the correct functions to generate links :/

@mahlzahn wrote in #614 (comment):

packages and actions overview links are missing (because unclicklable in head of dropdown)

Once I am on the documentation for the 'next' version they show up for me:

image

@mahlzahn wrote in #614 (comment):

text color on light scheme is wrong

Ah did not check light mode 🙈

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions Yeah this requires changes in the documentation files to specify their ordering via the frontmatter, so it matches the ordering of the associated index file. @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > sidebar background is overlapping footer Ah oh wow 🤦‍♀️ not sure how I missed that. I do now have another _feature_, for documentation pages where there's little content (such as `/docs/latests`) opening the dropdowns will push the footer down this seems unavoidable as you cannot specify the max-height to be that of a sibling element. @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > links are not working (likely a preview thing, but would be great if it works also there) Yeah, not really sure why this is happening as I am now using the correct functions to generate links :/ @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > packages and actions overview links are missing (because unclicklable in head of dropdown) Once I am on the documentation for the 'next' version they show up for me: ![image](/attachments/277e950a-38ad-4627-8de7-d74727b975c8) @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > text color on light scheme is wrong Ah did not check light mode 🙈
Author
Owner
Copy link

(削除) Hmm the preview is not being updated... (削除ここまで) Okay codeberg pages server caching.

~~Hmm the preview is not being updated...~~ Okay codeberg pages server caching.
Gusted force-pushed gusted/sidebar from 21d3832e1b
All checks were successful
pr / preview (pull_request_target) Successful in 1m32s
to c2ac4d5c1a
All checks were successful
pr / preview (pull_request_target) Successful in 1m6s
2025年07月14日 10:33:20 +02:00
Compare
Author
Owner
Copy link

21d3832e1b..c2ac4d5c1a makes the link work in preview.

https://codeberg.org/forgejo/website/compare/21d3832e1bc0fd03e4b4088371d70371185ee6bc..c2ac4d5c1a2715b2b4924957d92f3e49b5452dca makes the link work in preview.
Contributor
Copy link

😍 I'm informally approving based on visual testing alone. The code is beyond my paygrade.

image

😍 I'm informally approving based on visual testing alone. The code is beyond my paygrade. ![image](/attachments/2ecb8abd-4421-4d86-9ac3-4a0862da9005)
202 KiB

@Gusted wrote in #614 (comment):

packages and actions overview links are missing (because unclicklable in head of dropdown)

Once I am on the documentation for the 'next' version they show up for me

I wasn't clear: There is no way to reach the

from the new sidebar, because clicking on these items is unfolding the menu for the sub-items.

(Nice would be, if click on the title leads to the page and click on the down triangle opens the menu, but this doesn't work with the default <details> element, at least I didn't manage also in the context of Forgejo settings navigation.)

@Gusted wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5817716: > > packages and actions overview links are missing (because unclicklable in head of dropdown) > > Once I am on the documentation for the 'next' version they show up for me I wasn't clear: There is no way to reach the - https://forgejo.codeberg.page/@pull_614/docs/next/user/actions/overview/ and - https://forgejo.codeberg.page/@pull_614/docs/next/user/packages/ from the new sidebar, because clicking on these items is unfolding the menu for the sub-items. (Nice would be, if click on the title leads to the page and click on the down triangle opens the menu, but this doesn't work with the default `<details>` element, at least I didn't manage also in the context of Forgejo settings navigation.)
Gusted force-pushed gusted/sidebar from c2ac4d5c1a
All checks were successful
pr / preview (pull_request_target) Successful in 1m6s
to b31aa795da
Some checks failed
pr / preview (pull_request_target) Failing after 28s
2025年07月15日 00:13:38 +02:00
Compare
Author
Owner
Copy link

@mahlzahn wrote in #614 (comment):

(Nice would be, if click on the title leads to the page and click on the down triangle opens the menu, but this doesn't work with the default <details> element, at least I didn't manage also in the context of Forgejo settings navigation.)

This can quite easily be done, however I am not sure if we want to have some hover effect to indicate it's a link (that might be a bit unclear now).

c2ac4d5c1a..b31aa795da

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5826644: > (Nice would be, if click on the title leads to the page and click on the down triangle opens the menu, but this doesn't work with the default `<details>` element, at least I didn't manage also in the context of Forgejo settings navigation.) This can quite easily be done, however I am not sure if we want to have some hover effect to indicate it's a link (that might be a bit unclear now). https://codeberg.org/forgejo/website/compare/c2ac4d5c1a2715b2b4924957d92f3e49b5452dca..b31aa795dab9e929535c141c07c11c75dd9e308d
Gusted force-pushed gusted/sidebar from b31aa795da
Some checks failed
pr / preview (pull_request_target) Failing after 28s
to f9c20227ac
All checks were successful
pr / preview (pull_request_target) Successful in 1m17s
2025年07月15日 00:14:40 +02:00
Compare

@mahlzahn wrote in #614 (comment):

because clicking on these items is unfolding the menu for the sub-items

Not directly related, but since I noticed it in this preview: The same is true for the "Docs" link in the navbar. Since it becomes a dropdown now, the link back to the main docs page is gone.
The sidebar could get a link for that, though.

@Gusted wrote in #614 (comment):

This can quite easily be done, however I am not sure if we want to have some hover effect to indicate it's a link (that might be a bit unclear now).

That's pretty common, though. E.g. Read The Docs doesn't even show an indicator that something can be expanded until you click it (and load its corresponding page).

But are those pages even necessary? From what I can tell, most of them are just link collections anyways, which are effectively obsolete by the sidebar providing those same links.
So another option would be to move the few pages like /docs/next/user/packages/ to be another sub-item in the group. Then the group header wouldn't need to be a link.

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5826644: > because clicking on these items is unfolding the menu for the sub-items Not directly related, but since I noticed it in this preview: The same is true for the "Docs" link in the navbar. Since it becomes a dropdown now, the link back to the main docs page is gone. The sidebar could get a link for that, though. @Gusted wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5829476: > This can quite easily be done, however I am not sure if we want to have some hover effect to indicate it's a link (that might be a bit unclear now). That's pretty common, though. E.g. Read The Docs doesn't even show an indicator that something can be expanded until you click it (and load its corresponding page). But are those pages even necessary? From what I can tell, most of them are just link collections anyways, which are effectively obsolete by the sidebar providing those same links. So another option would be to move the few pages like `/docs/next/user/packages/` to be another sub-item in the group. Then the group header wouldn't need to be a link.

Clicking/scrolling through the sidebar, I see a lot of verbose or redundant titles.

  • The top-level sections all start with "Forgejo"
  • The new pages for Actions all start with "Forgejo Actions"
  • "Automatically Linked References in Issues, Pull Requests, and Commit Messages" takes three lines of text in the sidebar
  • Every package registry page include "Package Registry"

I think the sidebar should support showing something other than the page title, and that many pages should fill out that "other" field to avoid those redundant titles.

I also think, the sidebar should get custom order and grouping similar to the link collection pages. The two modes that I could see users looking at the sidebar with are:

  • Read from top to bottom, like the chapters of a book -> The order is all over the place (e.g. installing a runner comes before installing Forgejo), so there is no red thread of chapters to follow
  • Read like a reference, looking for specific pages -> The order is all over the place, so you have to read through the entire list to find the page you want
Clicking/scrolling through the sidebar, I see a lot of verbose or redundant titles. - The top-level sections all start with "Forgejo" - The new pages for Actions all start with "Forgejo Actions" - "Automatically Linked References in Issues, Pull Requests, and Commit Messages" takes three lines of text in the sidebar - Every package registry page include "Package Registry" I think the sidebar should support showing something other than the page title, and that many pages should fill out that "other" field to avoid those redundant titles. I also think, the sidebar should get custom order and grouping similar to the link collection pages. The two modes that I could see users looking at the sidebar with are: - Read from top to bottom, like the chapters of a book -> The order is all over the place (e.g. installing a runner comes before installing Forgejo), so there is no red thread of chapters to follow - Read like a reference, looking for specific pages -> The order is all over the place, so you have to read through the entire list to find the page you want
Author
Owner
Copy link

It would require many small changes across all versions of the documentation, which should be done but I cannot commit to do that in a timely manner. The changes for the website would be very minimal once the documentation is updated to have that metadata.

It would require many small changes across all versions of the documentation, which should be done but I cannot commit to do that in a timely manner. The changes for the website would be very minimal once the documentation is updated to have that metadata.
mahlzahn left a comment
Copy link

Thanks a lot for this great addition! I checked all points I raised in my comment above and I think it looks good (maybe minor light scheme theming).

One issue, I see, is that now, when opening the documentation my whole attention is on the sidebar and I wonder if people will continue reading the structured index pages (for admin, user and contributor). What do you think about not expanding the sidebar items by default? Only, when the page is inside a submenu it should be expanded? I mean, e.g., when you are on the admin index page, then it the sidebar would be closed and only when you open a subpage it will expand.

@mahlzahn wrote in #614 (comment):

  • text color on light scheme is wrong

That is fixed now, thanks, minor nit: the highlighted (selected, current page) is not themed so well in light scheme. It should use the same color that is used on hovering (either pinkish or light greyish).

Other comments, not actionable here
  • sidebar background is overlapping footer

Fixed now, thanks.

  • links are not working (likely a preview thing, but would be great if it works also there)

Working now, thanks.

  • packages and actions overview links are missing (because unclicklable in head of dropdown)

Nice, working now, thanks! (Note to myself: not really for actions, but might consider moving overview to actions/index.md, beyond this PR)

  • sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions
  • also a bit more structure (like outlined in the index page of the user docs) would be nice, but could also go to future

Will be follow-up with organization of order, etc. (beyond this PR).

If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed.

  • at least in the preview this seems not working for me

Working now in preview, thanks!

Thanks a lot for this great addition! I checked all points I raised in my comment above and I think it looks good (maybe minor light scheme theming). One issue, I see, is that now, when opening the documentation my whole attention is on the sidebar and I wonder if people will continue reading the structured index pages (for admin, user and contributor). What do you think about not expanding the sidebar items by default? Only, when the page is inside a submenu it should be expanded? I mean, e.g., when you are on the admin index page, then it the sidebar would be closed and only when you open a subpage it will expand. @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5816903: > * text color on light scheme is wrong That is fixed now, thanks, minor nit: the highlighted (selected, current page) is not themed so well in light scheme. It should use the same color that is used on hovering (either pinkish or light greyish). <details><summary>Other comments, not actionable here</summary> > * sidebar background is overlapping footer Fixed now, thanks. > * links are not working (likely a preview thing, but would be great if it works also there) Working now, thanks. > * packages and actions overview links are missing (because unclicklable in head of dropdown) Nice, working now, thanks! (Note to myself: not really for actions, but might consider moving overview to actions/index.md, beyond this PR) > * sorting (currently using the slug) seems a bit unnatural, but could be improved in future versions > * also a bit more structure (like outlined in the index page of the user docs) would be nice, but could also go to future Will be follow-up with organization of order, etc. (beyond this PR). > > > If you visit some page in the user documentation than the the user section is expanded and admin and contributors is collapsed. > > * at least in the preview this seems not working for me Working now in preview, thanks! </details>
Author
Owner
Copy link

@mahlzahn wrote in #614 (comment):

One issue, I see, is that now, when opening the documentation my whole attention is on the sidebar and I wonder if people will continue reading the structured index pages (for admin, user and contributor). What do you think about not expanding the sidebar items by default? Only, when the page is inside a submenu it should be expanded? I mean, e.g., when you are on the admin index page, then it the sidebar would be closed and only when you open a subpage it will expand.

I do not have a strong opinion on that, but I do see the usecase for it. I think for such smaller tweaks to the behavior would be better to receive feedback from several people about it. I am available to adjust this behavior after the fact.

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5844404: > One issue, I see, is that now, when opening the documentation my whole attention is on the sidebar and I wonder if people will continue reading the structured index pages (for admin, user and contributor). What do you think about not expanding the sidebar items by default? Only, when the page is inside a submenu it should be expanded? I mean, e.g., when you are on the admin index page, then it the sidebar would be closed and only when you open a subpage it will expand. I do not have a strong opinion on that, but I do see the usecase for it. I think for such smaller tweaks to the behavior would be better to receive feedback from several people about it. I am available to adjust this behavior after the fact.
Gusted force-pushed gusted/sidebar from f9c20227ac
All checks were successful
pr / preview (pull_request_target) Successful in 1m17s
to 47d43d44c9
All checks were successful
pr / preview (pull_request_target) Successful in 1m50s
2025年07月16日 19:08:40 +02:00
Compare
Author
Owner
Copy link

@mahlzahn wrote in #614 (comment):

That is fixed now, thanks, minor nit: the highlighted (selected, current page) is not themed so well in light scheme. It should use the same color that is used on hovering (either pinkish or light greyish).

This should be fixed now, f9c20227ac..47d43d44c9.

It also includes the highlighting of collapsible pages and centers the caret icon.

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5844404: > That is fixed now, thanks, minor nit: the highlighted (selected, current page) is not themed so well in light scheme. It should use the same color that is used on hovering (either pinkish or light greyish). This should be fixed now, https://codeberg.org/forgejo/website/compare/f9c20227ac8d1db7cebf5cd670fed4eec1f6086b..47d43d44c9fb1dd98e784e5b8579cbcb183ce81e. It also includes the highlighting of collapsible pages and centers the caret icon.
Owner
Copy link

I don't mean to destroy the work that has happened ... but would it make sense to reuse the structured index pages and extracting the custom order from there? They have been created anyway at the moment ...

I don't mean to destroy the work that has happened ... but would it make sense to reuse the structured index pages and extracting the custom order from there? They have been created anyway at the moment ...
Owner
Copy link

I believe this PR is valuable in itself, and I would be in favour of merging it unconditionally.

To address the concerns raised here, it makes a lot of sense to do some other related changes. The summary pages are essentially a list of pages. The things missing are

  1. external links
  2. Sections without summary pages (e.g. "for translators")
  3. Different link text than the actual title
  4. Custom order

My take on the problems:

  1. Get rid of external links. I have always been confused that they lead somewhere else than the docs.

  2. Maybe allow nesting pages and somehow specifying an index name for it that is not rendered as an actual index page. Maybe by having frontmatter in a yaml file, an index file with only the frontmatter, or accepting that empty index pages can exist.

  3. I believe that it makes some sense to adjust the page title in many cases. Let's think about the remaining problems afterwards. Maybe automatically include the parent title?

  4. What about allowing an order prefix in the filenames that is stripped from the URL, if possible? So that we can have a structure like

    - 10-first-file
    - 20-second-file
    - 90-last-file
    

    which is rendered as

    • /first-file
    • /second-file
    • /last-file
I believe this PR is valuable in itself, and I would be in favour of merging it unconditionally. To address the concerns raised here, it makes a lot of sense to do some other related changes. The summary pages are essentially a list of pages. The things missing are 1. external links 2. Sections without summary pages (e.g. "for translators") 3. Different link text than the actual title 4. Custom order My take on the problems: 1. Get rid of external links. I have always been confused that they lead somewhere else than the docs. 2. Maybe allow nesting pages and somehow specifying an index name for it that is not rendered as an actual index page. Maybe by having frontmatter in a yaml file, an index file with only the frontmatter, or accepting that empty index pages can exist. 3. I believe that it makes some sense to adjust the page title in many cases. Let's think about the remaining problems afterwards. Maybe automatically include the parent title? 4. What about allowing an order prefix in the filenames that is stripped from the URL, if possible? So that we can have a structure like ~~~ - 10-first-file - 20-second-file - 90-last-file ~~~ which is rendered as - /first-file - /second-file - /last-file
Contributor
Copy link

Unless this suggestion can be implemented before the v12 release, I would be in favor of merging this as it is and work on improvements later. This makes the documentation much easier to navigate and having that when the v12 release is happening is good timing.

Unless this suggestion can be implemented before the v12 release, I would be in favor of merging this as it is and work on improvements later. This makes the documentation much easier to navigate and having that when the v12 release is happening is good timing.
Author
Owner
Copy link

@fnetX wrote in #614 (comment):

but would it make sense to reuse the structured index pages and extracting the custom order from there? They have been created anyway at the moment ...

It makes sense to do so, but it's a time consuming task to do that across all versions of the documentation.

@fnetX wrote in https://codeberg.org/forgejo/website/pulls/614#issuecomment-5852791: > but would it make sense to reuse the structured index pages and extracting the custom order from there? They have been created anyway at the moment ... It makes sense to do so, but it's a time consuming task to do that across all versions of the documentation.
Owner
Copy link

I am starting to move some pages. forgejo/docs#1326/ is the first part.

I am starting to move some pages. https://codeberg.org/forgejo/docs/pulls/1326/ is the first part.
fnetX left a comment
Copy link

Working more with the documentation makes me miss the sidebar already. In my eyes, it's a good improvement that will benefit from fine-tuning over time. Let's get this in!

Working more with the documentation makes me miss the sidebar already. In my eyes, it's a good improvement that will benefit from fine-tuning over time. Let's get this in!
Sign in to join this conversation.
No reviewers
Labels
Clear labels
404
Broken links or missing content
Accessibility
Accessibility
Blog post
Documentation
Forgejo Documentation
Internationalisation
i18n and l10n
User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
6 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
forgejo/website!614
Reference in a new issue
forgejo/website
No description provided.
Delete branch "gusted/sidebar"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?