32
40
Fork
You've already forked website
52

Add version dropdown #606

Merged
Gusted merged 1 commit from gusted/version-dropdown into main 2025年07月05日 01:21:56 +02:00 AGit

Add a dropdown on all documentation pages that show the Forgejo version of the documentation you are reading in the header and allow you to switch between documentation of the 'Next', 'Latest' and any LTS releases.

Screenshots

image
image

Add a dropdown on all documentation pages that show the Forgejo version of the documentation you are reading in the header and allow you to switch between documentation of the 'Next', 'Latest' and any LTS releases. ## Screenshots ![image](/attachments/35521c88-b40c-49aa-913b-7506a4b02482) ![image](/attachments/cfd1b65a-0dc1-404a-afb2-123540103fcf)
Collaborator
Copy link
Preview ready: https://forgejo.codeberg.page/@pull_606/ https://forgejo.codeberg.page/@pull_606/docs/latest/ https://forgejo.codeberg.page/@pull_606/docs/next/ https://forgejo.codeberg.page/@pull_606/docs/v10.0/
Author
Owner
Copy link

For some reason the preview does not show the version dropdown in other versions than 'latest' - locally it is shown in all versions and this might be some CI preview weirdness.

For some reason the preview does not show the version dropdown in other versions than 'latest' - locally it is shown in all versions and this might be some CI preview weirdness.

@Gusted wrote in #606 (comment):

For some reason the preview does not show the version dropdown in other versions than 'latest'

It works, just the links point outside of the PR context.

@Gusted wrote in https://codeberg.org/forgejo/website/pulls/606#issuecomment-5704961: > For some reason the preview does not show the version dropdown in other versions than 'latest' It works, just the links point outside of the PR context.
Author
Owner
Copy link

@mahlzahn wrote in #606 (comment):

It works, just the links point outside of the PR context.

Ah, I did not notice that.

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/606#issuecomment-5705066: > It works, just the links point outside of the PR context. Ah, I did not notice that.
  1. Can you merge the docs button with the selection menu when on docs?
    Docs next v Docs v11.0 v Docs v7.0 v
  2. I like that you directly jump to the other version of a file when clicking there, but what happens if the version does not exist (because it was moved or newly created)? E.g. this leads to 404 in v7.0
