Skip to content

Commit

Permalink
Indentation fixes (#1776)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrienstra authored Oct 14, 2022
1 parent aa65b5b commit 6b72121
Show file tree
Hide file tree
Showing 18 changed files with 117 additions and 117 deletions.
16 changes: 8 additions & 8 deletions src/pages/en/concepts/islands.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ setup: |
The term "Astro Island" refers to an interactive UI component on an otherwise static page of HTML. Multiple islands can exist on a page, and an island always renders in isolation. Think of them as islands in a sea of static, non-interactive HTML.

<IslandsDiagram>
<Fragment slot="headerApp">Header (interactive island)</Fragment>
<Fragment slot="sidebarApp">Sidebar (static HTML)</Fragment>
<Fragment slot="main">
Static content like text, images, etc.
</Fragment>
<Fragment slot="carouselApp">Image carousel (interactive island)</Fragment>
<Fragment slot="footer">Footer (static HTML)</Fragment>
<Fragment slot="source">Source: [Islands Architecture: Jason Miller](https://jasonformat.com/islands-architecture/)</Fragment>
<Fragment slot="headerApp">Header (interactive island)</Fragment>
<Fragment slot="sidebarApp">Sidebar (static HTML)</Fragment>
<Fragment slot="main">
Static content like text, images, etc.
</Fragment>
<Fragment slot="carouselApp">Image carousel (interactive island)</Fragment>
<Fragment slot="footer">Footer (static HTML)</Fragment>
<Fragment slot="source">Source: [Islands Architecture: Jason Miller](https://jasonformat.com/islands-architecture/)</Fragment>
</IslandsDiagram>

In Astro, you can use any supported UI framework (React, Svelte, Vue, etc.) to render islands in the browser. You can mix and match different frameworks on the same page, or just pick your favorite.
Expand Down
10 changes: 5 additions & 5 deletions src/pages/en/core-concepts/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export const get: APIRoute = ({ params, request }) => {
};

export function getStaticPaths () {
return [
{ params: { id: "0"} },
{ params: { id: "1"} },
{ params: { id: "2"} },
]
return [
{ params: { id: "0"} },
{ params: { id: "1"} },
{ params: { id: "2"} },
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/core-concepts/layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ When a Markdown file includes a layout, it passes a `frontmatter` property to th
const {frontmatter} = Astro.props;
---
<html>
<!-- ... -->
<!-- ... -->
<h1>{frontmatter.title}</h1>
<h2>Post author: {frontmatter.author}</h2>
<p>{frontmatter.description}<p>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Check out our detailed [Why Astro](/en/concepts/why-astro/) breakdown to learn m
Visit [astro.new](https://astro.new/) and choose from a variety of templates to get started. Play around with a full, working version of Astro right in your browser!

<div style="display: flex; flex-wrap: wrap; gap: 0.5rem;">
<Button href="https://astro.new/basics?on=stackblitz">Launch basic template</Button>
<Button variant="outline" href="https://astro.new/">View all templates →</Button>
<Button href="https://astro.new/basics?on=stackblitz">Launch basic template</Button>
<Button variant="outline" href="https://astro.new/">View all templates →</Button>
</div>

## Start your first project
Expand Down
10 changes: 5 additions & 5 deletions src/pages/en/guides/data-fetching.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ import BaseLayout from '../../layouts/BaseLayout.astro';
import { createClient } from '@crystallize/js-api-client';
const apiClient = createClient({
tenantIdentifier: 'furniture'
tenantIdentifier: 'furniture'
});
const query = `
Expand All @@ -200,12 +200,12 @@ const { data: { catalogue } } = await apiClient.catalogueApi(query)
---
<BaseLayout>
<h1>{catalogue.name}</h1>
<nav>
<ul>
<nav>
<ul>
{catalogue.children.map(child => (
<li><a href={child.path}>{child.name}</a></li>
))}
</ul>
</nav>
</ul>
</nav>
</BaseLayout>
```
4 changes: 2 additions & 2 deletions src/pages/en/guides/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ By default, the build output will be placed at `dist/`. This location can be cha
:::note
Before deploying your Astro site with [SSR (server-side rendering)](/en/guides/server-side-rendering/) enabled, make sure you have:

- Installed the [appropriate adapter](/en/guides/server-side-rendering/#adding-an-adapter) to your project dependencies (either manually, or using the adapter's `astro add` command, e.g. `npx astro add netlify`).
- [Added the adapter](/en/reference/configuration-reference/#adapter) to your `astro.config.mjs` file's import and default export when installing manually. (The `astro add` command will take care of this step for you!)
- Installed the [appropriate adapter](/en/guides/server-side-rendering/#enabling-ssr-in-your-project) to your project dependencies (either manually, or using the adapter's `astro add` command, e.g. `npx astro add netlify`).
- [Added the adapter](/en/reference/configuration-reference/#integrations) to your `astro.config.mjs` file's import and default export when installing manually. (The `astro add` command will take care of this step for you!)
:::

2 changes: 1 addition & 1 deletion src/pages/en/guides/deploy/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ If you prefer to install the adapter manually instead, complete the following tw
});
```
Next, Update your `preview` script in `package.json` with the change below.
Next, Update your `preview` script in `package.json` with the change below.
```json del={8} ins={9}
// package.json
Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/guides/deploy/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ Check out [the official GitLab Pages Astro example project](https://gitlab.com/p
1. Set the correct `site` in `astro.config.mjs`.
2. Set `outDir:public` in `astro.config.mjs`. This setting instructs Astro to put the static build output in a folder called `public`, which is the folder required by GitLab Pages for exposed files.

If you were using the [`public/` directory](/en/core-concepts/project-structure/#public) as a source of static files in your Astro project, rename it and use that new folder name in `astro.config.mjs` for the value of `publicDir`.
If you were using the [`public/` directory](/en/core-concepts/project-structure/#public) as a source of static files in your Astro project, rename it and use that new folder name in `astro.config.mjs` for the value of `publicDir`.

For example, here are the correct `astro.config.mjs` settings when the `public/` directory is renamed to `static/`:
For example, here are the correct `astro.config.mjs` settings when the `public/` directory is renamed to `static/`:

```js
import { defineConfig } from 'astro/config';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/guides/integrations-guide/deno.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ If you prefer to install the adapter manually instead, complete the following tw
});
```
Next, Update your `preview` script in `package.json` with the change below.
Next, Update your `preview` script in `package.json` with the change below.
```json del={8} ins={9}
// package.json
Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/guides/integrations-guide/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ By default, transformed images will be cached to `./node_modules/.astro/image`.

```js
export default defineConfig({
integrations: [image({
integrations: [image({
// may be useful if your hosting provider allows caching between CI builds
cacheDir: "./.cache/image"
})]
Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/guides/integrations-guide/mdx.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Finally, restart the dev server.

```json title=".vscode/settings.json"
"files.associations": {
"*.mdx": "markdown"
"*.mdx": "markdown"
}
```

Expand Down
20 changes: 10 additions & 10 deletions src/pages/en/guides/integrations-guide/netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ If you prefer to install the adapter manually instead, complete the following tw
Netlify has two serverless platforms, Netlify Functions and [Netlify's experimental Edge Functions](https://docs.netlify.com/netlify-labs/experimental-features/edge-functions/#app). With Edge Functions your code is distributed closer to your users, lowering latency. You can use Edge Functions by changing the `netlify/functions` import in the Astro config file to use `netlify/edge-functions`.
```js title="astro.config.mjs" ins={3} del={2}
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';
import netlify from '@astrojs/netlify/edge-functions';
export default defineConfig({
output: 'server',
adapter: netlify(),
});
```
```js title="astro.config.mjs" ins={3} del={2}
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify/functions';
import netlify from '@astrojs/netlify/edge-functions';
export default defineConfig({
output: 'server',
adapter: netlify(),
});
```
## Usage
Expand Down
14 changes: 7 additions & 7 deletions src/pages/en/guides/markdown-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ You can use remark-rehype options in your config file like so:
export default {
markdown: {
remarkRehype: {
footnoteLabel: 'Catatan kaki',
footnoteBackLabel: 'Kembali ke konten',
},
footnoteLabel: 'Catatan kaki',
footnoteBackLabel: 'Kembali ke konten',
},
},
};
```
Expand Down Expand Up @@ -489,13 +489,13 @@ import getReadingTime from 'reading-time';
import { toString } from 'mdast-util-to-string';

export function remarkReadingTime() {
return function (tree, { data }) {
return function (tree, { data }) {
const textOnPage = toString(tree);
const readingTime = getReadingTime(textOnPage);
const readingTime = getReadingTime(textOnPage);
// readingTime.text will give us minutes read as a friendly string,
// i.e. "3 min read"
data.astro.frontmatter.minutesRead = readingTime.text;
};
data.astro.frontmatter.minutesRead = readingTime.text;
};
}
```
Expand Down
56 changes: 28 additions & 28 deletions src/pages/en/guides/rss.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ Next, import the `rss` helper from the `@astrojs/rss` package and call with the
import rss from '@astrojs/rss';
export const get = () => rss({
// `<title>` field in output xml
title: 'Buzz’s Blog',
// `<description>` field in output xml
description: 'A humble Astronaut’s guide to the stars',
// base URL for RSS <item> links
// SITE will use "site" from your project's astro.config.
site: import.meta.env.SITE,
// list of `<item>`s in output xml
// simple example: generate items for every md file in /src/pages
// see "Generating items" section for required frontmatter and advanced use cases
items: import.meta.glob('./**/*.md'),
// (optional) inject custom xml
customData: `<language>en-us</language>`,
});
// `<title>` field in output xml
title: 'Buzz’s Blog',
// `<description>` field in output xml
description: 'A humble Astronaut’s guide to the stars',
// base URL for RSS <item> links
// SITE will use "site" from your project's astro.config.
site: import.meta.env.SITE,
// list of `<item>`s in output xml
// simple example: generate items for every md file in /src/pages
// see "Generating items" section for required frontmatter and advanced use cases
items: import.meta.glob('./**/*.md'),
// (optional) inject custom xml
customData: `<language>en-us</language>`,
});
```
## Generating `items`
Expand All @@ -80,11 +80,11 @@ Say your blog posts are stored under the `src/pages/blog/` directory. You can ge
import rss from '@astrojs/rss';
export const get = () => rss({
title: 'Buzz’s Blog',
description: 'A humble Astronaut’s guide to the stars',
site: import.meta.env.SITE,
items: import.meta.glob('./blog/**/*.md'),
});
title: 'Buzz’s Blog',
description: 'A humble Astronaut’s guide to the stars',
site: import.meta.env.SITE,
items: import.meta.glob('./blog/**/*.md'),
});
```
See [Vite's glob import documentation](https://vitejs.dev/guide/features.html#glob-import) for more on this import syntax.
Expand All @@ -103,15 +103,15 @@ const postImportResult = import.meta.glob('../posts/**/*.md', { eager: true });
const posts = Object.values(postImportResult);
export const get = () => rss({
title: 'Buzz’s Blog',
description: 'A humble Astronaut’s guide to the stars',
site: import.meta.env.SITE,
items: posts.map((post) => ({
link: post.url,
title: post.frontmatter.title,
pubDate: post.frontmatter.pubDate,
}))
});
title: 'Buzz’s Blog',
description: 'A humble Astronaut’s guide to the stars',
site: import.meta.env.SITE,
items: posts.map((post) => ({
link: post.url,
title: post.frontmatter.title,
pubDate: post.frontmatter.pubDate,
}))
});
```
## Adding a stylesheet
Expand Down
14 changes: 7 additions & 7 deletions src/pages/en/guides/server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ i18nReady: true

To get started, enable SSR features in development mode with the `output: server` configuration option:

```js ins={5}
// astro.config.mjs
import { defineConfig } from 'astro/config';
```js ins={5}
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
output: 'server'
});
```
export default defineConfig({
output: 'server'
});
```

### Adding an Adapter

Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ const data = await Astro.glob<CustomDataFile>('../data/**/*.js');
const { title, date } = Astro.props;
---
<div>
<h1>{title}</h1>
<p>{date}</p>
<h1>{title}</h1>
<p>{date}</p>
</div>
```

Expand Down
4 changes: 2 additions & 2 deletions src/pages/en/reference/configuration-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Deploy to your favorite server, serverless, or edge host with build adapters. Im
import netlify from '@astrojs/netlify/functions';
{
// Example: Build for Netlify serverless deployment
adapter: netlify(),
adapter: netlify(),
}
```
**See Also:**
Expand Down Expand Up @@ -485,7 +485,7 @@ Astro applies the [GitHub-flavored Markdown](https://github.com/remarkjs/remark-
{
markdown: {
extendDefaultPlugins: true,
remarkPlugins: [exampleRemarkPlugin],
remarkPlugins: [exampleRemarkPlugin],
rehypePlugins: [exampleRehypePlugin],
}
}
Expand Down
Loading

0 comments on commit 6b72121

Please sign in to comment.