-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c94680d
commit e4e3fb5
Showing
5 changed files
with
193 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
--- | ||
import Layout from '../layouts/BaseLayout.astro'; | ||
import CircleGraphNavigation from '../components/CircleGraphNavigation.astro'; | ||
const allPosts = await Astro.glob('./posts/*.md'); | ||
--- | ||
|
||
<Layout title="About"> | ||
<h1>About Me</h1> | ||
<h2>... and my new Astro site!</h2> | ||
|
||
<p>I am working through Astro's introductory tutorial. This is the second page on my website, and it's the first one I built myself!</p> | ||
|
||
<p>This site will update as I complete more of the tutorial, so keep checking back and see how my journey is going!</p> | ||
<div class="prose xl:prose-xl"> | ||
<h1>About Me</h1> | ||
<h2>... and my new Astro site!</h2> | ||
|
||
<p>I am working through Astro's introductory tutorial. This is the second page on my website, and it's the first one I built myself!</p> | ||
|
||
<p>This site will update as I complete more of the tutorial, so keep checking back and see how my journey is going!</p> | ||
|
||
<p>Here is a list of all available blogposts:</p> | ||
<ul> | ||
{allPosts.map((post) => <li><a href={post.url}>{post.frontmatter.title}</a></li>)} | ||
</ul> | ||
</div> | ||
|
||
<CircleGraphNavigation /> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
import BaseLayout from '../../../layouts/BaseLayout.astro'; | ||
export async function getStaticPaths() { | ||
const allPosts: any[] = await Astro.glob('../*.md'); | ||
const uniqueTags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())]; | ||
return uniqueTags.map((tag) => { | ||
const filteredPosts = allPosts.filter((post) => post.frontmatter.tags.includes(tag)); | ||
return { | ||
params: { tag }, | ||
props: { posts: filteredPosts }, | ||
}; | ||
}); | ||
} | ||
const { tag } = Astro.params; | ||
const { posts } = Astro.props; | ||
--- | ||
|
||
<BaseLayout title={tag}> | ||
<div class="prose xl:prose-xl"> | ||
<p>Posts tagged with {tag}</p> | ||
<ul> | ||
{posts.map((post) => <li><a href={post.url}>{post.frontmatter.title}</a></li>)} | ||
</ul> | ||
</div> | ||
</BaseLayout> |