media normalized

This commit is contained in:
2022-11-26 17:58:53 +03:00
parent 11d498c47d
commit 9ca9859563
3 changed files with 42 additions and 47 deletions

View File

@@ -4,7 +4,7 @@ from datetime import datetime, timezone
import frontmatter
from .extract import extract_html, prepare_html_body
from .extract import extract_html, prepare_html_body, extract_media
from .utils import DateTimeEncoder
OLD_DATE = "2016-03-05 22:22:00.350000"
@@ -50,11 +50,11 @@ def export_mdx(r):
def export_body(shout, storage):
entry = storage["content_items"]["by_oid"][shout["oid"]]
if entry:
shout["body"], media = prepare_html_body(entry) # prepare_md_body(entry)
shout["media"] = media
shout["body"] = prepare_html_body(entry) # prepare_md_body(entry)
shout["media"] = extract_media(entry)
export_mdx(shout)
print("[export] html for %s" % shout["slug"])
body, _media = extract_html(entry)
body = extract_html(entry)
open(contentDir + shout["slug"] + ".html", "w").write(body)
else:
raise Exception("no content_items entry found")