fix: deep folder
This commit is contained in:
parent
2f2c82ba59
commit
63bae44c1c
@ -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
|
@ -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
|
23
content/blog/2020/vue/deep-folder.md
Normal file
23
content/blog/2020/vue/deep-folder.md
Normal 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.
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user