I was following the instructions to have markdown content with Astro.
So I created a layout file src/layout/markdown.astro with
---
const { content } = Astro.props;
---
<html>
<head>
<title>{content.title}</title>
</head>
<body>
<slot />
</body>
</html>
And the page file src/pages/blog/test.md with
---
layout: ../../layout/markdown.astro
title: Test
---
# Hello world
But for some reason astro is trying to find the markdown.astro.js file instead:
[executing astro] CompileError: Could not find "/src/layouts/markdown.astro.js"
at load (file:///Users/me/Workspace/my-project/node_modules/astro/dist/runtime.js:177:16)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Server.<anonymous> (file:///Users/me/Workspace/my-project/node_modules/astro/dist/dev.js:21:20) {
start: { line: 1, column: 0, character: 0 },
end: undefined,
filename: '/Users/me/Workspace/my-project/blog/test/index.html',
frame: '1: \n ^'
}
My astro.config.mjs is pretty much emtpy:
// @type-check enabled!
// @ts-check
export default /** @type {import('astro').AstroUserConfig} */ ({
renderers: ['@astrojs/renderer-vue'],
buildOptions: {
site: 'https://me.github.io',
sitemap: true,
},
});
I was going to open a bug, when I decided to make a clean project and copy&paste the examples in the documentation which (with the exception of an extra ../ in the layout) work as expected.
Any idea where should I even start looking for the issue?