Skip to content

Commit 6b00436

Browse files
Docs: remaining integration READMEs (#2885)
* docs: partytown README * docs: sitemap README * docs: tailwind README * docs: turbolinks README * chore: changeset * update: make partytown 10% less fun Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * docs: add summaries for each integration Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
1 parent 145e418 commit 6b00436

5 files changed

Lines changed: 299 additions & 0 deletions

File tree

.changeset/swift-pets-lick.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@astrojs/partytown': patch
3+
'@astrojs/sitemap': patch
4+
'@astrojs/tailwind': patch
5+
'@astrojs/turbolinks': patch
6+
'@astrojs/lit': patch
7+
'@astrojs/preact': patch
8+
'@astrojs/react': patch
9+
'@astrojs/solid-js': patch
10+
'@astrojs/svelte': patch
11+
'@astrojs/vue': patch
12+
---
13+
14+
Add README across Astro built-in integrations
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# @astrojs/partytown 🎉
2+
3+
This **[Astro integration][astro-integration]** enables [Partytown](https://partytown.builder.io/) in your Astro project.
4+
5+
Partytown is a lazy-loaded library to help relocate resource intensive scripts into a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API), and off of the [main thread](https://developer.mozilla.org/en-US/docs/Glossary/Main_thread).
6+
7+
## Installation
8+
9+
There are two ways to add integrations to your project. Let's try the most convenient option first!
10+
11+
### (experimental) `astro add` command
12+
13+
Astro includes a CLI tool for adding first party integrations: `astro add`. This command will:
14+
1. (Optionally) Install all necessary dependencies and peer dependencies
15+
2. (Also optionally) Update your `astro.config.*` file to apply this integration
16+
17+
To install `@astrojs/partytown`, run the following from your project directory and follow the prompts:
18+
19+
```sh
20+
# Using NPM
21+
npx astro add partytown
22+
# Using Yarn
23+
yarn astro add partytown
24+
# Using PNPM
25+
pnpx astro add partytown
26+
```
27+
28+
If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below.
29+
30+
### Install dependencies manually
31+
32+
First, install the `@astrojs/partytown` integration like so:
33+
34+
```
35+
npm install @astrojs/partytown
36+
```
37+
38+
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
39+
40+
__astro.config.mjs__
41+
42+
```js
43+
import partytown from '@astrojs/partytown';
44+
45+
export default {
46+
// ...
47+
integrations: [partytown()],
48+
}
49+
```
50+
51+
## Getting started
52+
53+
Partytown should be ready-to-use with zero config. If you have an existing 3rd party script on your site, try adding the `type="text/partytown"` attribute:
54+
55+
```diff
56+
- <script src="fancy-analytics.js"></script>
57+
+ <script type="text/partytown" src="fancy-analytics.js"></script>
58+
```
59+
60+
If you open the "Network" tab from [your browser's dev tools](https://developer.chrome.com/docs/devtools/open/), you should see the `partytown` proxy intercepting this request.
61+
62+
[Head to the Partytown docs](https://partytown.builder.io/configuration) for configuration options and more usage examples. You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
63+
64+
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
65+
[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# @astrojs/sitemap 🗺
2+
3+
This **[Astro integration][astro-integration]** generates a sitemap for your Astro project.
4+
5+
Sitemaps outline all of the pages, videos, and files on your site. Search engines like Google read this file to crawl your site more efficiently. [See Google's own advice on sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/overview) to learn more.
6+
7+
## Installation
8+
9+
There are two ways to add integrations to your project. Let's try the most convenient option first!
10+
11+
### (experimental) `astro add` command
12+
13+
Astro includes a CLI tool for adding first party integrations: `astro add`. This command will:
14+
1. (Optionally) Install all necessary dependencies and peer dependencies
15+
2. (Also optionally) Update your `astro.config.*` file to apply this integration
16+
17+
To install `@astrojs/sitemap`, run the following from your project directory and follow the prompts:
18+
19+
```sh
20+
# Using NPM
21+
npx astro add sitemap
22+
# Using Yarn
23+
yarn astro add sitemap
24+
# Using PNPM
25+
pnpx astro add sitemap
26+
```
27+
28+
If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below.
29+
30+
### Install dependencies manually
31+
32+
First, install the `@astrojs/sitemap` integration like so:
33+
34+
```
35+
npm install @astrojs/sitemap
36+
```
37+
38+
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
39+
40+
__astro.config.mjs__
41+
42+
```js
43+
import sitemap from '@astrojs/sitemap';
44+
45+
export default {
46+
// ...
47+
integrations: [sitemap()],
48+
}
49+
```
50+
51+
## Getting started
52+
53+
`@astrojs/sitemap` requires a deployment / site URL for generation. Add your site's URL under your `astro.config.*` using the `buildOptions.site` property:
54+
55+
__astro.config.mjs__
56+
57+
```js
58+
import sitemap from '@astrojs/sitemap';
59+
60+
export default {
61+
// ...
62+
buildOptions: {
63+
site: 'https://stargazers.club',
64+
},
65+
integrations: [sitemap()],
66+
}
67+
```
68+
69+
Now, [build your site for production](https://docs.astro.build/en/reference/cli-reference/#astro-build) via the `astro build` command. You should find your sitemap under `dist/sitemap.xml`!
70+
71+
You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
72+
73+
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
74+
[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# @astrojs/tailwind 💨
2+
3+
This **[Astro integration][astro-integration]** brings [Tailwind CSS](https://tailwindcss.com/) to your Astro project.
4+
5+
Tailwind brings utility CSS classes for fonts, colors, layouts, transforms, and more to every Astro page or [UI component](https://docs.astro.build/en/core-concepts/framework-components/) in your project. It also includes extensive theming options for unifying your styles.
6+
7+
## Installation
8+
9+
There are two ways to add integrations to your project. Let's try the most convenient option first!
10+
11+
### (experimental) `astro add` command
12+
13+
Astro includes a CLI tool for adding first party integrations: `astro add`. This command will:
14+
1. (Optionally) Install all necessary dependencies and peer dependencies
15+
2. (Also optionally) Update your `astro.config.*` file to apply this integration
16+
17+
To install `@astrojs/tailwind`, run the following from your project directory and follow the prompts:
18+
19+
```sh
20+
# Using NPM
21+
npx astro add tailwind
22+
# Using Yarn
23+
yarn astro add tailwind
24+
# Using PNPM
25+
pnpx astro add tailwind
26+
```
27+
28+
If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below.
29+
30+
### Install dependencies manually
31+
32+
First, install the `@astrojs/tailwind` integration like so:
33+
34+
```
35+
npm install @astrojs/tailwind
36+
```
37+
38+
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
39+
40+
__astro.config.mjs__
41+
42+
```js
43+
import tailwind from '@astrojs/tailwind';
44+
45+
export default {
46+
// ...
47+
integrations: [tailwind()],
48+
}
49+
```
50+
51+
## Getting started
52+
53+
Tailwind's utility classes should be ready-to-use with zero config, including [preprocessor setup](https://tailwindcss.com/docs/using-with-preprocessors) and [production optimization](https://tailwindcss.com/docs/optimizing-for-production). Head to the [Tailwind docs](https://tailwindcss.com/docs/utility-first) to learn all of the options and features available!
54+
55+
## Configuration
56+
57+
Have a [custom theme](https://tailwindcss.com/docs/configuration)? Try adding a `tailwind.config.(js|cjs|mjs)` file to the base of your project. You can also specify a custom config file using this integration's `config.path` option:
58+
59+
__astro.config.mjs__
60+
61+
```js
62+
import tailwind from '@astrojs/tailwind';
63+
64+
export default {
65+
// ...
66+
integrations: [tailwind({
67+
config: { path: './custom-config.js' },
68+
})],
69+
}
70+
```
71+
72+
We will provide a `content` property to your config to enable Tailwind across all Astro files and [UI framework components](https://docs.astro.build/en/core-concepts/framework-components/). To remove this default, opt-out via the `config.applyAstroPreset` integration option:
73+
74+
__astro.config.mjs__
75+
76+
```js
77+
export default {
78+
// ...
79+
integrations: [tailwind({
80+
config: { applyAstroPreset: false },
81+
})],
82+
}
83+
```
84+
85+
You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
86+
87+
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
88+
[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# @astrojs/turbolinks ⚡️
2+
3+
This **[Astro integration][astro-integration]** brings [Turbo](https://github.com/hotwired/turbo) to your Astro project.
4+
5+
Turbolinks is a plug-and-play solution to bring single page app (SPA) routing to your site. This brings performant navigation without the added complexity of a client-side JavaScript framework.
6+
7+
## Installation
8+
9+
There are two ways to add integrations to your project. Let's try the most convenient option first!
10+
11+
### (experimental) `astro add` command
12+
13+
Astro includes a CLI tool for adding first party integrations: `astro add`. This command will:
14+
1. (Optionally) Install all necessary dependencies and peer dependencies
15+
2. (Also optionally) Update your `astro.config.*` file to apply this integration
16+
17+
To install `@astrojs/turbolinks`, run the following from your project directory and follow the prompts:
18+
19+
```sh
20+
# Using NPM
21+
npx astro add turbolinks
22+
# Using Yarn
23+
yarn astro add turbolinks
24+
# Using PNPM
25+
pnpx astro add turbolinks
26+
```
27+
28+
If you run into any hiccups, [feel free to log an issue on our GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below.
29+
30+
### Install dependencies manually
31+
32+
First, install the `@astrojs/turbolinks` integration like so:
33+
34+
```
35+
npm install @astrojs/turbolinks
36+
```
37+
38+
Then, apply this integration to your `astro.config.*` file using the `integrations` property:
39+
40+
__astro.config.mjs__
41+
42+
```js
43+
import turbolinks from '@astrojs/turbolinks';
44+
45+
export default {
46+
// ...
47+
integrations: [turbolinks()],
48+
}
49+
```
50+
51+
## Getting started
52+
53+
Turbo links, frames, and more should be ready-to-use with zero config. For instance, try navigating between different pages via links. You should no longer see browser refreshes! You will also find each page request passing through `turbolinks` under the "Network" tab in [your browser's dev tools](https://developer.chrome.com/docs/devtools/).
54+
55+
Head to [the Turbo handbook](https://turbo.hotwired.dev/handbook/introduction) for all options and features available. You can also check our [Astro Integration Documentation][astro-integration] for more on integrations.
56+
57+
[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/
58+
[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components

0 commit comments

Comments
 (0)