MCPcopy
hub / github.com/shuding/nextra / getPosts

Function getPosts

examples/blog/app/posts/get-posts.js:4–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { getPageMap } from 'nextra/page-map'
3
4export async function getPosts() {
5 const { directories } = normalizePages({
6 list: await getPageMap('/posts'),
7 route: '/posts'
8 })
9 return directories
10 .filter(post => post.name !== 'index')
11 .sort((a, b) => new Date(b.frontMatter.date) - new Date(a.frontMatter.date))
12}
13
14export async function getTags() {
15 const posts = await getPosts()

Callers 4

GETFunction · 0.90
TagPageFunction · 0.90
PostsPageFunction · 0.90
getTagsFunction · 0.85

Calls 2

normalizePagesFunction · 0.90
getPageMapFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…