fix: deep folder

This commit is contained in:
kmacoders 2021-07-04 15:16:30 +07:00
parent 2f2c82ba59
commit 63bae44c1c
11 changed files with 36 additions and 11 deletions

View File

@ -3,7 +3,7 @@ title: How to code
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2020-07-12'
published: '2020-02-12'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Optimize your website
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2020-06-30'
published: '2020-03-30'
---
## Getting started

View File

@ -0,0 +1,23 @@
---
title: Deep folder Vue
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS']
published: '2020-01-12'
---
## Getting started
Empower your NuxtJS application with `@nuxtjs/content` module: write in a `content/` directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a **Git-based Headless CMS**.
## Writing content
Learn how to write your `content/`, supporting Markdown, YAML, CSV and JSON: https://content.nuxtjs.org/writing.
## Fetching content
Learn how to fetch your content with `$content`: https://content.nuxtjs.org/fetching.
## Displaying content
Learn how to display your Markdown content with the `<nuxt-content>` component directly in your template: https://content.nuxtjs.org/displaying.

View File

@ -3,7 +3,7 @@ title: Fisrt Blog Post eHandy
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2021-06-30'
published: '2021-01-30'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Fisrt Blog Post eHandy
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'https://cdn.emk.dev/templates/featured-image.png'
tags: ['VueJS', 'Nuxt']
published: '2021-06-30'
published: '2021-02-30'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Fisrt Blog Post eHandy
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2021-06-30'
published: '2021-03-30'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Learn Nuxt from scratch
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2021-09-30'
published: '2021-04-30'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Placeholder image shopify
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2021-06-30'
published: '2021-05-30'
---
## Getting started

View File

@ -3,7 +3,7 @@ title: Shopify partner
description: 'Empower your NuxtJS application with @nuxt/content module: write in a content/ directory and fetch your Markdown, JSON, YAML and CSV files through a MongoDB like API, acting as a Git-based Headless CMS.'
image: 'http://placekitten.com/g/1920/1080'
tags: ['VueJS', 'Nuxt']
published: '2021-06-30'
published: '2022-06-30'
---
## Getting started

View File

@ -5,7 +5,7 @@
<div class="column is-10 is-offset-1">
<FeaturedBlog :first-blog="allArticles[0]" />
<hr>
<ListBlog :list-blogs="paginatedArticles"/>
<ListBlog :list-blogs="paginatedArticles" />
</div>
</div>
</div>

View File

@ -4,7 +4,9 @@ export default async ($content, params, error, path) => {
* Số items trên 1 page
*/
const perPage = 14
const allArticles = await $content(path).fetch()
const allArticles = await $content(path, { deep: true })
.sortBy('published', 'desc')
.fetch()
const totalArticles = allArticles.length
/**
@ -30,7 +32,7 @@ export default async ($content, params, error, path) => {
/**
* get items skip
*/
const paginatedArticles = await $content(path)
const paginatedArticles = await $content(path, { deep: true })
.only(['title', 'description', 'image', 'slug', 'tags', 'published'])
.sortBy('published', 'desc')
.limit(perPage)