From 0cc94af4ca7a3891fe375f59acd581d8e96fc1a7 Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sun, 21 Apr 2024 20:44:43 +0800 Subject: [PATCH] Update styles Add styles for print. --- astro.config.mjs | 13 +++- src/components/Score/index.tsx | 20 ++++-- src/layouts/Default.astro | 120 ++++++++++++++++++++++++++++++++ src/layouts/Layout.astro | 29 -------- src/pages/ch01-introduction.mdx | 2 +- src/pages/ch20-trills.mdx | 2 +- src/pages/index.mdx | 2 +- src/pages/scores/[asset].svg.ts | 1 - 8 files changed, 151 insertions(+), 38 deletions(-) create mode 100644 src/layouts/Default.astro delete mode 100644 src/layouts/Layout.astro diff --git a/astro.config.mjs b/astro.config.mjs index a2382f5..5481897 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -6,5 +6,16 @@ import mdx from "@astrojs/mdx"; // https://astro.build/config export default defineConfig({ - integrations: [react(), tailwind(), mdx()], + trailingSlash: 'never', + output: 'static', + build: { + format: 'file', + }, + integrations: [ + react(), + tailwind({ + applyBaseStyles: false, + }), + mdx() + ], }); diff --git a/src/components/Score/index.tsx b/src/components/Score/index.tsx index e06c922..7179c35 100644 --- a/src/components/Score/index.tsx +++ b/src/components/Score/index.tsx @@ -10,8 +10,20 @@ export const Score: React.FC = ({ alt, }) => { return ( - - {alt} - - ) +
+ +
+ {alt} +
+ {alt} +
+
+
+
+ + Download MusicXML + +
+
+ ); }; diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro new file mode 100644 index 0000000..4d15006 --- /dev/null +++ b/src/layouts/Default.astro @@ -0,0 +1,120 @@ +--- +const { title } = Astro.props.frontmatter || Astro.props; +--- + + + + + + + + {title} + + + + +
+ +
+ + diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro deleted file mode 100644 index 176e9db..0000000 --- a/src/layouts/Layout.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -const { title } = Astro.props.frontmatter || Astro.props; ---- - - - - - - - - - - {title} - - - -
- -
- - diff --git a/src/pages/ch01-introduction.mdx b/src/pages/ch01-introduction.mdx index 4d4e47c..5b47e63 100644 --- a/src/pages/ch01-introduction.mdx +++ b/src/pages/ch01-introduction.mdx @@ -1,6 +1,6 @@ --- title: Introduction -layout: ../layouts/Layout.astro +layout: ../layouts/Default.astro --- Detail about me here diff --git a/src/pages/ch20-trills.mdx b/src/pages/ch20-trills.mdx index 96a4adf..e706a52 100644 --- a/src/pages/ch20-trills.mdx +++ b/src/pages/ch20-trills.mdx @@ -1,6 +1,6 @@ --- title: Trills -layout: ../layouts/Layout.astro +layout: ../layouts/Default.astro --- import {Score} from '../components/Score'; diff --git a/src/pages/index.mdx b/src/pages/index.mdx index ec7e415..78c61dd 100644 --- a/src/pages/index.mdx +++ b/src/pages/index.mdx @@ -1,6 +1,6 @@ --- title: Book Name -layout: ../layouts/Layout.astro +layout: ../layouts/Default.astro --- Hello world! diff --git a/src/pages/scores/[asset].svg.ts b/src/pages/scores/[asset].svg.ts index bb7e071..c2b12aa 100644 --- a/src/pages/scores/[asset].svg.ts +++ b/src/pages/scores/[asset].svg.ts @@ -69,7 +69,6 @@ const processOutput = (xmlData: string) => { }; export const GET: APIRoute = async ({ params }) => { - console.log('asdfasdf'); const verovioModule = await createVerovioModule(); const score = await readFile(`public/scores/${params.asset}.musicxml`, 'utf-8'); const verovioToolkit = new VerovioToolkit(verovioModule);