Skip to content

Commit bb81935

Browse files
authored
Merge branch 'timlrx:main' into main
2 parents 620252b + 1b6f385 commit bb81935

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Internationalization support - [Template with i18n](https://tailwind-nextjs-star
6868
- [Rulli Damara Putra's Portfolio](https://www.damaraputra.my.id/) - Rully's personal blog and portfolio.
6969
- [blog.taoluyuan.com 套路猿](https://blog.taoluyuan.com) - A personal tech blog that supports multi-theme switching. 「中英」
7070
- [LyricsDecode.com](https://lyricsdecode.com) - A song lyrics website offering original lyrics, Romanisation, and English translations with customisable viewing options.
71+
- [bmacharia.com](https://bmacharia.com/) - Benson Macharia's technical blog about Cybersecurity and IT Risk Management.
7172

7273
Using the template? Feel free to create a PR and add your blog to this list.
7374

app/tags/[tag]/page.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { allBlogs } from 'contentlayer/generated'
66
import tagData from 'app/tag-data.json'
77
import { genPageMetadata } from 'app/seo'
88
import { Metadata } from 'next'
9+
import { notFound } from 'next/navigation'
910

1011
export async function generateMetadata({ params }: { params: { tag: string } }): Promise<Metadata> {
1112
const tag = decodeURI(params.tag)
@@ -37,5 +38,8 @@ export default function TagPage({ params }: { params: { tag: string } }) {
3738
const filteredPosts = allCoreContent(
3839
sortPosts(allBlogs.filter((post) => post.tags && post.tags.map((t) => slug(t)).includes(tag)))
3940
)
41+
if (filteredPosts.length === 0) {
42+
return notFound()
43+
}
4044
return <ListLayout posts={filteredPosts} title={title} />
4145
}

components/ThemeSwitch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const ThemeSwitch = () => {
5757
<div className="mr-5 flex items-center">
5858
<Menu as="div" className="relative inline-block text-left">
5959
<div className="flex items-center justify-center hover:text-primary-500 dark:hover:text-primary-400">
60-
<Menu.Button>
60+
<Menu.Button aria-label="Theme switcher">
6161
{mounted ? resolvedTheme === 'dark' ? <Moon /> : <Sun /> : <Blank />}
6262
</Menu.Button>
6363
</div>

0 commit comments

Comments
 (0)