Aaron is back

This commit is contained in:
Untone 2021-10-10 15:36:57 +03:00
parent a1085d714c
commit 3172622360
2 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View File

@ -136,3 +136,4 @@ Pipfile.lock
migration/data
migration/content/**/*.md
.obsidian

View File

@ -112,7 +112,7 @@ def migrate(entry):
else:
body_html = str(BeautifulSoup(
body_orig, features="html.parser"))
r['body'] = body_html # html2text(body_html).replace('****', '**')
r['body'] = html2text(body_html).replace('****', '**')
r['old_id'] = entry.get('_id')
else:
print(r['slug'] + ': literature has no media')
@ -134,7 +134,7 @@ def migrate(entry):
if r.get('body') is None:
body_orig = entry.get('body', '')
body_html = str(BeautifulSoup(body_orig, features="html.parser"))
r['body'] = body_html # html2text(body_html).replace('****', '**')
r['body'] = html2text(body_html).replace('****', '**')
r['old_id'] = entry.get('_id')
body = r.get('body')
user = None
@ -178,7 +178,7 @@ def migrate(entry):
r['authors'].append({
'slug': slug,
'name': name,
'pic': userpic
'userpic': userpic
})
r['layout'] = type2layout[entry['type']]