summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorGravatar Jonathan Neal <jonathantneal@hotmail.com> 2021-11-19 15:29:27 -0500
committerGravatar GitHub <noreply@github.com> 2021-11-19 15:29:27 -0500
commitebd4a8be3ac2d5b3cfb12b89ea23cdb865d44960 (patch)
tree128e25d46cd5f6535becd2a8b840f7b96697103b /docs/src
parent16d972fe46d02ecca98009e4eba445ef8b70cf55 (diff)
downloadastro-ebd4a8be3ac2d5b3cfb12b89ea23cdb865d44960.tar.gz
astro-ebd4a8be3ac2d5b3cfb12b89ea23cdb865d44960.tar.zst
astro-ebd4a8be3ac2d5b3cfb12b89ea23cdb865d44960.zip
Docs codeblock fixes (#1931)
* Update astro & markdown code blocks for consistency * Add 'JSX in Frontmatter' note to Migration Guide * code block improvements
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/pages/es/guides/deploy.md2
-rw-r--r--docs/src/pages/es/reference/api-reference.md4
-rw-r--r--docs/src/pages/guides/aliases.md2
-rw-r--r--docs/src/pages/guides/deploy.md2
-rw-r--r--docs/src/pages/guides/imports.md2
-rw-r--r--docs/src/pages/guides/markdown-content.md12
-rw-r--r--docs/src/pages/guides/styling.md2
-rw-r--r--docs/src/pages/reference/api-reference.md4
8 files changed, 15 insertions, 15 deletions
diff --git a/docs/src/pages/es/guides/deploy.md b/docs/src/pages/es/guides/deploy.md
index 276b80d8e..0325e04f9 100644
--- a/docs/src/pages/es/guides/deploy.md
+++ b/docs/src/pages/es/guides/deploy.md
@@ -225,7 +225,7 @@ Puedes omitir el archivo `netlify.toml` e ir directamente a [Netlify](https://ne
`.firebaserc`:
- ```js
+ ```json
{
"projects": {
"default": "<YOUR_FIREBASE_ID>"
diff --git a/docs/src/pages/es/reference/api-reference.md b/docs/src/pages/es/reference/api-reference.md
index b1155ac8b..53af45c50 100644
--- a/docs/src/pages/es/reference/api-reference.md
+++ b/docs/src/pages/es/reference/api-reference.md
@@ -12,9 +12,9 @@ La variable `Astro` global está disponible en todos los contextos en los archiv
`Astro.fetchContent()` is a way to load local `*.md` files into your static site setup.
-```jsx
-// ./src/components/my-component.astro
+```astro
---
+// ./src/components/my-component.astro
const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of posts that live at ./src/pages/post/*.md
---
diff --git a/docs/src/pages/guides/aliases.md b/docs/src/pages/guides/aliases.md
index d82176a60..2ba9137f6 100644
--- a/docs/src/pages/guides/aliases.md
+++ b/docs/src/pages/guides/aliases.md
@@ -14,7 +14,7 @@ To add a custom alias to your project, locate your project `snowpack.config.mjs`
To add a new import alias, define a new `alias` entry:
-```ts
+```js
// snowpack.config.mjs
export default {
alias: {
diff --git a/docs/src/pages/guides/deploy.md b/docs/src/pages/guides/deploy.md
index 18bbb12d2..54ab5724c 100644
--- a/docs/src/pages/guides/deploy.md
+++ b/docs/src/pages/guides/deploy.md
@@ -273,7 +273,7 @@ Different from most available deploy options here, [Google Cloud](https://cloud.
`.firebaserc`:
- ```js
+ ```json
{
"projects": {
"default": "<YOUR_FIREBASE_ID>"
diff --git a/docs/src/pages/guides/imports.md b/docs/src/pages/guides/imports.md
index 35823ab84..a52d1aa9d 100644
--- a/docs/src/pages/guides/imports.md
+++ b/docs/src/pages/guides/imports.md
@@ -73,7 +73,7 @@ If you prefer not to write CSS, Astro also supports all popular CSS-in-JS librar
## CSS Modules
-```js
+```jsx
// 1. Converts './style.module.css' classnames to unique, scoped values.
// 2. Returns an object mapping the original classnames to their final, scoped value.
import styles from './style.module.css';
diff --git a/docs/src/pages/guides/markdown-content.md b/docs/src/pages/guides/markdown-content.md
index 734c308be..de7dd87d8 100644
--- a/docs/src/pages/guides/markdown-content.md
+++ b/docs/src/pages/guides/markdown-content.md
@@ -58,9 +58,9 @@ Astro treats any `.md` files inside of the `/src/pages` directory as pages. Thes
Markdown pages have a special frontmatter property for `layout`. This defines the relative path to an `.astro` component which should wrap your Markdown content, for example a [Layout](/core-concepts/layouts) component. All other frontmatter properties defined in your `.md` page will be exposed to the component as properties of the `content` prop. The rendered Markdown content is placed into the default `<slot />` element.
-```jsx
-// src/pages/index.md
+```markdown
---
+# src/pages/index.md
layout: ../../layouts/BaseLayout.astro
title: My cool page
---
@@ -68,9 +68,9 @@ title: My cool page
# Hello World!
```
-```jsx
-// src/layouts/BaseLayout.astro
+```astro
---
+// src/layouts/BaseLayout.astro
const { content } = Astro.props;
---
<html>
@@ -176,7 +176,7 @@ const expressions = 'Lorem ipsum';
- Automatic indentation normalization
- Automatic escaping of expressions inside code blocks
- ```jsx
+ ```js
// This content is not transformed!
const object = { someOtherValue };
```
@@ -185,7 +185,7 @@ const expressions = 'Lorem ipsum';
- Recursive Markdown support (Component children are also processed as Markdown)
<MyFancyCodePreview client:visible>
- ```jsx
+ ```js
const object = { someOtherValue };
```
</MyFancyCodePreview client:visible>
diff --git a/docs/src/pages/guides/styling.md b/docs/src/pages/guides/styling.md
index f355c673b..167f4fb40 100644
--- a/docs/src/pages/guides/styling.md
+++ b/docs/src/pages/guides/styling.md
@@ -567,7 +567,7 @@ So in short: stop trying to deduplicate layouts when there's nothing to deduplic
In other words, don't do this:
-```jsx
+```astro
<!-- src/components/MyComponent.astro -->
<style lang="scss">
.wrapper {
diff --git a/docs/src/pages/reference/api-reference.md b/docs/src/pages/reference/api-reference.md
index 274f0a032..ad0afd584 100644
--- a/docs/src/pages/reference/api-reference.md
+++ b/docs/src/pages/reference/api-reference.md
@@ -11,9 +11,9 @@ The `Astro` global is available in all contexts in `.astro` files. It has the fo
`Astro.fetchContent()` is a way to load local `*.md` files into your static site setup.
-```jsx
-// ./src/components/my-component.astro
+```astro
---
+// ./src/components/my-component.astro
const data = Astro.fetchContent('../pages/post/*.md'); // returns an array of posts that live at ./src/pages/post/*.md
---