diff --git a/components/category/card.vue b/components/category/card.vue
index b1fde1d..262cdef 100644
--- a/components/category/card.vue
+++ b/components/category/card.vue
@@ -1,10 +1,12 @@
-
-
-
-
-
- Recent Post
-
-
+
+
+
+
+ Recent Post
+
+
-
+
queryContent('/blogs').limit(3).sort({ _id: 1 }).find(),
)
-const formatedData = computed(() => {
+const formattedData = computed(() => {
return data.value?.map((articles) => {
return {
path: articles._path,
title: articles.title || 'no-title available',
- description: articles.description || 'no-descriptoin available',
- image: articles.image || '/nuxt-blog/no-image_cyyits.png',
+ description: articles.description || 'no-description available',
+ image: articles.image || '/not-found.jpg',
alt: articles.alt || 'no alter data available',
- ogImage: articles.ogImage || '/nuxt-blog/no-image_cyyits.png',
+ ogImage: articles.ogImage || '/not-found.jpg',
date: articles.date || 'not-date-available',
tags: articles.tags || [],
published: articles.published || false,
@@ -34,17 +34,15 @@ useHead({
-
-
-
-
-
- Trending Post
-
-
+
+
+
+
+ Trending Post
+
-
+
(() => {
return {
title: articles.value?.title || 'no-title available',
- description: articles.value?.description || 'no-descriptoin available',
- image: articles.value?.image || '/nuxt-blog/no-image_cyyits.png',
+ description: articles.value?.description || 'no-description available',
+ image: articles.value?.image || '/not-found.jpg',
alt: articles.value?.alt || 'no alter data available',
- ogImage: articles.value?.ogImage || '/nuxt-blog/no-image_cyyits.png',
+ ogImage: articles.value?.ogImage || '/not-found.jpg',
date: articles.value?.date || 'not-date-available',
tags: articles.value?.tags || [],
published: articles.value?.published || false,
diff --git a/pages/blogs/index.vue b/pages/blogs/index.vue
index 812ba99..a4d569e 100644
--- a/pages/blogs/index.vue
+++ b/pages/blogs/index.vue
@@ -1,19 +1,19 @@
-
+
import { makeFirstCharUpper } from '@/utils/helper'
-const topics = [
- 'javascript',
- 'typescript',
- 'git',
- 'docker',
- 'kubernetes',
- 'vue',
- 'nuxt',
- 'pinia',
- 'vuex',
- 'firebase',
- 'supabse',
- 'cypress',
- 'vercel',
- 'namecheap',
-]
+const { data } = await useAsyncData('all-blog-post-for-category', () => queryContent('/blogs').sort({ _id: -1 }).find())
+
+const allTags = new Map()
+
+data.value?.forEach((blog) => {
+ const tags: Array = blog.tags || []
+ tags.forEach((tag) => {
+ if (allTags.has(tag)) {
+ const cnt = allTags.get(tag)
+ allTags.set(tag, cnt + 1)
+ }
+ else {
+ allTags.set(tag, 1)
+ }
+ })
+})
useHead({
title: 'Categories',
@@ -37,7 +37,12 @@ defineOgImage()
-
+