summaryrefslogtreecommitdiff
path: root/docs/reference
diff options
context:
space:
mode:
Diffstat (limited to 'docs/reference')
-rw-r--r--docs/reference/api-reference.md25
-rw-r--r--docs/reference/builtin-components.md6
-rw-r--r--docs/reference/cli-reference.md3
-rw-r--r--docs/reference/configuration-reference.md2
-rw-r--r--docs/reference/renderer-reference.md9
5 files changed, 22 insertions, 23 deletions
diff --git a/docs/reference/api-reference.md b/docs/reference/api-reference.md
index f5e4da83c..834ab92c3 100644
--- a/docs/reference/api-reference.md
+++ b/docs/reference/api-reference.md
@@ -9,7 +9,7 @@ The `Astro` global is available in all contexts in `.astro` files. It has the fo
### `Astro.fetchContent()`
-`Astro.fetchContent()` is a way to load local `*.md` files into your static site setup. You can either use this on its own, or within [Astro Collections][docs-collections].
+`Astro.fetchContent()` is a way to load local `*.md` files into your static site setup. You can either use this on its own, or within [Astro Collections](/core-concepts/collections).
```jsx
// ./src/components/my-component.astro
@@ -65,14 +65,13 @@ const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of po
`Astro.site` returns a `URL` made from `buildOptions.site` in your Astro config. If undefined, this will return a URL generated from `localhost`.
## Collections API
-
### `collection` prop
```jsx
const { collection } = Astro.props;
```
-When using the [Collections API][docs-collections], `collection` is a prop exposed to the page with the following shape:
+When using the [Collections API](/core-concepts/collections), `collection` is a prop exposed to the page with the following shape:
| Name | Type | Description |
| :------------------------ | :-------------------: | :-------------------------------------------------------------------------------------------------------------------------------- |
@@ -103,15 +102,15 @@ export async function createCollection() {
}
```
-When using the [Collections API][docs-collections], `createCollection()` is an async function that returns an object of the following shape:
+When using the [Collections API](/core-concepts/collections), `createCollection()` is an async function that returns an object of the following shape:
-| Name | Type | Description |
-| :---------- | :---------------------------: | :--------------------------------------------------------------------------------------------------------- |
-| `data` | `async ({ params }) => any[]` | **Required.** Load an array of data with this function to be returned. |
-| `pageSize` | `number` | Specify number of items per page (default: `25`). |
-| `routes` | `params[]` | **Required for URL Params.** Return an array of all possible URL `param` values in `{ name: value }` form. |
-| `permalink` | `({ params }) => string` | **Required for URL Params.** Given a `param` object of `{ name: value }`, generate the final URL.\* |
-| `rss` | [RSS][rss] | Optional: generate an RSS 2.0 feed from this collection ([docs][rss]). |
+| Name | Type | Description |
+| :---------- | :--------------------------------------: | :--------------------------------------------------------------------------------------------------------- |
+| `data` | `async ({ params }) => any[]` | **Required.** Load an array of data with this function to be returned. |
+| `pageSize` | `number` | Specify number of items per page (default: `25`). |
+| `routes` | `params[]` | **Required for URL Params.** Return an array of all possible URL `param` values in `{ name: value }` form. |
+| `permalink` | `({ params }) => string` | **Required for URL Params.** Given a `param` object of `{ name: value }`, generate the final URL.\* |
+| `rss` | [RSS](/reference/api-reference#rss-feed) | Optional: generate an RSS 2.0 feed from this collection ([docs](/reference/api-reference#rss-feed)) |
_\* Note: don’t create confusing URLs with `permalink`, e.g. rearranging params conditionally based on their values._
@@ -177,6 +176,4 @@ export default function () {
```
[canonical]: https://en.wikipedia.org/wiki/Canonical_link_element
-[config]: ../README.md#%EF%B8%8F-configuration
-[docs-collections]: ./collections.md
-[rss]: #-rss-feed
+
diff --git a/docs/reference/builtin-components.md b/docs/reference/builtin-components.md
index 63d61ba74..109a5cba0 100644
--- a/docs/reference/builtin-components.md
+++ b/docs/reference/builtin-components.md
@@ -1,6 +1,6 @@
---
layout: ~/layouts/Main.astro
-title: Astro Builtin Components
+title: Built-In Components
---
Astro includes several builtin components for you to use in your projects. All builtin components are available via `import {} from 'astro/components';`.
@@ -16,10 +16,10 @@ import { Markdown } from 'astro/components';
</Markdown>
```
-See our [Markdown Guide](/docs/guides/markdown-content.md) for more info.
-
+See our [Markdown Guide](/guides/markdown-content) for more info.
<!-- TODO: We should move some of the specific component info here. -->
+
## `<Prism />`
```astro
diff --git a/docs/reference/cli-reference.md b/docs/reference/cli-reference.md
index b0b16c524..f8aeab7bf 100644
--- a/docs/reference/cli-reference.md
+++ b/docs/reference/cli-reference.md
@@ -7,7 +7,7 @@ title: CLI Reference
### `astro dev`
-Runs the Astro development server. This starts an HTTP server that responds to requests for pages stored in `src/pages` (or which folder is specified in your [configuration](../README.md##%EF%B8%8F-configuration)).
+Runs the Astro development server. This starts an HTTP server that responds to requests for pages stored in `src/pages` (or which folder is specified in your [configuration](/reference/configuration-reference)).
See the [dev server](./dev.md) docs for more information on how the dev server works.
@@ -21,6 +21,7 @@ Specifies should port to run on. Defaults to `3000`.
Builds your site for production.
+
## Global Flags
### `--config path`
diff --git a/docs/reference/configuration-reference.md b/docs/reference/configuration-reference.md
index 818267078..055024ca8 100644
--- a/docs/reference/configuration-reference.md
+++ b/docs/reference/configuration-reference.md
@@ -27,4 +27,4 @@ export default {
## Snowpack Config
-Astro is powered internally by Snowpack. You can configure Snowpack directly by creating a `snowpack.config.js` file. See [snowpack.dev](https://www.snowpack.dev/reference/configuration) for full documentation on this file.
+Astro is powered internally by Snowpack. You can configure Snowpack directly by creating a `snowpack.config.js` file. See [snowpack.dev](https://www.snowpack.dev/reference/configuration) for full documentation on this file. \ No newline at end of file
diff --git a/docs/reference/renderer-reference.md b/docs/reference/renderer-reference.md
index a31c64707..37e5dd4e7 100644
--- a/docs/reference/renderer-reference.md
+++ b/docs/reference/renderer-reference.md
@@ -1,6 +1,6 @@
---
layout: ~/layouts/Main.astro
-title: UI Renderers
+title: UI Renderer Reference
---
Astro is designed to support your favorite UI frameworks. [React](https://npm.im/@astrojs/renderer-react), [Svelte](https://npm.im/@astrojs/renderer-svelte), [Vue](https://npm.im/@astrojs/renderer-vue), and [Preact](https://npm.im/@astrojs/renderer-preact) are all built-in to Astro and supported out of the box. No configuration is needed to enable these.
@@ -55,10 +55,13 @@ Additionally, this entrypoint can define a [Snowpack plugin](https://www.snowpac
export default {
name: '@astrojs/renderer-xxx', // the renderer name
client: './client.js', // relative path to the client entrypoint
- server: './server.js', // relative path to the server entrypoint
+ server: './server.js', // optional, relative path to the server entrypoint
snowpackPlugin: '@snowpack/plugin-xxx', // optional, the name of a snowpack plugin to inject
snowpackPluginOptions: { example: true }, // optional, any options to be forwarded to the snowpack plugin
knownEntrypoint: ['framework'], // optional, entrypoint modules that will be used by compiled source
+ external: ['dep'] // optional, dependencies that should not be built by snowpack
+ polyfills: ['./shadow-dom-polyfill.js'] // optional, module scripts that should be loaded before client hydration.
+ hydrationPolyfills: ['./hydrate-framework.js'] // optional, polyfills that need to run before hydration ever occurs.
};
```
@@ -153,5 +156,3 @@ export default (element) => {
};
};
```
-
-[astro-config]: ./config.md