diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Head.astro | 11 | ||||
| -rw-r--r-- | src/components/Nav.astro | 29 | ||||
| -rw-r--r-- | src/components/PostList.astro | 15 |
3 files changed, 55 insertions, 0 deletions
diff --git a/src/components/Head.astro b/src/components/Head.astro new file mode 100644 index 0000000..6f96984 --- /dev/null +++ b/src/components/Head.astro @@ -0,0 +1,11 @@ +--- +const { title, description } = Astro.props.title; +--- + +<head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <title>{title}</title> + <meta name="description" content={description} /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> +</head> diff --git a/src/components/Nav.astro b/src/components/Nav.astro new file mode 100644 index 0000000..d25b180 --- /dev/null +++ b/src/components/Nav.astro @@ -0,0 +1,29 @@ +--- +const links = { + home: "/", + blog: "/blog", + github: "https://github.com/getchoo", +}; +--- + +<nav> + <div + class="flex flex-column align-center justify-center mx-auto p-5" + <ul + class="inline" + > + { + Object.entries(links).map(([link, url]) => ( + <li class="inline text-base p-2"> + <a href={url}>{link}</a> + </li> + )) + } + </div> +</nav> + +<style> + a { + @apply rounded-xl bg-yellow p-2; + } +</style> diff --git a/src/components/PostList.astro b/src/components/PostList.astro new file mode 100644 index 0000000..a537e43 --- /dev/null +++ b/src/components/PostList.astro @@ -0,0 +1,15 @@ +--- +const posts = await Astro.glob("../pages/blog/posts/*.md"); +--- + +<div> + <ul class="postList"> + { + posts.map((post) => ( + <li> + <a href={post.url}>{post.frontmatter.title}</a> + </li> + )) + } + </ul> +</div> |
