Skip to content

Commit 49aa5ef

Browse files
committed
Add latest changelog for Stable
1 parent a2e516b commit 49aa5ef

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

website/src/changelogs/latest.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Latest Changelog
3+
description: Changelog of the latest version of Mihon.
4+
outline: false
5+
lastUpdated: false
6+
editLink: false
7+
---
8+
9+
<script setup lang="ts">
10+
import { onMounted } from 'vue'
11+
import { useRouter } from 'vitepress'
12+
import { Octokit } from '@octokit/rest'
13+
14+
const router = useRouter()
15+
16+
onMounted(async () => {
17+
try {
18+
const octokit = new Octokit()
19+
const { data } = await octokit.repos.listReleases({
20+
owner: 'mihonapp',
21+
repo: 'mihon',
22+
per_page: 1,
23+
})
24+
25+
if (data && data.length > 0 && data[0].tag_name) {
26+
const latestTag = data[0].tag_name
27+
router.go(`/changelogs/${latestTag}`)
28+
} else {
29+
// Fallback to changelogs index if no releases found
30+
router.go('/changelogs')
31+
}
32+
} catch (error) {
33+
console.error('Failed to fetch latest release:', error)
34+
// Fallback to changelogs index on error
35+
router.go('/changelogs')
36+
}
37+
})
38+
</script>
39+
40+
<div style="text-align: center; padding: 2rem;">
41+
<p>Redirecting to the latest changelog...</p>
42+
</div>

0 commit comments

Comments
 (0)