how to use slugs #2557
-
I have an empty I have my blog posts in pages/deeplearning.vue <template>
<main>
<ContentList path="/deeplearning" v-slot="{ list }">
<div class="cards">
<nuxt-link
v-for="item in list"
:key="item._id"
:to="`/deeplearning/${item._path?.split('/').pop() || 'fallback-path'}`"
class="card-link"
>
<div class="card">
<h2>{{ item.title }}</h2>
<p>{{ item.description }}</p>
<p>Author: {{ item.author }}, Date: {{ new Date(item.date).toLocaleDateString() }}</p>
</div>
</nuxt-link>
</div>
</ContentList>
</main>
</template> The goal is to show markdown content on /post1 route and /post2 route here's my blog: https://github.com/AbhimanyuAryan/abhimanyuaryan.github.io |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
You would define your file as |
Beta Was this translation helpful? Give feedback.
-
<template>
<main>
<ContentDoc />
</main>
</template>
|
Beta Was this translation helpful? Give feedback.
-
Hi @farnabaz @manniL thanks for the reply. I used |
Beta Was this translation helpful? Give feedback.
-
Try moving |
Beta Was this translation helpful? Give feedback.
-
Thanks @farnabaz 🙏🏻 it worked 🎉 |
Beta Was this translation helpful? Give feedback.
Try moving
deeplearning.vue
todeeplearning/index.vue