Move collection description rendering to JSON (#6944)

* First pass, moving collection description rendering to JSON

* tsc

* docs

* refactor

* test
This commit is contained in:
Tom Moor
2024-05-25 18:17:19 -04:00
committed by GitHub
parent d51267b8bc
commit f103d73b48
15 changed files with 225 additions and 81 deletions

View File

@@ -1,7 +1,6 @@
import JSZip from "jszip";
import omit from "lodash/omit";
import { NavigationNode } from "@shared/types";
import { parser } from "@server/editor";
import env from "@server/env";
import Logger from "@server/logging/Logger";
import {
@@ -63,10 +62,10 @@ export default class ExportJSONTask extends ExportTask {
) {
const output: CollectionJSONExport = {
collection: {
...omit(presentCollection(collection), ["url"]),
description: collection.description
? parser.parse(collection.description)
: null,
...omit(await presentCollection(undefined, collection), [
"url",
"description",
]),
documentStructure: collection.documentStructure,
},
documents: {},