new postit layout

master
km0 3 years ago
parent 8b55f51004
commit 06a1f1ec41

File diff suppressed because one or more lines are too long

@ -14,6 +14,7 @@ def dump():
for folder in folders: for folder in folders:
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())
print(folder)
for content in metadata["contents"]: for content in metadata["contents"]:
if type(content) == dict: if type(content) == dict:

@ -1 +1 @@
Subproject commit 6ec639f124cce053cb7abac640a2188a71b1c354 Subproject commit 82ccc3a2e7c46dd50965b9550e6cf0be657a0fe9

@ -0,0 +1,87 @@
@page {
size: A3;
margin: 5mm;
}
html,
body {
margin: 0;
}
* {
box-sizing: border-box;
}
.container {
font-size: 0;
}
.post-it {
position: relative;
vertical-align: middle;
display: inline-block;
width: 90mm;
height: 90mm;
border: 1px solid #ddd;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
line-height: 1.4;
overflow: hidden;
text-overflow: ellipsis;
}
img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: 50;
}
.title {
position: absolute;
bottom: 0;
margin: 4mm;
font-weight: normal;
text-transform: uppercase;
font-size: 14px;
}
.description {
display: inline-block;
margin: 4mm;
font-size: 28px;
line-height: 1.2;
white-space: pre-line;
margin-top: calc(4mm - 1em);
}
figcaption {
background-color: white;
font-size: 18px;
text-align: center;
display: inline-block;
position: absolute;
left: 50%;
bottom: 4mm;
transform: translate(-50%, 0);
z-index: 100;
}
a {
color: #ddd;
font-size: 12px;
}
.description.long-text {
font-size: 21px;
}
.page-number {
position: absolute;
right: 4mm;
bottom: 4mm;
font-size: 14px;
}

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<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 %}
<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>Empathy</dt>
<dd>{{content['empathy']}}</dd>
<dt>Vision</dt>
<dd>{{content['vision']}}</dd>
<dt>Positivity</dt>
<dd>{{content['positivity']}}</dd>
</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['start']}} {{content['category']}}</div>
{%else%}
<h2 class="title">{{content['title']}}</h2>
<div class="page-number">{{loop.index}}/{{contents|length}}</div>
<p
class="description {% if content['description']|length > 200 %} long-text {%endif%}"
>
{{content['description']}}
</p>
{%endif%}
</div>
{% endfor %}
</div>
</body>
</html>
Loading…
Cancel
Save