diff options
author | 2021-08-30 15:15:20 -0600 | |
---|---|---|
committer | 2021-08-30 14:15:20 -0700 | |
commit | 5b6c52eb416a657a51ac5fffcbac92a27d7ab570 (patch) | |
tree | c25d99b698f8407486f6364bf7e50b13b6fc21b3 /docs/src/pages/reference/api-reference.md | |
parent | 3d73d7fbf246c5380b134ae72ff851c5252fd4d8 (diff) | |
download | astro-5b6c52eb416a657a51ac5fffcbac92a27d7ab570.tar.gz astro-5b6c52eb416a657a51ac5fffcbac92a27d7ab570.tar.zst astro-5b6c52eb416a657a51ac5fffcbac92a27d7ab570.zip |
Alphabetize API doc (#1270)
Diffstat (limited to 'docs/src/pages/reference/api-reference.md')
-rw-r--r-- | docs/src/pages/reference/api-reference.md | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/src/pages/reference/api-reference.md b/docs/src/pages/reference/api-reference.md index 751fbf981..a5a94f9a1 100644 --- a/docs/src/pages/reference/api-reference.md +++ b/docs/src/pages/reference/api-reference.md @@ -60,18 +60,6 @@ const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of po ⚠️ Temporary restriction: this is only accessible in top-level pages and not in sub-components. -### `Astro.site` - -`Astro.site` returns a `URL` made from `buildOptions.site` in your Astro config. If undefined, this will return a URL generated from `localhost`. - -```astro ---- -const path = Astro.site.pathname; ---- - -<h1>Welcome to {path}</h1> -``` - ### `Astro.resolve()` `Astro.resolve()` helps with creating URLs relative to the current Astro file, allowing you to reference files within your `src/` folder. @@ -88,6 +76,18 @@ The above will be sent to the browser as-is and the browser will resolve it rela <img src={Astro.resolve('../images/penguin.png')} /> ``` +### `Astro.site` + +`Astro.site` returns a `URL` made from `buildOptions.site` in your Astro config. If undefined, this will return a URL generated from `localhost`. + +```astro +--- +const path = Astro.site.pathname; +--- + +<h1>Welcome to {path}</h1> +``` + ## `getStaticPaths()` If a page uses dynamic params in the filename, that component will need to export a `getStaticPaths()` function. |