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

[astro-pages.mdx] add example for internal page links #4610

Merged
merged 3 commits into from
Sep 9, 2023

Conversation

sarah11918
Copy link
Member

What kind of changes does this PR include?

  • New or updated content

Description

Adds an example when describing use an <a> tag for page links: <a href="/authors/sonali> to demonstrate that the href value should be a URL and not a file path.

@netlify
Copy link

netlify bot commented Sep 9, 2023

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit e13f269
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/64fcab1603df96000834557e
😎 Deploy Preview https://deploy-preview-4610--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

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

Hey @sarah11918, awesome job, I just have a small minor suggestion I think that the trailing slash is not required to achieve this.

Write standard HTML [`<a>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) in your Astro pages to link to other pages on your site.
Write standard HTML [`<a>` elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) in your Astro pages to link to other pages on your site. Use a **URL path relative to your root domain** as your link, not a relative file path.

For example, to link to `https://example.com/authors/sonali/` from any other page on `example.com`:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For example, to link to `https://example.com/authors/sonali/` from any other page on `example.com`:
For example, to link to `https://example.com/authors/sonali` from any other page on `example.com`:

For example, to link to `https://example.com/authors/sonali/` from any other page on `example.com`:

```astro title="src/pages/index.astro"
Read more <a href="/authors/sonali/">about Sonali</a>.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Read more <a href="/authors/sonali/">about Sonali</a>.
Read more <a href="/authors/sonali">about Sonali</a>.

Copy link
Member Author

@sarah11918 sarah11918 Sep 9, 2023

Choose a reason for hiding this comment

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

I thought about that! It's probably not required, but for example in Astro docs it is required. So I think it's safer to include it, because it won't be wrong either way!

Thank you for checking! 💜 (And, we'll see how many people complain and then decide to change it! 😂 )

@sarah11918 sarah11918 merged commit cf79740 into main Sep 9, 2023
@sarah11918 sarah11918 deleted the sarah11918-page-links branch September 9, 2023 17:42
trueberryless added a commit to trueberryless/withastro-docs that referenced this pull request Oct 22, 2024
yanthomasdev added a commit that referenced this pull request Nov 4, 2024
* update translation #1442

* update translation #1434

* update translation #1510

* update translation #1538

* Update src/content/docs/de/basics/astro-pages.mdx

* Update src/content/docs/de/basics/astro-pages.mdx

* Update src/content/docs/de/basics/astro-pages.mdx

* Update src/content/docs/de/basics/astro-pages.mdx

* Update src/content/docs/de/basics/astro-pages.mdx

* update translation #1638

* update translation #2091

* update translation #2133

* update translation #2409

* update translation #2371

* update translation #4610

* update translation #5128

* update translation #5205

* update translation #5240

* update translation #5364

* update translation #5765

* update translation #6267

* remove paragraph where I cant find when it was deleted in original version

* update translation #6620

* update translation #8495

* update translation #8573

* update translation #9336

* update translation #9336 2/2

didnt save file locally, so git didnt add

* fix all visual differences by comparing manually against original english version

* fix broken links in `astro-pages.mdx`

* Breaking changes to other files! fixing links which link to the �stro-pages.mdx file

* but now...

* Update src/content/docs/de/basics/astro-pages.mdx

Co-authored-by: Max <[email protected]>

* Update src/content/docs/de/basics/astro-pages.mdx

Co-authored-by: Max <[email protected]>

* Update src/content/docs/de/basics/astro-pages.mdx

Co-authored-by: Max <[email protected]>

* revert Update markdown-content.mdx

@lunaria-track:src/content/docs/de/basics/astro-pages.mdx

---------

Co-authored-by: Max <[email protected]>
Co-authored-by: Yan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants