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.
Add version dropdown #606
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/
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.
@mahlzahn wrote in #606 (comment):
It works, just the links point outside of the PR context.
Ah, I did not notice that.
- Can you merge the docs button with the selection menu when on docs?
Docs next vDocs v11.0 vDocs v7.0 v - 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
@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.
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}
- 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
If can't yet get it to work on touch, it can be hidden with @media (pointer: coarse).
0f074d3b6d
fba00160f5
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.
@ -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}`}
Can you use following function here? That would be really helpful in checking new contributions to docs which show up in next only.
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!
fba00160f5
1f70891aed
- Removes the shadow on mobile.
- Uses
getRelativeLink.
This is really cool to have. Thank you!
nice job! 👍
No due date set.
No dependencies set.
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?