feat: add tag page
This commit is contained in:
parent
b5706dfb42
commit
b0f2e5dbb2
@ -17,13 +17,13 @@ import getSiteMeta from '@/utils/getSiteMeta'
|
||||
.fetch()
|
||||
const [blogDetail] = findedBlog
|
||||
|
||||
const [prev, next] = await $content('blog')
|
||||
const [prev, next] = await $content('blog', { deep: true })
|
||||
.only(['title', 'slug', 'published'])
|
||||
.sortBy('published', 'desc')
|
||||
.surround(params.slug)
|
||||
.fetch()
|
||||
|
||||
const allBlogs = await $content('blog')
|
||||
const allBlogs = await $content('blog', { deep: true })
|
||||
.only(['title', 'description', 'image', 'slug', 'published', 'tags'])
|
||||
.sortBy('published', 'desc')
|
||||
.fetch()
|
||||
|
@ -1,12 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="flex justify-center">
|
||||
<h2
|
||||
class="text-center text-3xl mb-4 uppercase bg-black text-white inline-block mx-auto px-2"
|
||||
>
|
||||
All Tags
|
||||
</h2>
|
||||
</div>
|
||||
<section>
|
||||
<h1>All tag</h1>
|
||||
<ul>
|
||||
<li v-for="tag in tags" :key="tag" class="text-center mb-2">
|
||||
<nuxt-link
|
||||
@ -17,7 +11,7 @@
|
||||
</nuxt-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@ -30,7 +24,8 @@ import { Vue, Component } from 'nuxt-property-decorator'
|
||||
function onlyUnique (value: string, index: number, self: string[]) {
|
||||
return self.indexOf(value) === index
|
||||
}
|
||||
const blog: IContentDocument[] = await $content('blog')
|
||||
|
||||
const blog: IContentDocument[] = await $content('blog', { deep: true })
|
||||
.only(['tags'])
|
||||
.fetch<IContentDocument[]>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user