Skip to content

Replace absolute links with relative links #126

Description

This is a trivial issue that I should have realized much earlier. Copy and pasting links "as it is" i.e. from the address bar works, but this will cause broken links when repo transfer is made in the future.

I hope to replace all absolute links with relative links instead.

Justifications

It is known that GitHub automatically redirects those invalid URL from old_username/repository to new_username/repository. No further action is needed. But the appearance of link remain to appear "as it is" with old_username/repository, which might confuse users.

The affected files including README.md in the repository and pages on Wiki (Sigh, documentation clean up again... my mistake anyway). I will probably update to relative links in master branch only.

The difference

To understand the difference between the two types of link, see the following examples.

Write: [absolute link](https://github.com/clearkimura/Customizer/issues/126) or
Write: https://github.com/clearkimura/Customizer/issues/126

Result: absolute link or #126

Write: [relative link](126) or
Write: #126

Result: relative link or #126

Thanks to GitHub, the results are indistinguishable (Hover your mouse over the links to see any difference; There isn't any). Except, when repo transfer takes place, the relative link will be updated automatically with username of new owner. In contrast, the absolute link will show the same URL thus, rendered invalid and will be redirected to correct URL (misleading and delayed page visit).

The limitation

One thing to be careful is to ensure that the keywords are relevant to the relative link you wish to create. For example, this issue 126 is located at .../issues path of URL and this is why just typing 126 will result as .../issues/126 in the generated link.

Another way is to write #126 that will result as .../issues/126 in the generated link. Always preview the resulting text before applying the update.

However, writing with the same keyword 126 or #126 at somewhere else i.e. Wiki and repository won't give the same result. In either case, the result will be #126 in plain text. For linking from the repository, use either absolute link or relative link as one would normally do.

Must use relative links only in Wiki and future release 4.2.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions