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/data
migration/content/**/*.md migration/content/**/*.md
.obsidian

View File

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