This github project has at least two git repos, the main repo and the wiki repo.
- main: https://github.com/AndyGlew/Ri5-stuff.git
- wiki https://github.com/AndyGlew/Ri5-stuff.wiki.git
I want to use relative links between the workspaces that ordinarily correspond to these repos,
- both on the github website and when I have cloned elsewhere
- e.g. so that I can clone both together and be consistent
- TBD: exact (automated) procedure to clone both repos and stay relatively consistent
Markdown syntax relative links fail:
- [[..]] - [[..]]
- [[../../wiki]] - [[../../wiki]]
Trying HTML relative links:
- FAIL: href="wiki" relative - <a href="wiki">href="wiki" relative]</a>
- fails because it resolves to https://github.com/AndyGlew/Ri5-stuff/blob/master/wiki,
- i.e. the relative position is not https://github.com/AndyGlew/Ri5-stuff but is blob/master/wiki
- which tells us what we need to know
- href="." relative underneath that.
- href=".." relative - I doubt that such an "escape upwards" will work, but... WOW! it works
- href="../.." relative
- href="../../wiki" relative YIPPEE! can link from main to wiki
- href="../../.." relative https://github.com/AndyGlew/,
- href="../../../.." relative https://github.com,
I am so used to websites not allowing ascending relative components in URLs that I wonder if there is a security hole here... Should not be as long as cannot actually escape an areas mapped to the logged in user or guest.
Recording this in two places:
- main: https://github.com/AndyGlew/Ri5-stuff/blob/master/hack-relative-URLs-in-github-project-main-repo.md
- wiki: https://github.com/AndyGlew/Ri5-stuff/wiki/hack-relative-URLs-in-github-project-wiki-repo TBD: can I CSE this stuff, transclude, to reduce duplication?
Bottom line: relative links
- from wiki
- to project "root" from wiki: href=".."
- to main from wiki: href="../blob/master/README.md"
- to user "root" from wiki: href="../.."
- from main
- to project "root" from main: href="../.."
- to user "root" from main: href="../../.."
- to wiki from main: href="../../wiki"