[ci] format

This commit is contained in:
FredKSchott 2022-08-13 07:12:04 +00:00 committed by fredkbot
parent 73f367c77b
commit 485742dc0d
5 changed files with 30 additions and 21 deletions

View file

@ -1,10 +1,10 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import image from '@astrojs/image'; 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 // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [image(), mdx(), sitemap()] integrations: [image(), mdx(), sitemap()],
}); });

View file

@ -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() new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf()
); );
--- ---
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en-us"> <html lang="en-us">
<head> <head>

View file

@ -1,16 +1,16 @@
--- ---
layout: "../../layouts/BlogPost.astro" layout: '../../layouts/BlogPost.astro'
title: "Using MDX" title: 'Using MDX'
description: "Lorem ipsum dolor sit amet" description: 'Lorem ipsum dolor sit amet'
publishDate: "Jul 02 2022" publishDate: 'Jul 02 2022'
heroImage: "/assets/placeholder-hero.jpg" 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. 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? ## 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. 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. 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. 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!')"> <HeaderLink href="#" onclick="alert('clicked!')">
Embedded component in MDX Embedded component in MDX
</HeaderLink> </HeaderLink>
## More Links ## More Links
- [MDX Syntax Documentation](https://mdxjs.com/docs/what-is-mdx) - [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) - [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.

View file

@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro'; import Footer from '../components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../config'; import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
--- ---
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en-us"> <html lang="en-us">
<head> <head>
@ -15,18 +16,23 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
<h1>🧑‍🚀 Hello, Astronaut!</h1> <h1>🧑‍🚀 Hello, Astronaut!</h1>
<p> <p>
Welcome to the official <a href="https://astro.build/">Astro</a> blog starter template. This 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. a personal website, blog, or portfolio with Astro.
</p> </p>
<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>
<p> <p>
This template comes with a few integrations already configured in your This template comes with a few integrations already configured in your
<code>astro.config.mjs</code> file. You can customize your setup with <code>astro.config.mjs</code> file. You can customize your setup with
<a href="https://astro.build/integrations">Astro Integrations</a> to add <a href="https://astro.build/integrations">Astro Integrations</a> to add tools like Tailwind,
tools like Tailwind, React, or Vue to your project. Add a blog RSS feed React, or Vue to your project. Add a blog RSS feed with <a
with <a href="https://docs.astro.build/en/guides/rss/">@astrojs/rss</a>. href="https://docs.astro.build/en/guides/rss/"
>@astrojs/rss
</a>.
</p> </p>
<p>Here are a few ideas on how to get started with the template:</p> <p>Here are a few ideas on how to get started with the template:</p>
<ul> <ul>

View file

@ -34,7 +34,9 @@ export default async function preview(
{ logging }: PreviewOptions { logging }: PreviewOptions
): Promise<PreviewServer> { ): Promise<PreviewServer> {
if (config.output === 'server') { 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 startServerTime = performance.now();
const defaultOrigin = 'http://localhost'; const defaultOrigin = 'http://localhost';