crossword wip

master
km0 3 years ago
parent fbd3c32bb6
commit 73d369d723

File diff suppressed because one or more lines are too long

@ -14,8 +14,9 @@ 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:
if "img" in content:
postit = { postit = {
"title": metadata["title"], "title": metadata["title"],
"description": content["alt"], "description": content["alt"],
@ -23,17 +24,27 @@ def dump():
"slug": folder, "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"],

@ -1 +1 @@
Subproject commit d7d6e9bc2f9c5dde5a35625afc6d1410e819e2f0 Subproject commit 999aa859b8884c3f8d75200a8b2013086bf5a2ea

@ -41,16 +41,22 @@ img {
} }
.title { .title {
font-size: 18px; position: absolute;
text-align: center; bottom: 0;
/* text-align: center; */
margin: 4mm; margin: 4mm;
color: #aaa; font-weight: normal;
text-transform: uppercase;
font-size: 14px;
} }
.description { .description {
display: inline-block; display: inline-block;
margin: 4mm; margin: 4mm;
font-size: 24px; font-size: 28px;
line-height: 1.2;
white-space: pre-line;
margin-top: -1em;
} }
figcaption { figcaption {
@ -69,3 +75,7 @@ a {
color: #ddd; color: #ddd;
font-size: 12px; font-size: 12px;
} }
.description.long-text {
font-size: 21px;
}

@ -27,8 +27,8 @@
<dt>Motivation</dt> <dt>Motivation</dt>
<dd>{{content['motivation']}}</dd> <dd>{{content['motivation']}}</dd>
<dt>Emphaty</dt> <dt>Empathy</dt>
<dd>{{content['emphaty']}}</dd> <dd>{{content['empathy']}}</dd>
<dt>Vision</dt> <dt>Vision</dt>
<dd>{{content['vision']}}</dd> <dd>{{content['vision']}}</dd>
@ -37,9 +37,24 @@
<dd>{{content['positivity']}}</dd> <dd>{{content['positivity']}}</dd>
</dl> </dl>
{%elif content['definition']%}
<h2 class="title">{{content['title']}}</h2>
<p
class="description {% if content['definition']|length > 200 %} long-text {%endif%}"
>
{{content['definition']}}
</p>
<div class="category">{{content['category']}} - {{content['start']}}</div>
{%else%} {%else%}
<h2 class="title">{{content['title']}}</h2> <h2 class="title">{{content['title']}}</h2>
<p class="description">{{content['description']}}</p> <p
class="description {% if content['description']|length > 200 %} long-text {%endif%}"
>
{{content['description']}}
</p>
{%endif%} {%endif%}
</div> </div>
{% endfor %} {% endfor %}

Loading…
Cancel
Save