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

Added caution element to the anchor section. #8466

Merged
merged 4 commits into from
Jun 8, 2024

Conversation

nicogutz
Copy link
Contributor

@nicogutz nicogutz commented Jun 7, 2024

This will help users understand that Astro does not manage anchor elements

Description (required)

When building with a base config other than / , none of the hrefs on anchor elements are changed. This is never explicitly mentioned in the documentation. I added a caution element to inform users that they have to change it manually and gave them two main options to do so.

Related issues & labels (optional)

This will help users understand that Astro does not manage anchor elements
Copy link

vercel bot commented Jun 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ❌ Failed (Inspect) Jun 8, 2024 1:22pm

@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel 🥳

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jun 7, 2024

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

Locale File Note
en guides/routing.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Copy link
Member

@at-the-vr at-the-vr left a comment

Choose a reason for hiding this comment

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

Great PR @nicogutz 🔥🔥. LGTM 👍

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Thank you for this helpful addition, @nicogutz ! The information is absolutely great to have here! I've just changed the formatting to be more consistent with Astro Docs style!

I think the example below serves the purpose of demonstrating that base needs to be taken into account when creating URLs. Given that this is a very introductory section, and there are a variety of ways that handling the base can be accomplished, we prefer to keep the documentation simple and illustrative here.

Thank you again for this very helpful contribution, and welcome to Team Docs! 🥳

Comment on lines 18 to 23
<p>Read more <a href="/about/">about</a> Astro!</p>
```

:::caution
Changing the [base](/en/reference/configuration-reference/#base) configuration option does not change the `href` of `<a>` elements. This has to be done manually using `Astro.url` or `import.meta.env.BASE_URL` on each element.
:::
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
<p>Read more <a href="/about/">about</a> Astro!</p>
```
:::caution
Changing the [base](/en/reference/configuration-reference/#base) configuration option does not change the `href` of `<a>` elements. This has to be done manually using `Astro.url` or `import.meta.env.BASE_URL` on each element.
:::
<p>Read more <a href="/about/">about</a> Astro!</p>
<!-- With `base: "/docs"` configured -->
<p>Learn more in our <a href="/docs/reference/">reference</a> section!</p>
```

We only use caution very rarely, for things like security issues. In general, we prefer to document "how something works" properly in the first place, not add notes on like we forgot to say something. 😅

When multiple options are possible, we usually extend the code block to show more examples. I think this is helpful!

Copy link
Contributor Author

@nicogutz nicogutz Jun 8, 2024

Choose a reason for hiding this comment

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

We only use caution very rarely, for things like security issues. In general, we prefer to document "how something works" properly in the first place, not add notes on like we forgot to say something. 😅

I will keep that in mind for next time 😃 , nevertheless, the example shows the opposite of what happens, see withastro/astro#11159. The base never changes the href.

This is why I thought it was important to explicitly indicate that the anchors are not changed with the base config parameter. A user coming from other frameworks might assume that since the assets are changed by the config, then the anchors must be automatically changed as well.

@sarah11918 sarah11918 added add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)! labels Jun 8, 2024
@sarah11918 sarah11918 merged commit 344a8b7 into withastro:main Jun 8, 2024
8 checks passed
thomasbnt added a commit to thomasbnt/docs that referenced this pull request Jun 25, 2024
Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>
yanthomasdev added a commit that referenced this pull request Jun 25, 2024
* i18n(fr): Update guides/astro-db from #8478

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/backend from #8450

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/backend/google-firebase from #8422

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/cms/apostrophecms from #8480

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/cms/builderio from #8259

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/cms/directus from #8647

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/cms/ghost from #8518

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/cms/statamic from #7119

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/content-collections from #8447

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/data-fetching from #8210

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/deploy/cloudflare from #8421

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/deploy/netlify from #8233

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/deploy/render from #8233

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/deploy/vercel from #8217 (and fix little typos)

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/environment-variables from #8533

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/environment-variables from #8611

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/images from #8447 #8646

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide from #8575

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/cloudflare from #8211

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/lit from #8270

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/markdoc from #8167 (Steeeeps)

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/preact from #8644

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/react from #8038

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/integrations-guide/vue from #8295

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/markdown-content from #7218

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/markdown-content from #8167 #8239

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/middleware from #8572

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/prefetch from #8246

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/routing from #8466

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/rss from #8632

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/testing from #8369

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update guides/view-transitions from #8646

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix typo in routing.mdx

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix links ?

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix badge

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix badge

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix tabs

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Fix tabs

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* Update src/content/docs/fr/guides/environment-variables.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/integrations-guide/lit.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/integrations-guide/vue.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/markdown-content.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/middleware.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/testing.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/testing.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* Update src/content/docs/fr/guides/testing.mdx

Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>

* i18n(fr): Fix links

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): Update `tutorial/6-islands` because CI links err

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): fix links

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

* i18n(fr): fix links

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>

---------

Signed-off-by: Thomas Bonnet <thomasbnt@protonmail.com>
Co-authored-by: pioupia <49518790+pioupia@users.noreply.github.com>
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. Merge Queue Approved and ready to be merged (wait for feature release if also labelled M-O-R)!
Projects
None yet
4 participants