| 1 | diff --git a/libs/authors.ts b/libs/authors.ts |
| 2 | --- a/libs/authors.ts |
| 3 | +++ b/libs/authors.ts |
| 4 | @@ -35,9 +35,10 @@ export async function getAuthorsStaticPaths() { |
| 5 | for (const config of configs.values()) { |
| 6 | for (const locale of getLocales()) { |
| 7 | const entryAuthors = await getAllAuthors(config, locale) |
| 8 | + const cacheKey = (await getBlogEntries(config, locale)).map((entry) => entry.digest).join(':') |
| 9 | |
| 10 | for (const [, { author, entries }] of entryAuthors.entries()) { |
| 11 | - paths.push(getAuthorsStaticPath(config, entries, author, locale)) |
| 12 | + paths.push(getAuthorsStaticPath(config, entries, author, locale, cacheKey)) |
| 13 | } |
| 14 | } |
| 15 | } |
| 16 | @@ -86,12 +87,14 @@ function getAuthorsStaticPath( |
| 17 | entries: StarlightBlogEntry[], |
| 18 | author: StarlightBlogEntryAuthor, |
| 19 | locale: Locale, |
| 20 | + cacheKey: string, |
| 21 | ) { |
| 22 | return { |
| 23 | params: { |
| 24 | prefix: getPathWithLocale(config.prefix, locale), |
| 25 | author: author.slug, |
| 26 | }, |
| 27 | + cacheKey, |
| 28 | props: { |
| 29 | prefix: config.prefix, |
| 30 | author, |
| 31 | diff --git a/libs/content.ts b/libs/content.ts |
| 32 | --- a/libs/content.ts |
| 33 | +++ b/libs/content.ts |
| 34 | @@ -18,9 +18,10 @@ export async function getBlogStaticPaths() { |
| 35 | for (const locale of getLocales()) { |
| 36 | const entries = await getBlogEntries(config, locale) |
| 37 | const pages = getPaginatedBlogEntries(config, entries) |
| 38 | + const cacheKey = entries.map((entry) => entry.digest).join(':') |
| 39 | |
| 40 | for (const [index, entries] of pages.entries()) { |
| 41 | - paths.push(getBlogStaticPath(config, pages, entries, index, locale)) |
| 42 | + paths.push(getBlogStaticPath(config, pages, entries, index, locale, cacheKey)) |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | @@ -152,6 +153,7 @@ function getBlogStaticPath( |
| 47 | entries: StarlightBlogEntry[], |
| 48 | index: number, |
| 49 | locale: Locale, |
| 50 | + cacheKey: string, |
| 51 | ) { |
| 52 | const prevPage = index === 0 ? undefined : pages.at(index - 1) |
| 53 | const prevLink = prevPage ? { href: getRelativeBlogUrl(config, index === 1 ? '/' : `/${index}`, locale) } : undefined |
| 54 | @@ -164,6 +166,7 @@ function getBlogStaticPath( |
| 55 | page: index === 0 ? undefined : `${index + 1}`, |
| 56 | prefix: getPathWithLocale(config.prefix, locale), |
| 57 | }, |
| 58 | + cacheKey, |
| 59 | props: { |
| 60 | prefix: config.prefix, |
| 61 | entries, |
| 62 | diff --git a/libs/tags.ts b/libs/tags.ts |
| 63 | --- a/libs/tags.ts |
| 64 | +++ b/libs/tags.ts |
| 65 | @@ -30,9 +30,10 @@ export async function getTagsStaticPaths() { |
| 66 | for (const config of configs.values()) { |
| 67 | for (const locale of getLocales()) { |
| 68 | const entryTags = await getAllTags(config, locale) |
| 69 | + const cacheKey = (await getBlogEntries(config, locale)).map((entry) => entry.digest).join(':') |
| 70 | |
| 71 | for (const [slug, { entries, label }] of entryTags.entries()) { |
| 72 | - paths.push(getTagsStaticPath(config, entries, slug, label, locale)) |
| 73 | + paths.push(getTagsStaticPath(config, entries, slug, label, locale, cacheKey)) |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | @@ -55,12 +56,14 @@ function getTagsStaticPath( |
| 78 | slug: string, |
| 79 | label: string, |
| 80 | locale: Locale, |
| 81 | + cacheKey: string, |
| 82 | ) { |
| 83 | return { |
| 84 | params: { |
| 85 | prefix: getPathWithLocale(config.prefix, locale), |
| 86 | tag: slug, |
| 87 | }, |
| 88 | + cacheKey, |
| 89 | props: { |
| 90 | prefix: config.prefix, |
| 91 | entries, |