summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/blog/astro.config.mjs8
-rw-r--r--examples/blog/src/pages/blog.astro1
-rw-r--r--examples/blog/src/pages/blog/using-mdx.mdx18
-rw-r--r--examples/blog/src/pages/index.astro20
-rw-r--r--packages/astro/src/core/preview/index.ts4
5 files changed, 30 insertions, 21 deletions
diff --git a/examples/blog/astro.config.mjs b/examples/blog/astro.config.mjs
index 10b7f177c..42d5390f5 100644
--- a/examples/blog/astro.config.mjs
+++ b/examples/blog/astro.config.mjs
@@ -1,10 +1,10 @@
import { defineConfig } from 'astro/config';
import image from '@astrojs/image';
-import mdx from "@astrojs/mdx";
+import mdx from '@astrojs/mdx';
-import sitemap from "@astrojs/sitemap";
+import sitemap from '@astrojs/sitemap';
// https://astro.build/config
export default defineConfig({
- integrations: [image(), mdx(), sitemap()]
-}); \ No newline at end of file
+ integrations: [image(), mdx(), sitemap()],
+});
diff --git a/examples/blog/src/pages/blog.astro b/examples/blog/src/pages/blog.astro
index ffc339e67..1ba45a36c 100644
--- a/examples/blog/src/pages/blog.astro
+++ b/examples/blog/src/pages/blog.astro
@@ -10,6 +10,7 @@ const posts = (await Astro.glob('./blog/*.{md,mdx}')).sort(
new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf()
);
---
+
<!DOCTYPE html>
<html lang="en-us">
<head>
diff --git a/examples/blog/src/pages/blog/using-mdx.mdx b/examples/blog/src/pages/blog/using-mdx.mdx
index b7c353bdd..f5ba282bf 100644
--- a/examples/blog/src/pages/blog/using-mdx.mdx
+++ b/examples/blog/src/pages/blog/using-mdx.mdx
@@ -1,16 +1,16 @@
---
-layout: "../../layouts/BlogPost.astro"
-title: "Using MDX"
-description: "Lorem ipsum dolor sit amet"
-publishDate: "Jul 02 2022"
-heroImage: "/assets/placeholder-hero.jpg"
+layout: '../../layouts/BlogPost.astro'
+title: 'Using MDX'
+description: 'Lorem ipsum dolor sit amet'
+publishDate: 'Jul 02 2022'
+heroImage: '/assets/placeholder-hero.jpg'
---
This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file.
## Why MDX?
-MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
+MDX is a special flavor of Markdown that supports embedded JavaScript & JSX syntax. This unlocks the ability to [mix JavaScript and UI Components into your Markdown content](https://docs.astro.build/en/guides/markdown-content/#mdx-features) for things like interactive charts or alerts.
If you have existing content authored in MDX, this integration will hopefully make migrating to Astro a breeze.
@@ -19,14 +19,14 @@ If you have existing content authored in MDX, this integration will hopefully ma
Here is how you import and use a UI component inside of MDX.
When you open this page in the browser, you should see the clickable button below.
-import HeaderLink from "../../components/HeaderLink.astro"
+import HeaderLink from '../../components/HeaderLink.astro';
<HeaderLink href="#" onclick="alert('clicked!')">
- Embedded component in MDX
+ Embedded component in MDX
</HeaderLink>
## More Links
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx)
- [Astro Usage Documentation](https://docs.astro.build/en/guides/markdown-content/#markdown-and-mdx-pages)
-- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
+- **Note:** [Client Directives](https://docs.astro.build/en/reference/directives-reference/#client-directives) are still required to create interactive components. Otherwise, all components in your MDX will render as static HTML (no JavaScript) by default.
diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro
index 28f5b2ece..4fd7a7d25 100644
--- a/examples/blog/src/pages/index.astro
+++ b/examples/blog/src/pages/index.astro
@@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
---
+
<!DOCTYPE html>
<html lang="en-us">
<head>
@@ -15,18 +16,23 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
<h1>🧑‍🚀 Hello, Astronaut!</h1>
<p>
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This
- template serves as a lightweight, minimally-styled starting point for anyone looking to build
+ template serves as a lightweight, minimally-styled starting point for anyone looking to build
a personal website, blog, or portfolio with Astro.
</p>
<p>
- Looking for a blog template with a bit more personality? Check out <a href="https://github.com/Charca/astro-blog-template">astro-blog-template</a> by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
+ Looking for a blog template with a bit more personality? Check out <a
+ href="https://github.com/Charca/astro-blog-template"
+ >astro-blog-template
+ </a> by <a href="https://twitter.com/Charca">Maxi Ferreira</a>.
</p>
<p>
- This template comes with a few integrations already configured in your
- <code>astro.config.mjs</code> file. You can customize your setup with
- <a href="https://astro.build/integrations">Astro Integrations</a> to add
- tools like Tailwind, React, or Vue to your project. Add a blog RSS feed
- with <a href="https://docs.astro.build/en/guides/rss/">@astrojs/rss</a>.
+ This template comes with a few integrations already configured in your
+ <code>astro.config.mjs</code> file. You can customize your setup with
+ <a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
+ React, or Vue to your project. Add a blog RSS feed with <a
+ href="https://docs.astro.build/en/guides/rss/"
+ >@astrojs/rss
+ </a>.
</p>
<p>Here are a few ideas on how to get started with the template:</p>
<ul>
diff --git a/packages/astro/src/core/preview/index.ts b/packages/astro/src/core/preview/index.ts
index 9453fdf65..04d5af61f 100644
--- a/packages/astro/src/core/preview/index.ts
+++ b/packages/astro/src/core/preview/index.ts
@@ -34,7 +34,9 @@ export default async function preview(
{ logging }: PreviewOptions
): Promise<PreviewServer> {
if (config.output === 'server') {
- throw new Error(`[preview] 'output: server' not supported. Use your deploy platform's preview command directly instead, if one exists. (ex: 'netlify dev', 'vercel dev', 'wrangler', etc.)`);
+ throw new Error(
+ `[preview] 'output: server' not supported. Use your deploy platform's preview command directly instead, if one exists. (ex: 'netlify dev', 'vercel dev', 'wrangler', etc.)`
+ );
}
const startServerTime = performance.now();
const defaultOrigin = 'http://localhost';