chore: the blog (#5453)

* feat: start on blogpost

* feat: images for post

* fix: grammar + prerender news + changelog

* feat: add discovery in app vid

* fix lint

* rename new blog md to match title

* fix assets directories

* remove left over compiled files

* update thumbnail

---------

Co-authored-by: tdgao <mr.trumgao@gmail.com>
Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Calum H.
2026-03-04 01:18:08 +00:00
committed by GitHub
parent d902b281f7
commit 024e079a7d
24 changed files with 186 additions and 21 deletions

View File

@@ -111,6 +111,8 @@ export default defineNuxtConfig({
const docTemplates = Object.keys(
await import('./src/templates/docs/index.ts').then((m) => m.default),
)
const blogArticles = await import('@modrinth/blog').then((m) => m.articles)
const { getChangelog } = await import('@modrinth/utils')
nitroConfig.prerender = nitroConfig.prerender || {}
nitroConfig.prerender.routes = nitroConfig.prerender.routes || []
@@ -120,6 +122,15 @@ export default defineNuxtConfig({
for (const template of docTemplates) {
nitroConfig.prerender.routes.push(`/_internal/templates/doc/${template}`)
}
nitroConfig.prerender.routes.push('/news')
for (const article of blogArticles) {
nitroConfig.prerender.routes.push(`/news/article/${article.slug}`)
}
nitroConfig.prerender.routes.push('/news/changelog')
for (const entry of getChangelog()) {
const id = entry.version ?? entry.date.unix()
nitroConfig.prerender.routes.push(`/news/changelog/${entry.product}/${id}`)
}
},
async 'build:before'() {
// 30 minutes

View File

@@ -9,13 +9,9 @@ const changelogEntry = computed(() =>
route.params.date
? getChangelog().find((x) => {
if (x.product === route.params.product) {
console.log('Found matching product!')
if (x.version && x.version === route.params.date) {
console.log('Found matching version!')
return x
} else if (x.date.unix() === Number(route.params.date as string)) {
console.log('Found matching date!')
return x
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@@ -1,5 +1,12 @@
{
"articles": [
{
"title": "Introducing Server Projects",
"summary": "A new project type made for seamless modded multiplayer on Modrinth.",
"thumbnail": "https://modrinth.com/news/article/introducing-server-projects/thumbnail.webp",
"date": "2026-03-02T15:00:00.000Z",
"link": "https://modrinth.com/news/article/introducing-server-projects"
},
{
"title": "Streamlined Version Creation",
"summary": "Version creation is now dramatically more intelligent and easier for creators.",

File diff suppressed because one or more lines are too long