moodle / devdocs

Source of the Moodle Developer Resources and Documentation

Home Page:https://moodledev.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[chore] Change default path of next release for Moodle 4.5 onwards

andrewnicols opened this issue · comments

What do we need to do?

So as we're going to be releasing Moodle 4.4 soon and we'll start development on 4.5, I am wondering whether we should change the default path for the in-development version of the docs.

Right now we have versioned paths for released Moodle versions, that is:

  • /docs/4.3/apis
  • /docs/4.2/apis
  • /docs/4.1/apis

And we have the 'current' version (in development - main branch). That is at:

  • /docs/apis

This works fairly well but it does ahve a main pitfall, being that any link to 4.4 docs may disappear in the future as that file may be moved/etc.

The prime example is the devupdate.md file. That gets reset with each release and so the bookmark within it will (likely) change.

The alternative is that we set the path for the 'current' version to the next version of Moodle. So since Moodle 4.4 is our current development branch, we'll use that example:

  • /docs/4.3/apis - as before. 4.3 API docs
  • /docs/4.2/apis - as before. 4.2 API docs
  • /docs/4.1/apis - as before. 4.1 API docs
  • /docs/4.4/apis - the docs for the next version of Moodle.

The drawback here is that there is no /docs/apis any more. I believe that we can add a redirect so that any page not found will redirect to the 4.4 path.

I like the idea of creating docs from the beginning in the proper folder where they belong <3 That way, it will be clearer that, although the development branch is called "main" in moodle.git, all the content in that folder will be related to the unreleased next version (4.5 in our case).

So +1 to create /docs/4.5 from the beginning.

The only thing we should guarantee is that by default the content on /docs/4.5 should be displayed when accessing without selecting any specific version (so our last version should always be the default one, as we are doing now with "main") :-)

The only thing we should guarantee is that by default the content on /docs/4.5 should be displayed when accessing without selecting any specific version (so our last version should always be the default one, as we are doing now with "main") :-)

Yes - that will happen already. You can trial this locally with this change:

diff --git a/config/navbar.js b/config/navbar.js
index 342bd99db3..798c6c435e 100644
--- a/config/navbar.js
+++ b/config/navbar.js
@@ -31,7 +31,7 @@ const navbar = {
     // },
     items: [
         {
-            to: '/docs',
+            to: '/docs/4.4',
             label: 'Guides',
             position: 'left',
         },
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 96b8fd6741..fef93faa39 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -26,6 +26,7 @@ const versionConfig = Object.fromEntries(Versions.map((version) => [version, {
 }]));
 versionConfig.current = {
     label: 'main',
+    path: '4.4',
     banner: 'none',
 };

I like docs having their final location since created, plus that enables also having more than one development version (like we have had in the past) and other niceties.

And, if possible, always redirecting from un-versioned URLs to the last versioned one, please.

(And I said “redirected” on purpose)

I agree with previous comments.

  • Use versioned links to begin with
  • Unversioned links redirect to latest version