|
|
@ -14,26 +14,37 @@ def dump():
|
|
|
|
with open(f"{path}/{folder}/contents.md", "r", encoding="utf8") as f:
|
|
|
|
with open(f"{path}/{folder}/contents.md", "r", encoding="utf8") as f:
|
|
|
|
metadata, body = frontmatter.parse(f.read())
|
|
|
|
metadata, body = frontmatter.parse(f.read())
|
|
|
|
for content in metadata["contents"]:
|
|
|
|
for content in metadata["contents"]:
|
|
|
|
if type(content) == dict and "img" in content:
|
|
|
|
if type(content) == dict:
|
|
|
|
|
|
|
|
|
|
|
|
postit = {
|
|
|
|
if "img" in content:
|
|
|
|
"title": metadata["title"],
|
|
|
|
postit = {
|
|
|
|
"description": content["alt"],
|
|
|
|
"title": metadata["title"],
|
|
|
|
"img": content["img"],
|
|
|
|
"description": content["alt"],
|
|
|
|
"slug": folder,
|
|
|
|
"img": content["img"],
|
|
|
|
}
|
|
|
|
"slug": folder,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
elif type(content) == dict and "card" in content:
|
|
|
|
elif "card" in content:
|
|
|
|
postit = {
|
|
|
|
postit = {
|
|
|
|
"title": metadata["title"],
|
|
|
|
"title": metadata["title"],
|
|
|
|
"card": content["card"],
|
|
|
|
"card": content["card"],
|
|
|
|
"quote": content["quote"],
|
|
|
|
"quote": content["quote"],
|
|
|
|
"motivation": content["motivation"],
|
|
|
|
"motivation": content["motivation"],
|
|
|
|
"vision": content["vision"],
|
|
|
|
"vision": content["vision"],
|
|
|
|
"emphaty": content["emphaty"],
|
|
|
|
"empathy": content["empathy"],
|
|
|
|
"positivity": content["positivity"],
|
|
|
|
"positivity": content["positivity"],
|
|
|
|
"slug": folder,
|
|
|
|
"slug": folder,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
elif "word" in content:
|
|
|
|
|
|
|
|
postit = {
|
|
|
|
|
|
|
|
"title": metadata["title"],
|
|
|
|
|
|
|
|
"definition": content['definition'],
|
|
|
|
|
|
|
|
"category": content['category'],
|
|
|
|
|
|
|
|
"start": content['start'],
|
|
|
|
|
|
|
|
"word": content['word'],
|
|
|
|
|
|
|
|
"direction": content['direction'],
|
|
|
|
|
|
|
|
"slug": folder
|
|
|
|
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
postit = {
|
|
|
|
postit = {
|
|
|
|
"title": metadata["title"],
|
|
|
|
"title": metadata["title"],
|
|
|
|