1. Can you merge the docs button with the selection menu when on docs? `Docs next v` `Docs v11.0 v` `Docs v7.0 v` 2. I like that you directly jump to the other version of a file when clicking there, but what happens if the version does not exist (because it was moved or newly created)? E.g. [this](https://forgejo.codeberg.page/@pull_606/docs/latest/user/packages/alt/) leads to 404 in v7.0
Author
Owner
Copy link

@mahlzahn wrote in #606 (comment):

Can you merge the docs button with the selection menu when on docs?

This might require some changes in how these links are generated but this would look more nice.

@mahlzahn wrote in #606 (comment):

I like that you directly jump to the other version of a file when clicking there, but what happens if the version does not exist (because it was moved or newly created)? E.g. this leads to 404 in v7.0

I am not sure how much Astro is capable of, it might be possible to detect this.

@mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/606#issuecomment-5705210: > Can you merge the docs button with the selection menu when on docs? This might require some changes in how these links are generated but this would look more nice. @mahlzahn wrote in https://codeberg.org/forgejo/website/pulls/606#issuecomment-5705210: > I like that you directly jump to the other version of a file when clicking there, but what happens if the version does not exist (because it was moved or newly created)? E.g. [this](https://forgejo.codeberg.page/@pull_606/docs/latest/user/packages/alt/) leads to 404 in v7.0 I am not sure how much Astro is capable of, it might be possible to detect this.
0ko left a comment
Copy link

Great change!

Great change!
@ -0,0 +39,4 @@
<li class="dropdown md:block hidden">
<button class="flex items-center dark:hover:text-white hover:text-link px-4 py-3 whitespace-nowrap" type="button">
{selectedVersion}
Owner
Copy link
  • Contrast of both selectedVersion and releases is a bit low and it's darker than other navbar entries. I'd expect them to look same
  • Seems to work w/o JS, but doesn't work with touch emulation (e.g. on tablet)
  • Not shown on mobile layout
* Contrast of both selectedVersion and releases is a bit low and it's darker than other navbar entries. I'd expect them to look same * Seems to work w/o JS, but doesn't work with touch emulation (e.g. on tablet) * Not shown on mobile layout
Owner
Copy link

If can't yet get it to work on touch, it can be hidden with @media (pointer: coarse).

If can't yet get it to work on touch, it can be hidden with `@media (pointer: coarse)`.
Gusted marked this conversation as resolved
Gusted force-pushed gusted/version-dropdown from 0f074d3b6d
All checks were successful
pr / preview (pull_request_target) Successful in 1m36s
to fba00160f5
All checks were successful
pr / preview (pull_request_target) Successful in 58s
2025年07月04日 14:35:31 +02:00
Compare
Author
Owner
Copy link

0f074d3b6d..fba00160f5 incorporates many changes:

  • Version dropdown is merged with the documentation item when you are in the documentation.
  • Shown on mobile (although a bit hidden in the header and it is always expanded).
  • Only show versions for which the exact documentation exists.
  • Correct text coloring.
https://codeberg.org/forgejo/website/compare/0f074d3b6d809b22b0f88d5477eee957007a2fec..fba00160f5937314430605e07dcacf0f69d639fd incorporates many changes: - Version dropdown is merged with the documentation item when you are in the documentation. - Shown on mobile (although a bit hidden in the header and it is always expanded). - Only show versions for which the exact documentation exists. - Correct text coloring.
@ -0,0 +65,4 @@
<li>
<a
class="dark:hover:bg-gray-700 block dark:hover:text-white first:rounded-t hover:text-link last:rounded-b md:hover:bg-gray-100 px-5 py-2 whitespace-no-wrap"
href={`/docs/${release.version}/${pathname}`}
Member
Copy link

Can you use following function here? That would be really helpful in checking new contributions to docs which show up in next only.

fba00160f5/src/utils/permalinks.ts (L59-L61)

Can you use following function here? That would be really helpful in checking new contributions to docs which show up in next only. https://codeberg.org/forgejo/website/src/commit/fba00160f5937314430605e07dcacf0f69d639fd/src/utils/permalinks.ts#L59-L61
Gusted marked this conversation as resolved

It's a great addition! I find the light colors a bit weird still, including the shadow, in particular on mobile.

But that is minor (and can be ignored, if you are happy with it), and I'm happy that you managed this long requested issue!

It's a great addition! I find the light colors a bit weird still, including the shadow, in particular on mobile. But that is minor (and can be ignored, if you are happy with it), and I'm happy that you managed this long requested issue!
Gusted force-pushed gusted/version-dropdown from fba00160f5
All checks were successful
pr / preview (pull_request_target) Successful in 58s
to 1f70891aed
All checks were successful
pr / preview (pull_request_target) Successful in 1m14s
2025年07月04日 22:48:28 +02:00
Compare
Author
Owner
Copy link

fba00160f5..1f70891aed:

  • Removes the shadow on mobile.
  • Uses getRelativeLink.
https://codeberg.org/forgejo/website/compare/fba00160f5937314430605e07dcacf0f69d639fd..1f70891aedcb59fabfc4843d6f6f0f0fed028c37: - Removes the shadow on mobile. - Uses `getRelativeLink`.
0ko approved these changes 2025年07月05日 12:10:04 +02:00
0ko left a comment
Copy link

This is really cool to have. Thank you!

This is really cool to have. Thank you!
Member
Copy link

nice job! 👍

nice job! 👍
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
5 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!606
Reference in a new issue
forgejo/website
No description provided.
Delete branch "gusted/version-dropdown"

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?