[ci] format

This commit is contained in:
FredKSchott 2022-03-24 19:32:18 +00:00 committed by GitHub Actions
parent 823d55fe46
commit bababd8461
3 changed files with 4 additions and 6 deletions

View file

@ -1,5 +1,5 @@
--- ---
title: "Markdown + Tailwind" title: 'Markdown + Tailwind'
setup: | setup: |
import Button from '../components/Button.astro'; import Button from '../components/Button.astro';
--- ---

View file

@ -17,7 +17,6 @@ import { getOutFile, getOutFolder, getOutRoot } from './common.js';
import type { PageBuildData, StaticBuildOptions } from './types'; import type { PageBuildData, StaticBuildOptions } from './types';
import { getTimeStat } from './util.js'; import { getTimeStat } from './util.js';
// Render is usually compute, which Node.js can't parallelize well. // Render is usually compute, which Node.js can't parallelize well.
// In real world testing, dropping from 10->1 showed a notiable perf // In real world testing, dropping from 10->1 showed a notiable perf
// improvement. In the future, we can revisit a smarter parallel // improvement. In the future, we can revisit a smarter parallel

View file

@ -46,7 +46,7 @@ export default function markdown({ config }: AstroPluginOptions): Plugin {
const filename = normalizeFilename(id); const filename = normalizeFilename(id);
const fileUrl = new URL(`file://${filename}`); const fileUrl = new URL(`file://${filename}`);
const isPage = fileUrl.pathname.startsWith(config.pages.pathname); const isPage = fileUrl.pathname.startsWith(config.pages.pathname);
const hasInjectedScript = (isPage && config._ctx.scripts.some((s) => s.stage === 'page-ssr')); const hasInjectedScript = isPage && config._ctx.scripts.some((s) => s.stage === 'page-ssr');
// Extract special frontmatter keys // Extract special frontmatter keys
const { layout = '', components = '', setup = '', ...content } = frontmatter; const { layout = '', components = '', setup = '', ...content } = frontmatter;
@ -68,7 +68,6 @@ ${setup}`.trim();
astroResult = `${prelude}\n${astroResult}`; astroResult = `${prelude}\n${astroResult}`;
} }
// Transform from `.astro` to valid `.ts` // Transform from `.astro` to valid `.ts`
let { code: tsResult } = await transform(astroResult, { let { code: tsResult } = await transform(astroResult, {
pathname: fileUrl.pathname.substr(config.projectRoot.pathname.length - 1), pathname: fileUrl.pathname.substr(config.projectRoot.pathname.length - 1),