Added RevisionCard
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { ARTICLES, PAGES, TAGS } from '../constants/collections'
|
||||
import { ARTICLES, PAGES, RELEASES, TAGS } from '../constants/collections'
|
||||
import { createDiagnostics } from '../diagnostics'
|
||||
import type { Diagnostics } from '../diagnostics/types'
|
||||
import { createContentReader } from './reader'
|
||||
import type { ArticleEntry, Content, PageEntry, TagEntry } from './types'
|
||||
import type { ArticleEntry, Content, PageEntry, ReleaseEntry, TagEntry } from './types'
|
||||
|
||||
interface CollectionReader<T> {
|
||||
list(): Promise<string[]>
|
||||
@@ -36,10 +36,11 @@ async function readAll<T>(
|
||||
export async function loadContent(): Promise<Content> {
|
||||
const { collections } = createContentReader()
|
||||
const problems = createDiagnostics()
|
||||
const [articles, pages, tags] = await Promise.all([
|
||||
const [articles, pages, tags, releases] = await Promise.all([
|
||||
readAll<ArticleEntry>(collections.articles, ARTICLES, problems),
|
||||
readAll<PageEntry>(collections.pages, PAGES, problems),
|
||||
readAll<TagEntry>(collections.tags, TAGS, problems),
|
||||
readAll<ReleaseEntry>(collections.releases, RELEASES, problems),
|
||||
])
|
||||
return { articles, pages, tags, diagnostics: problems.list }
|
||||
return { articles, pages, tags, releases, diagnostics: problems.list }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user