Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add two common relative URL forms for context #34874

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

davidmcguiredesign
Copy link
Contributor

@davidmcguiredesign davidmcguiredesign commented Jul 16, 2024

Description

Add two common relative URL forms to the relative URL examples.

Motivation

<a href="page"> is a more minimal directory-relative example. In addition, I sometimes see it while browsing the general web, but I have only seen the <a href="./page"> directory-relative form in source code and developer docs. Showing the duplication could be helpful for new developers.

The <a href="../page"> parent-directory-relative example highlights the URL scheme’s basic similarity to CLI directory navigation. It also adds context to the single-dot directory-relative form.

Together, the three directory-relative examples are a better description of a part of the URL scheme that’s a common point of confusion.

### Alternative directory-relative form

I only see `<a href="./page">` in developer docs, but I occasionally see `<a href="page">` in the wild. Explicitly showing the duplication could be helpful for new developers. 

### Parent directory

The `<a href="../page">` example highlights the URL scheme’s basic similarity to CLI directory navigation. It also adds context to the single-dot directory-relative form.
@davidmcguiredesign davidmcguiredesign requested a review from a team as a code owner July 16, 2024 18:00
@davidmcguiredesign davidmcguiredesign requested review from estelle and removed request for a team July 16, 2024 18:00
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed labels Jul 16, 2024
Copy link
Contributor

Preview URLs

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@estelle estelle merged commit 6fc5ef9 into mdn:main Jul 17, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants