diff --git a/pages/blog/[year]/[month]/[day]/[slug].vue b/pages/blog/[year]/[month]/[day]/[slug].vue index 8573715..153aa4e 100644 --- a/pages/blog/[year]/[month]/[day]/[slug].vue +++ b/pages/blog/[year]/[month]/[day]/[slug].vue @@ -26,8 +26,11 @@ import type { BlogPost } from '~~/lib/types/post'; const route = useRoute(); -const { data: post, refresh } = await useFetch( - `/api/blog/${route.params.slug}` +const { data: post } = await useFetch( + `/api/blog/${route.params.slug}`, + { + key: `${route.params.slug}-post`, + } ); const isostamp = computed(() => new Date(post.value.date).toISOString()); @@ -37,8 +40,4 @@ const preview = computed(() => .replace('\n', ' ') .substring(0, 120) ); - -onMounted(() => { - refresh(); -}); diff --git a/pages/blog/archive/[year]/[month]/[day]/index.vue b/pages/blog/archive/[year]/[month]/[day]/index.vue index 1b08231..b511d1a 100644 --- a/pages/blog/archive/[year]/[month]/[day]/index.vue +++ b/pages/blog/archive/[year]/[month]/[day]/index.vue @@ -8,7 +8,8 @@ import type { BlogPost } from '~~/lib/types/post'; const route = useRoute(); -const { data: posts, refresh } = await useFetch(`/api/blog`, { +const { data: posts } = await useFetch(`/api/blog`, { + key: `${route.params.year}-${route.params.month}-${route.params.day}-page`, params: { year: route.params.year, month: route.params.month, @@ -17,8 +18,4 @@ const { data: posts, refresh } = await useFetch(`/api/blog`, { render: false, }, }); - -onMounted(() => { - refresh(); -}); diff --git a/pages/blog/archive/[year]/[month]/index.vue b/pages/blog/archive/[year]/[month]/index.vue index c3568aa..2a290c0 100644 --- a/pages/blog/archive/[year]/[month]/index.vue +++ b/pages/blog/archive/[year]/[month]/index.vue @@ -8,7 +8,8 @@ import type { BlogPost } from '~~/lib/types/post'; const route = useRoute(); -const { data: posts, refresh } = await useFetch(`/api/blog`, { +const { data: posts } = await useFetch(`/api/blog`, { + key: `${route.params.year}-${route.params.month}-page`, params: { year: route.params.year, month: route.params.month, @@ -16,8 +17,4 @@ const { data: posts, refresh } = await useFetch(`/api/blog`, { render: false, }, }); - -onMounted(() => { - refresh(); -}); diff --git a/pages/blog/archive/[year]/index.vue b/pages/blog/archive/[year]/index.vue index 61a41d5..17f6126 100644 --- a/pages/blog/archive/[year]/index.vue +++ b/pages/blog/archive/[year]/index.vue @@ -8,15 +8,12 @@ import type { BlogPost } from '~~/lib/types/post'; const route = useRoute(); -const { data: posts, refresh } = await useFetch(`/api/blog`, { +const { data: posts } = await useFetch(`/api/blog`, { + key: `${route.params.year}-archive-page`, params: { year: route.params.year, body: false, render: false, }, }); - -onMounted(() => { - refresh(); -}); diff --git a/pages/blog/archive/index.vue b/pages/blog/archive/index.vue index 52603d2..a7187c3 100644 --- a/pages/blog/archive/index.vue +++ b/pages/blog/archive/index.vue @@ -8,6 +8,7 @@ import type { BlogPost } from '~~/lib/types/post'; const { data: posts } = await useFetch(`/api/blog`, { + key: `blog-archive`, params: { body: false, render: false, diff --git a/pages/blog/tags/[tag].vue b/pages/blog/tags/[tag].vue index 87d3cbe..65c8fa5 100644 --- a/pages/blog/tags/[tag].vue +++ b/pages/blog/tags/[tag].vue @@ -8,15 +8,12 @@ import type { BlogPost } from '~~/lib/types/post'; const route = useRoute(); -const { data: posts, refresh } = await useFetch(`/api/blog`, { +const { data: posts } = await useFetch(`/api/blog`, { + key: `${route.params.tag}-tag-page`, params: { tag: route.params.tag, body: false, render: false, }, }); - -onMounted(() => { - refresh(); -});