@@ -6,5 +6,16 @@ import mdx from "@astrojs/mdx"; | |||||
// https://astro.build/config | // https://astro.build/config | ||||
export default defineConfig({ | export default defineConfig({ | ||||
integrations: [react(), tailwind(), mdx()], | |||||
trailingSlash: 'never', | |||||
output: 'static', | |||||
build: { | |||||
format: 'file', | |||||
}, | |||||
integrations: [ | |||||
react(), | |||||
tailwind({ | |||||
applyBaseStyles: false, | |||||
}), | |||||
mdx() | |||||
], | |||||
}); | }); |
@@ -10,8 +10,20 @@ export const Score: React.FC<ScoreProps> = ({ | |||||
alt, | alt, | ||||
}) => { | }) => { | ||||
return ( | return ( | ||||
<a href={`scores/${id}.musicxml`}> | |||||
<img src={`scores/${id}.svg`} alt={alt} /> | |||||
</a> | |||||
) | |||||
<div> | |||||
<a href={`scores/${id}.svg`}> | |||||
<figure> | |||||
<img className="svg" src={`scores/${id}.svg`} alt={alt} /> | |||||
<figcaption> | |||||
{alt} | |||||
</figcaption> | |||||
</figure> | |||||
</a> | |||||
<div className="screen-controls"> | |||||
<a href={`scores/${id}.musicxml`}> | |||||
Download MusicXML | |||||
</a> | |||||
</div> | |||||
</div> | |||||
); | |||||
}; | }; |
@@ -0,0 +1,120 @@ | |||||
--- | |||||
const { title } = Astro.props.frontmatter || Astro.props; | |||||
--- | |||||
<!doctype html> | |||||
<html lang="en-PH"> | |||||
<head> | |||||
<meta charset="UTF-8" /> | |||||
<meta name="viewport" content="width=device-width" /> | |||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" /> | |||||
<title>{title}</title> | |||||
<style is:global> | |||||
html { | |||||
@apply font-body; | |||||
} | |||||
body { | |||||
@apply w-full; | |||||
@apply mx-auto; | |||||
@apply max-w-screen-md; | |||||
@apply leading-relaxed; | |||||
@apply box-border; | |||||
} | |||||
p { | |||||
@apply my-6; | |||||
@apply indent-6; | |||||
@apply text-justify; | |||||
} | |||||
figure { | |||||
@apply m-0; | |||||
} | |||||
figcaption { | |||||
@apply text-center; | |||||
} | |||||
.screen-controls { | |||||
@apply flex; | |||||
@apply justify-center; | |||||
} | |||||
a:link { | |||||
@apply text-blue-600; | |||||
} | |||||
a:visited { | |||||
@apply text-purple-600; | |||||
} | |||||
@media only screen { | |||||
body { | |||||
@apply px-8; | |||||
@apply my-16; | |||||
} | |||||
} | |||||
@media only print { | |||||
head { | |||||
@apply block; | |||||
} | |||||
title { | |||||
@apply block; | |||||
@apply text-5xl; | |||||
@apply text-center; | |||||
@apply my-16; | |||||
} | |||||
body { | |||||
@apply max-w-full; | |||||
@apply m-0; | |||||
} | |||||
.screen-controls { | |||||
@apply hidden; | |||||
} | |||||
a:link { | |||||
@apply text-inherit; | |||||
@apply no-underline; | |||||
} | |||||
a:visited { | |||||
@apply text-inherit; | |||||
} | |||||
} | |||||
@media only screen and (prefers-color-scheme: dark) { | |||||
html { | |||||
@apply bg-black; | |||||
@apply text-white; | |||||
} | |||||
img.svg { | |||||
filter: invert(100%); | |||||
} | |||||
a:link { | |||||
@apply text-blue-400; | |||||
} | |||||
a:visited { | |||||
@apply text-purple-400; | |||||
} | |||||
} | |||||
@page { | |||||
margin: 2cm; | |||||
} | |||||
</style> | |||||
</head> | |||||
<body> | |||||
<slot /> | |||||
<div class=""> | |||||
</div> | |||||
</body> | |||||
</html> |
@@ -1,29 +0,0 @@ | |||||
--- | |||||
const { title } = Astro.props.frontmatter || Astro.props; | |||||
--- | |||||
<!doctype html> | |||||
<html lang="en-PH" class="font-body"> | |||||
<head> | |||||
<meta charset="UTF-8" /> | |||||
<meta name="description" content="Astro description" /> | |||||
<meta name="viewport" content="width=device-width" /> | |||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | |||||
<meta name="generator" content={Astro.generator} /> | |||||
<title>{title}</title> | |||||
<style is:global> | |||||
@import url("https://www.verovio.org/javascript/4.1.0/data/Bravura.css"); | |||||
p { | |||||
@apply my-6; | |||||
@apply indent-6; | |||||
@apply text-justify; | |||||
} | |||||
</style> | |||||
</head> | |||||
<body> | |||||
<div class="px-8 w-full mx-auto max-w-screen-md print:max-w-full print:m-0 my-16"> | |||||
<slot /> | |||||
</div> | |||||
</body> | |||||
</html> |
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
title: Introduction | title: Introduction | ||||
layout: ../layouts/Layout.astro | |||||
layout: ../layouts/Default.astro | |||||
--- | --- | ||||
Detail about me here | Detail about me here |
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
title: Trills | title: Trills | ||||
layout: ../layouts/Layout.astro | |||||
layout: ../layouts/Default.astro | |||||
--- | --- | ||||
import {Score} from '../components/Score'; | import {Score} from '../components/Score'; | ||||
@@ -1,6 +1,6 @@ | |||||
--- | --- | ||||
title: Book Name | title: Book Name | ||||
layout: ../layouts/Layout.astro | |||||
layout: ../layouts/Default.astro | |||||
--- | --- | ||||
Hello world! | Hello world! | ||||
@@ -69,7 +69,6 @@ const processOutput = (xmlData: string) => { | |||||
}; | }; | ||||
export const GET: APIRoute = async ({ params }) => { | export const GET: APIRoute = async ({ params }) => { | ||||
console.log('asdfasdf'); | |||||
const verovioModule = await createVerovioModule(); | const verovioModule = await createVerovioModule(); | ||||
const score = await readFile(`public/scores/${params.asset}.musicxml`, 'utf-8'); | const score = await readFile(`public/scores/${params.asset}.musicxml`, 'utf-8'); | ||||
const verovioToolkit = new VerovioToolkit(verovioModule); | const verovioToolkit = new VerovioToolkit(verovioModule); | ||||