From d8c206412e2bd8fb887014a773de6c2ca9d72171 Mon Sep 17 00:00:00 2001 From: keykey Date: Sat, 18 Mar 2023 23:16:32 +0800 Subject: [PATCH] Updated import.py to fit the new schema --- apps/cms/src/import/import_script.py | 48 ++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/apps/cms/src/import/import_script.py b/apps/cms/src/import/import_script.py index 6f670ce8..8b379a52 100644 --- a/apps/cms/src/import/import_script.py +++ b/apps/cms/src/import/import_script.py @@ -27,27 +27,43 @@ "title": blogs[blog]["title"], "author": blog_author, "publishedDate": blogs[blog]["date"], - "tags": [], - "content": [{"children": [{ - "text": content - }]}, - {"children": [{ - "text": "" - }]}, + "layout": [ { - "children": [{ - "type": "link", - "linkType": "custom", - "url": blogs[blog]["link"], - "children": [ + "columns": [ { - "text": blogs[blog]["link"] + "width": "full", + "alignment": "center", + "richText": [ + { + "children": [ + { + "text": content + }, + { + "text": "\n"}, + { + "type": "link", + "linkType": "custom", + "url": blogs[blog]["link"], + "children": [ + { + "text": "Link: " + blogs[blog]["link"] + } + ] + } + + ] + } + ] + } - ] - }] - } + ], + "blockType": "content" + } ], + "slug": blogs[blog]["title"], "status": "draft", + "_status": "published", "createdAt": blogs[blog]["date"], "updatedAt": blogs[blog]["date"] }, indent=4)