dump contents and miri cards wip

master
km0 2 years ago
parent a85c029bbc
commit 6deb67eff6

File diff suppressed because one or more lines are too long

@ -6,9 +6,7 @@ import os
def dump():
# list all the folders
path = "postit/static/contents"
folders = [
f.name for f in os.scandir(path) if f.is_dir() and f.name != "miri-the-leader"
]
folders = [f.name for f in os.scandir(path) if f.is_dir()]
contents = []
@ -16,7 +14,7 @@ def dump():
with open(f"{path}/{folder}/contents.md", "r", encoding="utf8") as f:
metadata, body = frontmatter.parse(f.read())
for content in metadata["contents"]:
if type(content) == dict and content["img"]:
if type(content) == dict and "img" in content:
postit = {
"title": metadata["title"],
@ -24,6 +22,18 @@ def dump():
"img": content["img"],
"slug": folder,
}
elif type(content) == dict and "card" in content:
postit = {
"title": metadata["title"],
"card": content["card"],
"quote": content["quote"],
"motivation": content["motivation"],
"vision": content["vision"],
"emphaty": content["emphaty"],
"positivity": content["positivity"],
"slug": folder,
}
else:
postit = {
"title": metadata["title"],

@ -0,0 +1,37 @@
.miri-the-leader {
font-size: 18px;
padding: 5mm;
}
.miri-the-leader .card {
text-align: center;
}
.miri-the-leader .quote {
font-size: 24px;
margin: 24px 0;
padding-left: 20%;
}
.miri-the-leader dl {
position: absolute;
bottom: 4mm;
width: 100%;
overflow: hidden;
padding: 0;
margin: 0;
}
.miri-the-leader dt {
float: left;
width: 75%;
padding: 0;
margin: 0;
}
.miri-the-leader dd {
float: left;
width: 25%;
padding: 0;
margin: 0;
}

@ -6,17 +6,36 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Post it</title>
<link rel="stylesheet" href="{{url_for('static', filename='css/postit.css')}}" />
<link rel="stylesheet" href="{{url_for('static', filename='css/contents.css')}}" />
</head>
<body>
<div class="container">
{% for content in contents %} {% for i in range(12)%}
<div class="post-it">
<div class="post-it {{content['slug']}}">
{%if content['img'] %}
<img
src="{{url_for('static', filename='contents/' + content['slug'] + '/' + content['img'] )}}"
alt="{{content['description']}}"
/>
<figcaption>{{content['description']}}</figcaption>
{%elif content['card']%}
<div class="card">{{content['card']}}</div>
<div class="quote">{{content['quote']}}</div>
<dl>
<dt>Motivation</dt>
<dd>{{content['motivation']}}</dd>
<dt>Emphaty</dt>
<dd>{{content['emphaty']}}</dd>
<dt>Vision</dt>
<dd>{{content['vision']}}</dd>
<dt>Positivity</dt>
<dd>{{content['positivity']}}</dd>
</dl>
{%else%}
<h2 class="title">{{content['title']}}</h2>
<p class="description">{{content['description']}}</p>

Loading…
Cancel
Save