Skip to content

Commit

Permalink
fix(v5): broken link and missing type annotations in tutorial (#10119)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmandPhilippot authored Nov 30, 2024
1 parent fae1485 commit 377aa60
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/5-astro-api/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Try on your own to make all the necessary changes to your Astro project so that
<BaseLayout pageTitle={pageTitle}>
<p>This is where I will post about my journey learning Astro.</p>
<ul>
{allPosts.map((post) => <BlogPost url={post.url} title={post.frontmatter.title} />)}
{allPosts.map((post: any) => <BlogPost url={post.url} title={post.frontmatter.title} />)}
</ul>
</BaseLayout>
```
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/en/tutorial/5-astro-api/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ import BlogPost from '../../components/BlogPost.astro';
export async function getStaticPaths() {
const allPosts = Object.values(await import.meta.glob('../posts/*.md', { eager: true }));
const uniqueTags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())];
const uniqueTags = [...new Set(allPosts.map((post: any) => post.frontmatter.tags).flat())];
return uniqueTags.map((tag) => {
const filteredPosts = allPosts.filter((post) => post.frontmatter.tags.includes(tag));
const filteredPosts = allPosts.filter((post: any) => post.frontmatter.tags.includes(tag));
return {
params: { tag },
props: { posts: filteredPosts },
Expand All @@ -268,7 +268,7 @@ const { posts } = Astro.props;
<BaseLayout pageTitle={tag}>
<p>Posts tagged with {tag}</p>
<ul>
{posts.map((post) => <BlogPost url={post.url} title={post.frontmatter.title}/>)}
{posts.map((post: any) => <BlogPost url={post.url} title={post.frontmatter.title}/>)}
</ul>
</BaseLayout>
```
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/5-astro-api/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const { frontmatter } = Astro.props;
<img src={frontmatter.image.url} width="300" alt={frontmatter.image.alt} />
<div class="tags">
{frontmatter.tags.map((tag) => (
{frontmatter.tags.map((tag: string) => (
<p class="tag"><a href={`/tags/${tag}`}>{tag}</a></p>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/6-islands/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,4 @@ The tutorial blog project includes an RSS feed. This function must also use `get
}
```

For the full example of the blog tutorial using content collections, see the [Content Collections branch](https://github.com/withastro/blog-tutorial-demo/tree/content-layer) of the tutorial repo.
For the full example of the blog tutorial using content collections, see the [Content Collections branch](https://github.com/withastro/blog-tutorial-demo/tree/content-collections) of the tutorial repo.

0 comments on commit 377aa60

Please sign in to comment.