diff --git a/docs/config.md b/docs/config.md index 7474109cc..dbbe311a2 100644 --- a/docs/config.md +++ b/docs/config.md @@ -4,34 +4,24 @@ To configure Astro, add an `astro.config.mjs` file in the root of your project. ```js export default { - /** Where to resolve all URLs relative to. Useful if you have a monorepo project. */ - projectRoot: '.', - /** Path to your site’s pages (routes) */ - pages: './src/pages', - /** When running `astro build`, path to final static output */ - dist: './dist', - /** A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that don’t need processing. */ - public: './public', - /** Extension-specific handlings */ - extensions: { - /** Set this to "preact" or "react" to determine what *.jsx files should load */ - '.jsx': 'react', - }, - /** Options specific to `astro build` */ + projectRoot: '.', // Where to resolve all URLs relative to. Useful if you have a monorepo project. + pages: './src/pages', // Path to Astro components, pages, and data + dist: './dist', // When running `astro build`, path to final static output + public: './public', // A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that don’t need processing. buildOptions: { - /** Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs. */ - site: '', - /** Generate sitemap (set to "false" to disable) */ - sitemap: true, + // site: '', // Your public domain, e.g.: https://my-site.dev/. Used to generate sitemaps and canonical URLs. + sitemap: true, // Generate sitemap (set to "false" to disable) }, - /** Options for the development server run with `astro dev`. */ devOptions: { - /** The port to run the dev server on. */ - port: 3000, - /** Path to tailwind.config.js if used, e.g. './tailwind.config.js' */ - tailwindConfig: undefined, + port: 3000, // The port to run the dev server on. + // tailwindConfig: '', // Path to tailwind.config.js if used, e.g. './tailwind.config.js' }, - /** default array of rendering packages inserted into runtime */ - renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-svelte', '@astrojs/renderer-vue'], + // component renderers which are enabled by default + renderers: [ + '@astrojs/renderer-svelte', + '@astrojs/renderer-vue', + '@astrojs/renderer-react', + '@astrojs/renderer-preact' + ], }; ``` diff --git a/docs/markdown.md b/docs/markdown.md index c20124096..822efb1ef 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -58,7 +58,7 @@ Astro exposes a special `Markdown` component for `.astro` files which enables ma --- // For now, this import _must_ be named "Markdown" and _must not_ be wrapped with a custom component // We're working on easing these restrictions! -import Markdown from 'astro/components/Markdown.astro'; +import { Markdown } from 'astro/components'; import Layout from '../layouts/main.astro'; import MyFancyCodePreview from '../components/MyFancyCodePreview.tsx'; @@ -101,7 +101,7 @@ If you have Markdown in a remote source, you may pass it directly to the Markdow ```jsx --- -import Markdown from 'astro/components/Markdown.astro'; +import { Markdown } from 'astro/components'; const content = await fetch('https://raw.githubusercontent.com/snowpackjs/snowpack/main/README.md').then(res => res.text()); --- @@ -115,7 +115,7 @@ Some times you might want to combine dynamic markdown with static markdown. You ```jsx --- -import Markdown from 'astro/components/Markdown.astro'; +import { Markdown } from 'astro/components'; const content = await fetch('https://raw.githubusercontent.com/snowpackjs/snowpack/main/README.md').then(res => res.text()); --- diff --git a/examples/astro-markdown/astro.config.mjs b/examples/astro-markdown/astro.config.mjs deleted file mode 100644 index a66babaf3..000000000 --- a/examples/astro-markdown/astro.config.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export default { - extensions: { - '.jsx': 'react', - '.tsx': 'preact', - }, - public: './public' -}; diff --git a/examples/astro-markdown/src/pages/index.astro b/examples/astro-markdown/src/pages/index.astro index b46f3698f..666e0557f 100644 --- a/examples/astro-markdown/src/pages/index.astro +++ b/examples/astro-markdown/src/pages/index.astro @@ -1,5 +1,5 @@ --- -import Markdown from 'astro/components/Markdown.astro'; +import { Markdown } from 'astro/components'; import Layout from '../layouts/main.astro'; import ReactCounter from '../components/ReactCounter.jsx'; import PreactCounter from '../components/PreactCounter.tsx'; diff --git a/examples/doc/astro.config.mjs b/examples/doc/astro.config.mjs index 9ba6c58c9..d97e2804d 100644 --- a/examples/doc/astro.config.mjs +++ b/examples/doc/astro.config.mjs @@ -1,5 +1,5 @@ export default { - extensions: { - '.tsx': 'preact' - } + renderers: [ + '@astrojs/renderer-preact' + ] }; diff --git a/examples/doc/src/pages/index.astro b/examples/doc/src/pages/index.astro index fe00e15a8..75ca0da4f 100644 --- a/examples/doc/src/pages/index.astro +++ b/examples/doc/src/pages/index.astro @@ -1,5 +1,5 @@ --- -import Markdown from 'astro/components/Markdown.astro'; +import { Markdown } from 'astro/components'; import Layout from '../layouts/Main.astro'; --- diff --git a/examples/portfolio/astro.config.mjs b/examples/portfolio/astro.config.mjs index f50751cfd..d97e2804d 100644 --- a/examples/portfolio/astro.config.mjs +++ b/examples/portfolio/astro.config.mjs @@ -1,5 +1,5 @@ export default { - extensions: { - '.jsx': 'preact', - }, + renderers: [ + '@astrojs/renderer-preact' + ] }; diff --git a/examples/remote-markdown/astro.config.mjs b/examples/remote-markdown/astro.config.mjs deleted file mode 100644 index c7bfe91b0..000000000 --- a/examples/remote-markdown/astro.config.mjs +++ /dev/null @@ -1,5 +0,0 @@ -export default { - extensions: { - '.jsx': 'preact' - } -} diff --git a/examples/remote-markdown/docs/dev.md b/examples/remote-markdown/docs/dev.md deleted file mode 100644 index d9223cbbd..000000000 --- a/examples/remote-markdown/docs/dev.md +++ /dev/null @@ -1,48 +0,0 @@ -# Development Server - -The development server comes as part of the Astro CLI. Start the server with: - -```shell -astro dev -``` - -In your project root. You can specify an alternative - -## Special routes - -The dev server will serve the following special routes: - -### /400 - -This is a custom **400** status code page. You can add this route by adding a page component to your `src/pages` folder: - -``` -├── src/ -│ ├── components/ -│ └── pages/ -│ └── 400.astro -``` - -For any URL you visit that doesn't have a corresponding page, the `400.astro` file will be used. - -### /500 - -This is a custom **500** status code page. You can add this route by adding a page component to your `src/pages` folder: - -```astro -├── src/ │ ├── components/ │ └── pages/ │ └── 500.astro -``` - -This page is used any time an error occurs in the dev server. - -The 500 page will receive an `error` query parameter which you can access with: - -``` ---- -const error = Astro.request.url.searchParams.get('error'); ---- - -{error} -``` - -A default error page is included with Astro so you will get pretty error messages even without adding a custom 500 page. diff --git a/examples/remote-markdown/package.json b/examples/remote-markdown/package.json deleted file mode 100644 index 1c0524bf1..000000000 --- a/examples/remote-markdown/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@example/remote-markdown", - "version": "0.0.1", - "private": true, - "scripts": { - "start": "astro dev", - "build": "astro build", - "astro-dev": "nodemon --delay 0.5 -w ../../packages/astro/dist -x '../../packages/astro/astro.mjs dev'" - }, - "devDependencies": { - "astro": "0.12.0-next.1", - "nodemon": "^2.0.7" - }, - "snowpack": { - "workspaceRoot": "../.." - } -} diff --git a/examples/remote-markdown/src/components/Yell.jsx b/examples/remote-markdown/src/components/Yell.jsx deleted file mode 100644 index 366d88a95..000000000 --- a/examples/remote-markdown/src/components/Yell.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import { h, Fragment } from 'preact'; - -export default function Yell({ children }) { - return ( - children - .filter((v) => typeof v === 'string') - .join('') - .toUpperCase() + '!' - ); -} diff --git a/examples/remote-markdown/src/layouts/main.astro b/examples/remote-markdown/src/layouts/main.astro deleted file mode 100644 index 37fcc0ee7..000000000 --- a/examples/remote-markdown/src/layouts/main.astro +++ /dev/null @@ -1,14 +0,0 @@ ---- -export let content; ---- - - -
-{JSON.stringify(content)}- - diff --git a/examples/remote-markdown/src/pages/index.astro b/examples/remote-markdown/src/pages/index.astro deleted file mode 100644 index 402780065..000000000 --- a/examples/remote-markdown/src/pages/index.astro +++ /dev/null @@ -1,72 +0,0 @@ ---- -import Markdown from 'astro/components/Markdown.astro'; -import Yell from '../components/Yell.jsx'; -const title = 'INTERPOLATED'; -const quietTest = 'interpolated'; -const content = await fetch('https://raw.githubusercontent.com/snowpackjs/snowpack/main/README.md').then(res => res.text()); ---- - - -