From 485742dc0dd18b6b6bef6be969b900265cac7eaa Mon Sep 17 00:00:00 2001 From: FredKSchott Date: Sat, 13 Aug 2022 07:12:04 +0000 Subject: [PATCH] [ci] format --- examples/blog/astro.config.mjs | 8 ++++---- examples/blog/src/pages/blog.astro | 1 + examples/blog/src/pages/blog/using-mdx.mdx | 18 +++++++++--------- examples/blog/src/pages/index.astro | 20 +++++++++++++------- packages/astro/src/core/preview/index.ts | 4 +++- 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() ); --- + 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'; - Embedded component in MDX + Embedded component in MDX ## 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'; --- + @@ -15,18 +16,23 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';

🧑‍🚀 Hello, Astronaut!

Welcome to the official Astro 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.

- Looking for a blog template with a bit more personality? Check out astro-blog-template by Maxi Ferreira. + Looking for a blog template with a bit more personality? Check out astro-blog-template + by Maxi Ferreira.

- This template comes with a few integrations already configured in your - astro.config.mjs file. You can customize your setup with - Astro Integrations to add - tools like Tailwind, React, or Vue to your project. Add a blog RSS feed - with @astrojs/rss. + This template comes with a few integrations already configured in your + astro.config.mjs file. You can customize your setup with + Astro Integrations to add tools like Tailwind, + React, or Vue to your project. Add a blog RSS feed with @astrojs/rss + .

Here are a few ideas on how to get started with the template: