You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/en/recipes/external-links.mdx
+19-20Lines changed: 19 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,45 +16,48 @@ Using a rehype plugin, you can identify and modify links in your Markdown files
16
16
## Recipe
17
17
18
18
<Steps>
19
-
1. Install the `rehype-external-links` plugin.
19
+
1. Install both the [`rehype-external-links`](https://www.npmjs.com/package/rehype-external-links) plugin and [`@astrojs/markdown-remark`](https://www.npmjs.com/package/@astrojs/markdown-remark).
2.Configure the plugin in your `astro.config.mjs` file.
40
40
41
-
Pass `rehypeExternalLinks` to the `rehypePlugins` array, along with an options object that includes a content property. Set this property's `type` to `text` if you want to add plain text to the end of the link. To add HTML to the end of the link instead, set the property `type` to `raw`.
41
+
Import `unified()` and define it as the Markdown processor to [support remark plugins](/en/guides/markdown-content/#using-remark-and-rehype-plugins). Then, pass to `rehypePlugins`an array containing your imported `rehypeExternalLinks` plugin and an options object with a `content` property. Set this property's `type` to `text` if you want to add plain text to the end of the link. To add HTML to the end of the link instead, set the property `type` to `raw`.
@@ -63,7 +66,3 @@ Using a rehype plugin, you can identify and modify links in your Markdown files
63
66
The value of the `content` property is [not represented in the accessibility tree](https://developer.mozilla.org/en-US/docs/Web/CSS/content#accessibility_concerns). As such, it's best to make clear that the link is external in the surrounding content, rather than relying on the icon alone.
Copy file name to clipboardExpand all lines: src/content/docs/en/recipes/modified-time.mdx
+4-26Lines changed: 4 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,44 +16,22 @@ This recipe calculates time based on your repository’s Git history and may not
16
16
## Recipe
17
17
18
18
<Steps>
19
-
1. Install Helper Packages
20
-
21
-
Install [`Day.js`](https://www.npmjs.com/package/dayjs) to modify and format times:
22
-
23
-
<PackageManagerTabs>
24
-
<Fragmentslot="npm">
25
-
```shell
26
-
npm install dayjs
27
-
```
28
-
</Fragment>
29
-
<Fragmentslot="pnpm">
30
-
```shell
31
-
pnpm add dayjs
32
-
```
33
-
</Fragment>
34
-
<Fragmentslot="yarn">
35
-
```shell
36
-
yarn add dayjs
37
-
```
38
-
</Fragment>
39
-
</PackageManagerTabs>
40
-
41
-
Install [`@astrojs/markdown-remark`](https://www.npmjs.com/package/@astrojs/markdown-remark) to use [the `unified()` processor](/en/guides/markdown-content/#using-remark-and-rehype-plugins):
19
+
1. Install [`Day.js`](https://www.npmjs.com/package/dayjs) to modify and format times, and [`@astrojs/markdown-remark`](https://www.npmjs.com/package/@astrojs/markdown-remark) to use [the `unified()` processor](/en/guides/markdown-content/#using-remark-and-rehype-plugins):
Copy file name to clipboardExpand all lines: src/content/docs/en/recipes/reading-time.mdx
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,26 +12,25 @@ Create a [remark plugin](https://github.com/remarkjs/remark) which adds a readin
12
12
## Recipe
13
13
14
14
<Steps>
15
-
1. Install Helper Packages
16
-
17
-
Install these two helper packages:
15
+
1. Install the following packages:
18
16
-[`reading-time`](https://www.npmjs.com/package/reading-time) to calculate minutes read
19
17
-[`mdast-util-to-string`](https://www.npmjs.com/package/mdast-util-to-string) to extract all text from your markdown
18
+
-[`@astrojs/markdown-remark`](https://www.npmjs.com/package/@astrojs/markdown-remark) to use [the `unified()` processor](/en/guides/markdown-content/#using-remark-and-rehype-plugins):
0 commit comments