Skip to content

Commit d8e64ef

Browse files
fix(docs): replace outdated Astro docs links (#15199)
* fix: update outdated links to Astro Docs * some were correctly redirected, but might as well use the new links * some used the right page, but the section has been renamed or removed * some were no longer targeting the correct page * docs: add changeset
1 parent 220b979 commit d8e64ef

16 files changed

Lines changed: 39 additions & 33 deletions

File tree

.changeset/great-jokes-enjoy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@astrojs/language-server': patch
3+
'@astrojs/netlify': patch
4+
'@astrojs/rss': patch
5+
'astro': patch
6+
---
7+
8+
Fixes the links to Astro Docs so that they match the current docs structure.

examples/blog/src/content/blog/using-mdx.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/inte
99

1010
## Why MDX?
1111

12-
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
12+
MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/integrations-guide/mdx/#mdx-in-astro) for things like interactive charts or alerts.
1313

1414
If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
1515

@@ -27,5 +27,5 @@ import HeaderLink from '../../components/HeaderLink.astro';
2727
## More Links
2828

2929
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
30-
- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
30+
- [Astro Usage Documentation](https://docs.astro.build/en/basics/astro-pages/#markdownmdx-pages)
3131
- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.

examples/portfolio/src/layouts/BaseLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
// Learn about using Astro layouts:
3-
// https://docs.astro.build/en/core-concepts/layouts/
3+
// https://docs.astro.build/en/basics/layouts/
44
55
import Footer from '../components/Footer.astro';
66
// Component Imports

examples/portfolio/src/pages/work/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface Props {
1313
1414
// This is a dynamic route that generates a page for every Markdown file in src/content/
1515
// Read more about dynamic routes and this `getStaticPaths` function in the Astro docs:
16-
// https://docs.astro.build/en/core-concepts/routing/#dynamic-routes
16+
// https://docs.astro.build/en/guides/routing/#dynamic-routes
1717
export async function getStaticPaths() {
1818
const work = await getCollection('work');
1919
return work.map((entry) => ({

examples/with-mdx/src/pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Published on: {new Intl.DateTimeFormat('en', {dateStyle: 'long'}).format(publish
1818

1919
## Syntax highlighting
2020

21-
We also support syntax highlighting in MDX out-of-the-box! This example uses the default [Shiki](https://shiki.style) theme. See the [MDX integration docs](https://docs.astro.build/en/guides/integrations-guide/mdx/#syntax-highlighting) for configuration options.
21+
We also support syntax highlighting in MDX out-of-the-box! This example uses the default [Shiki](https://shiki.style) theme. See the [MDX integration docs](https://docs.astro.build/en/guides/integrations-guide/mdx/#configuration) for configuration options.
2222

2323
```astro
2424
---

examples/with-nanostores/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ npm create astro@latest -- --template with-nanostores
88
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/with-nanostores)
99
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/with-nanostores/devcontainer.json)
1010

11-
This example showcases using [`nanostores`](https://github.com/nanostores/nanostores) to provide shared state between components of any framework. [**Read our documentation on sharing state**](https://docs.astro.build/en/core-concepts/sharing-state/) for a complete breakdown of this project, along with guides to use React, Vue, Svelte, or Solid!
11+
This example showcases using [`nanostores`](https://github.com/nanostores/nanostores) to provide shared state between components of any framework. [**Read our documentation on sharing state**](https://docs.astro.build/en/recipes/sharing-state-islands/) for a complete breakdown of this project, along with guides to use React, Vue, Svelte, or Solid!

packages/astro-rss/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The `<description>` attribute of your RSS feed's output xml.
2626

2727
Type: `string (required)`
2828

29-
The base URL to use when generating RSS item links. We recommend using the [endpoint context object](https://docs.astro.build/en/reference/api-reference/#contextsite), which includes the `site` configured in your project's `astro.config.*`:
29+
The base URL to use when generating RSS item links. We recommend using the [endpoint context object](https://docs.astro.build/en/reference/api-reference/#site), which includes the `site` configured in your project's `astro.config.*`:
3030

3131
```ts
3232
import rss from '@astrojs/rss';
@@ -87,7 +87,7 @@ Type: `string (optional)`
8787

8888
The full text content of the item suitable for presentation as HTML. If used, you should also provide a short article summary in the `description` field.
8989

90-
To render Markdown content from a glob result or from a content collection, see the [content rendering guide](https://docs.astro.build/en/guides/rss/#including-full-post-content).
90+
To render Markdown content from a glob result or from a content collection, see the [content rendering guide](https://docs.astro.build/en/recipes/rss/#including-full-post-content).
9191

9292
#### `categories`
9393

@@ -304,10 +304,8 @@ MIT
304304

305305
Copyright (c) 2023–present [Astro][astro]
306306

307-
[docs]: https://docs.astro.build/en/guides/rss/
308-
[astro-endpoints]: https://docs.astro.build/en/core-concepts/astro-pages/#non-html-pages
307+
[docs]: https://docs.astro.build/en/recipes/rss/
309308
[astro]: https://astro.build/
310-
[docs]: https://docs.astro.build/en/guides/integrations-guide/alpinejs/
311309
[contributing]: https://github.com/withastro/astro/blob/main/CONTRIBUTING.md
312310
[coc]: https://github.com/withastro/.github/blob/main/CODE_OF_CONDUCT.md
313311
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md

packages/astro-rss/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type RSSOptions = {
1313
description: z.infer<typeof rssOptionsValidator>['description'];
1414
/**
1515
* Specify the base URL to use for RSS feed links.
16-
* We recommend using the [endpoint context object](https://docs.astro.build/en/reference/api-reference/#contextsite),
16+
* We recommend using the [endpoint context object](https://docs.astro.build/en/reference/api-reference/#site),
1717
* which includes the `site` configured in your project's `astro.config.*`
1818
*/
1919
site: z.infer<typeof rssOptionsValidator>['site'] | URL;
@@ -72,7 +72,7 @@ const rssOptionsValidator = z.object({
7272
if (!Array.isArray(items)) {
7373
console.warn(
7474
colors.yellow(
75-
'[RSS] Passing a glob result directly has been deprecated. Please migrate to the `pagesGlobToRssItems()` helper: https://docs.astro.build/en/guides/rss/',
75+
'[RSS] Passing a glob result directly has been deprecated. Please migrate to the `pagesGlobToRssItems()` helper: https://docs.astro.build/en/recipes/rss/',
7676
),
7777
);
7878
return pagesGlobToRssItems(items);
@@ -116,7 +116,7 @@ async function validateRssOptions(rssOptions: RSSOptions) {
116116
return [
117117
message,
118118
`The \`items\` property requires at least the \`title\` or \`description\` key. They must be properly typed, as well as \`pubDate\` and \`link\` keys if provided.`,
119-
`Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.`,
119+
`Check your collection's schema, and visit https://docs.astro.build/en/recipes/rss/#generating-items for more info.`,
120120
].join('\n');
121121
}
122122

@@ -133,7 +133,7 @@ export function pagesGlobToRssItems(items: GlobResult): Promise<ValidatedRSSFeed
133133
const { url, frontmatter } = await getInfo();
134134
if (url === undefined || url === null) {
135135
throw new Error(
136-
`[RSS] You can only glob entries within 'src/pages/' when passing import.meta.glob() directly. Consider mapping the result to an array of RSSFeedItems. See the RSS docs for usage examples: https://docs.astro.build/en/guides/rss/#2-list-of-rss-feed-objects`,
136+
`[RSS] You can only glob entries within 'src/pages/' when passing import.meta.glob() directly. Consider mapping the result to an array of RSSFeedItems. See the RSS docs for usage examples: https://docs.astro.build/en/recipes/rss/`,
137137
);
138138
}
139139
const parsedResult = rssSchema

packages/astro/env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Astro = import('./dist/types/public/context.js').AstroGlobal;
1111
/**
1212
* Astro global available in all contexts in .astro files
1313
*
14-
* [Astro documentation](https://docs.astro.build/en/reference/api-reference/#astro-global)
14+
* [Astro documentation](https://docs.astro.build/en/reference/api-reference/)
1515
*/
1616
declare const Astro: Readonly<Astro>;
1717

packages/astro/src/core/build/generate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,14 @@ function getInvalidRouteSegmentError(
452452
const invalidParam = /^Expected "([^"]+)"/.exec(e.message)?.[1];
453453
const received = invalidParam ? staticPath.params[invalidParam] : undefined;
454454
let hint =
455-
'Learn about dynamic routes at https://docs.astro.build/en/core-concepts/routing/#dynamic-routes';
455+
'Learn about dynamic routes at https://docs.astro.build/en/guides/routing/#dynamic-routes';
456456
if (invalidParam && typeof received === 'string') {
457457
const matchingSegment = route.segments.find(
458458
(segment) => segment[0]?.content === invalidParam,
459459
)?.[0];
460460
const mightBeMissingSpread = matchingSegment?.dynamic && !matchingSegment?.spread;
461461
if (mightBeMissingSpread) {
462-
hint = `If the param contains slashes, try using a rest parameter: **[...${invalidParam}]**. Learn more at https://docs.astro.build/en/core-concepts/routing/#dynamic-routes`;
462+
hint = `If the param contains slashes, try using a rest parameter: **[...${invalidParam}]**. Learn more at https://docs.astro.build/en/guides/routing/#dynamic-routes`;
463463
}
464464
}
465465
return new AstroError({

0 commit comments

Comments
 (0)