diff --git a/packages/integrations/alpinejs/README.md b/packages/integrations/alpinejs/README.md index 29b2e5b09..b90ad65a8 100644 --- a/packages/integrations/alpinejs/README.md +++ b/packages/integrations/alpinejs/README.md @@ -67,7 +67,10 @@ The Alpine.js integration does not give you control over how the script is loade **It is not currently possible to [extend Alpine.js](https://alpinejs.dev/advanced/extending) when using this component.** If you need this feature, consider following [the manual Alpine.js setup](https://alpinejs.dev/essentials/installation) instead using an Astro script tag: -```astro title="src/pages/index.astro" +```astro +--- +// src/pages/index.astro +--- + ``` @@ -79,7 +80,7 @@ export default defineConfig({ integrations: [ partytown({ config: { - //options go here + // options go here }, }), ], diff --git a/packages/integrations/preact/README.md b/packages/integrations/preact/README.md index 752cb1adf..ff708bd5e 100644 --- a/packages/integrations/preact/README.md +++ b/packages/integrations/preact/README.md @@ -53,14 +53,15 @@ npm install preact Then, apply this integration to your `astro.config.*` file using the `integrations` property: -```js ins={3} "preact()" +```diff lang="js" "preact()" // astro.config.mjs import { defineConfig } from 'astro/config'; -import preact from '@astrojs/preact'; ++ import preact from '@astrojs/preact'; export default defineConfig({ // ... integrations: [preact()], + // ^^^^^^^^ }); ``` @@ -93,6 +94,7 @@ import preact from '@astrojs/preact'; export default defineConfig({ integrations: [preact({ compat: true })], + // ^^^^^^^^^^^^ }); ``` @@ -100,8 +102,7 @@ With the `compat` option enabled, the Preact integration will render React compo When importing React component libraries, in order to swap out the `react` and `react-dom` dependencies as `preact/compat`, you can use [`overrides`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides) to do so. -```json -// package.json +```json title="package.json" { "overrides": { "react": "npm:@preact/compat@latest", @@ -126,6 +127,7 @@ Use the `include` (required) and `exclude` (optional) configuration options to s We recommend placing common framework components in the same folder (e.g. `/components/react/` and `/components/solid/`) to make specifying your includes easier, but this is not required: ```js +// astro.config.mjs import { defineConfig } from 'astro/config'; import preact from '@astrojs/preact'; import react from '@astrojs/react'; diff --git a/packages/integrations/prefetch/README.md b/packages/integrations/prefetch/README.md index 5ba1d1ffe..82a608edd 100644 --- a/packages/integrations/prefetch/README.md +++ b/packages/integrations/prefetch/README.md @@ -41,15 +41,16 @@ npm install @astrojs/prefetch Then, apply this integration to your `astro.config.*` file using the `integrations` property: -```js ins={3} "prefetch()" -// astro.config.mjs -import { defineConfig } from 'astro/config'; -import prefetch from '@astrojs/prefetch'; +```diff lang="js" "prefetch()" + // astro.config.mjs + import { defineConfig } from 'astro/config'; ++ import prefetch from '@astrojs/prefetch'; -export default defineConfig({ - // ... - integrations: [prefetch()], -}); + export default defineConfig({ + // ... + integrations: [prefetch()], + // ^^^^^^^^^^ + }); ``` ## Usage diff --git a/packages/integrations/react/README.md b/packages/integrations/react/README.md index 00a574c54..d9a3b473c 100644 --- a/packages/integrations/react/README.md +++ b/packages/integrations/react/README.md @@ -42,15 +42,16 @@ npm install react react-dom Now, apply this integration to your `astro.config.*` file using the `integrations` property: -```js ins={3} "react()" -// astro.config.mjs -import { defineConfig } from 'astro/config'; -import react from '@astrojs/react'; +```diff lang="js" "react()" + // astro.config.mjs + import { defineConfig } from 'astro/config'; ++ import react from '@astrojs/react'; -export default defineConfig({ - // ... - integrations: [react()], -}); + export default defineConfig({ + // ... + integrations: [react()], + // ^^^^^^^ + }); ``` ## Getting started @@ -72,6 +73,7 @@ Use the `include` (required) and `exclude` (optional) configuration options to s We recommend placing common framework components in the same folder (e.g. `/components/react/` and `/components/solid/`) to make specifying your includes easier, but this is not required: ```js +// astro.config.mjs import { defineConfig } from 'astro/config'; import preact from '@astrojs/preact'; import react from '@astrojs/react'; diff --git a/packages/integrations/sitemap/README.md b/packages/integrations/sitemap/README.md index b2fb5e9dd..92e760303 100644 --- a/packages/integrations/sitemap/README.md +++ b/packages/integrations/sitemap/README.md @@ -48,15 +48,16 @@ npm install @astrojs/sitemap Then, apply this integration to your `astro.config.*` file using the `integrations` property: -```js ins={3} "sitemap()" -// astro.config.mjs -import { defineConfig } from 'astro/config'; -import sitemap from '@astrojs/sitemap'; +```diff lang="js" "sitemap()" + // astro.config.mjs + import { defineConfig } from 'astro/config'; ++ import sitemap from '@astrojs/sitemap'; -export default defineConfig({ - // ... - integrations: [sitemap()], -}); + export default defineConfig({ + // ... + integrations: [sitemap()], + // ^^^^^^^^^ + }); ``` ## Usage @@ -84,19 +85,19 @@ Now, [build your site for production](https://docs.astro.build/en/reference/cli- After verifying that the sitemaps are built, you can add them to your site's `
` and the `robots.txt` file for crawlers to pick up. -```html ins={3} - - - - +```diff lang="html" + + ++ + ``` - -```diff ins={4} title="public/robots.txt" -User-agent: * -Allow: / +```diff + # public/robots.txt + User-agent: * + Allow: / -Sitemap: https://