diff --git a/src/pages/blog.astro b/src/pages/blog.astro new file mode 100644 index 0000000..30e8225 --- /dev/null +++ b/src/pages/blog.astro @@ -0,0 +1,19 @@ +--- +const posts = await Astro.glob('./posts/*.md'); +console.log(posts[0].url); +--- + + + Blog + + +
+ {posts.map((post) => { + console.log(post.frontmatter); + return ( +

{post.frontmatter.title}

+ Read + )})} +
+ + diff --git a/src/pages/posts/hello-world.md b/src/pages/posts/hello-world.md new file mode 100644 index 0000000..5447e1e --- /dev/null +++ b/src/pages/posts/hello-world.md @@ -0,0 +1,8 @@ +--- +layout: '../../layouts/lay.astro' +title: 'Hello World' +--- + +# Hello World + +This is a simple blog post written in markdown. diff --git a/src/pages/test.md b/src/pages/test.md index dd902b2..afe796f 100644 --- a/src/pages/test.md +++ b/src/pages/test.md @@ -1,5 +1,5 @@ --- -layout: '../layouts/lay.astro' +layout: '../../layouts/lay.astro' title: 'My Markdown page' --- # Hello world