Skip to content

Commit

Permalink
[docs] Fix incorrectly relative links
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 11, 2024
1 parent 73476ac commit 8280d33
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .markdownlint/fix-renamed-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ const isRelativeLinkPossible = (link, file) => {
const linkFolder = link.split('/')[1];
const fileFolder = file.split('/')[1];

if (linkFolder === 'docs' && fileFolder === 'docs') {
if (link.match(/^\/docs\/\d\.\d\//)) {
// This is a versioned link.
// We don't want to normalise these.
return false;
}
}

// In Docusaurus, different root folders contain different plugin instances.
// Docusaurus does not support relative links between different plugins.
return linkFolder === fileFolder;
Expand Down Expand Up @@ -164,7 +172,11 @@ const getOptimisedLink = (mappings, file, currentLink, forceRelative) => {
const updatedLink = mappings[normalisedCurrentLink] ? mappings[normalisedCurrentLink] : normalisedCurrentLink;
const relativeLinkPossible = isRelativeLinkPossible(updatedLink, normalisedCurrentFile);
const forceRelativeLink = shouldForceRelativeForLink(currentLink, forceRelative);
const isRelativeLink = currentLink.startsWith('./') || currentLink.startsWith('../');

if (isRelativeLink && !relativeLinkPossible) {
return updatedLink;
}
if (updatedLink === normalisedCurrentLink && !forceRelativeLink) {
// There is no rename for this file.
// Configuration is set to _not_ force a relative link for this section.
Expand Down
6 changes: 3 additions & 3 deletions docs/devupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,6 @@ Here you can find all the functionality that has been deprecated in PHPUnit 9.x

## Previous versions

- [Moodle 4.3 developer update](./4.3/devupdate)
- [Moodle 4.2 developer update](./4.2/devupdate)
- [Moodle 4.1&4.0 developer update](./4.1/devupdate)
- [Moodle 4.3 developer update](/docs/4.3/devupdate)
- [Moodle 4.2 developer update](/docs/4.2/devupdate)
- [Moodle 4.1&4.0 developer update](/docs/4.1/devupdate)
2 changes: 1 addition & 1 deletion docs/guides/bs5migration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See more about Bootstrap 5 breaking changes in the [official documentation](http
To achieve a smoother process and facilitate the moment of the update, the migration has been divided into different steps:

1. **PopperJS upgrade**: This is the first step in the migration process, as Bootstrap 5 requires PopperJS version 2. This step is about upgrading the current PopperJS version to version 2. Because we still need PopperJS version 1 for Bootstrap 4 both versions will co-exist until all usages are migrated to v2.
2. **SCSS Deprecation process**: A SCSS deprecation process will be needed for the cleanup after BS5 upgrade. More details about it in [SCSS deprecation](../../general/development/policies/deprecation/scss-deprecation).
2. **SCSS Deprecation process**: A SCSS deprecation process will be needed for the cleanup after BS5 upgrade. More details about it in [SCSS deprecation](/general/development/policies/deprecation/scss-deprecation).
3. **Refactoring BS4 features dropped in BS5**: This step is about refactoring the current Bootstrap 4 features that will be deprecated or dropped in its version 5 and they can be replaced with current codebase.
4. **Create a BS5 "bridge"**: Some simple breaking changes could be also addressed in advance creating a BS5 "bridge". With small additions to this "bridge", we can refactor in advance the occurrences in the codebase for some dropped features in BS5.
5. **BS5 upgrade**: Upgrade the current Bootstrap 4 version to version 5.
Expand Down
2 changes: 1 addition & 1 deletion general/development/tracker/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Used to identify all issues to be listed in the release notes (minor or major).
Issues that need to be mentioned in the user documentation [under 'Possible issues that may affect you in Moodle X.0' (major versions).

- [`developer_notes`](https://tracker.moodle.org/issues/?jql=labels%20%3D%20developer_notes)<br/>
Issues that need to be mentioned in the [integration exposed forum](https://moodle.org/mod/forum/view.php?f=1153) and in the [Moodle developer update documentation](../../../docs/devupdate).
Issues that need to be mentioned in the [integration exposed forum](https://moodle.org/mod/forum/view.php?f=1153) and in the [Moodle developer update documentation](/docs/devupdate).

- `lost_functionality`<br/>
Used to identify issues describing functionality which was available in an earlier version but which is no longer available in the latest version.
Expand Down

0 comments on commit 8280d33

Please sign in to comment.