add category topic page
Signed-off-by: nurRiyad <asadnurriyad@gmail.com>
This commit is contained in:
@@ -27,7 +27,7 @@ const randbgcolor = ref(`${color.at(getRandomInt(0, 8))}`)
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="text-white px-5 py-3 rounded hover:underline randbgcolor">
|
<div class="text-white px-5 py-3 rounded hover:underline randbgcolor">
|
||||||
<NuxtLink to="/" class="text-xl font-extrabold">
|
<NuxtLink :to="`/categories/${title}`" class="text-xl font-extrabold">
|
||||||
<h1>#{{ title }}</h1>
|
<h1>#{{ title }}</h1>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
9
components/category/topic.vue
Normal file
9
components/category/topic.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container mx-auto">
|
||||||
|
<div class="p-6 my-4 mx-3 rounded-md bg-gray-200">
|
||||||
|
<h1 class="text-black font-semibold leading-tight text-4xl md:text-5xl my-5">
|
||||||
|
#{{ $route.params.category }}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,5 +1,23 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
useHead({
|
||||||
|
title: 'Home',
|
||||||
|
meta: [
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
content: 'Home',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
titleTemplate: "Elon's Blog - %s",
|
||||||
|
})
|
||||||
|
const { data } = await useAsyncData('home', () => queryContent('/blogs').find())
|
||||||
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<main class="container max-w-5xl mx-auto text-zinc-600">
|
||||||
<h1>Categories</h1>
|
<CategoryTopic />
|
||||||
</div>
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
||||||
|
<template v-for="n in data" :key="n">
|
||||||
|
<BlogCard :title="n.title || ''" :excerpt="n.description" image="sdlfkj" :slug="n._path" />
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user