single pages
parent
7f7ee446a1
commit
f8ffde2858
File diff suppressed because one or more lines are too long
@ -1,8 +1,13 @@
|
||||
from flask import Blueprint, render_template, request, url_for
|
||||
import os
|
||||
|
||||
bp = Blueprint("home", __name__, url_prefix="/")
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
def home():
|
||||
return "Home"
|
||||
|
||||
path = "postit/static/contents"
|
||||
pages = [f.name for f in os.scandir(path) if f.is_dir()]
|
||||
|
||||
return render_template("home.html", pages=pages)
|
||||
|
@ -0,0 +1,19 @@
|
||||
<!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>
|
||||
</head>
|
||||
<body>
|
||||
<h1>🚩 90 000 post-it</h1>
|
||||
<ul>
|
||||
{%for page in pages %}
|
||||
<li>
|
||||
<a href="{{url_for('generate.block', slug=page)}}">{{page}}</a>
|
||||
</li>
|
||||
{%endfor%}
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,48 @@
|
||||
<!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>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>
|
||||
{%endif%}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue