From 5ceb541bd842a96dbcd6292f2134eb5a9a7a0f67 Mon Sep 17 00:00:00 2001 From: Dennis Ideler Date: Sun, 13 Apr 2014 18:39:40 -0400 Subject: [PATCH] Add section on relative links in markdown Recommend the use of relative links over absolute links when linking to internal content. --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 88fcf69..8614873 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i - [Merged Branches](#merged-branches) - [Quick Licensing](#quick-licensing) - [TODO Lists](#todo-lists) +- [Relative Links](#relative-links) - [.gitconfig Recommendations](#gitconfig-recommendations) - [Aliases](#aliases) - [Auto-correct](#auto-correct) @@ -381,6 +382,19 @@ When they are clicked, they will be updated in the pure Markdown: - [ ] Sleep ``` +## Relative Links + +[Relative links](https://help.github.com/articles/relative-links-in-readmes) are recommended in your Markdown files when linking to internal content. + +```markdown +[Link to a header](#awesome-section) + +[Link to a file](docs/readme) +``` + +Absolute links have to be updated whenever the URL changes (e.g. repo renamed, username changed, project forked). +Using relative links makes your documentation easily stand on its own. + ## .gitconfig Recommendations Your `.gitconfig` is the file that contains all your preferences.