Commit 0b8ba0a1 authored by erreur401's avatar erreur401

Merge branch 'master' of gitlab.com:bemaker/eu.bemaker.flask

parents a18c580d ef72e18d
......@@ -5,15 +5,13 @@ import glob
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_ROOT = 'app'
POST_DIR = 'posts'
PAGE_DIR = 'docs'
FLATPAGES_EXTENSION = '.md'
app = Flask(__name__)
#app.config.from_pyfile('mysettings.cfg')
app.config.from_object(__name__)
pages = FlatPages(app)
pages.get('foo')
@app.route("/")
@app.route("/index")
......@@ -21,22 +19,23 @@ def index():
#return "Hello, World!"
return render_template("home.html")
@app.route('/docs')
def docs():
print(pages)
articles = [p for p in pages]
return render_template('articles.html', articles=articles)
@app.route('/docs/<path:path>/')
def page(path):
page = pages.get_or_404(path)
template = page.meta.get('template', 'flatpage.html')
return render_template(template, page=page)
@app.route("/learn")
def learn():
#return "Hello, World!"
return render_template("learn.html")
articles = (p for p in pages if 'published' in p.meta)
print(articles)
# Show the 10 most recent articles, most recent first.
latest = sorted(articles, reverse=True,
key=lambda p: p.meta['published'])
return render_template("learn.html", articles=latest[:10])
@app.route('/learn/<path:path>/')
def page(path):
page = pages.get_or_404(path)
print(page)
# template = page.meta.get('template', 'flatpage.html')
return render_template('flatpage.html', page=page)
@app.route("/login")
def login():
......
This diff is collapsed.
This diff is collapsed.
{% extends "base.html" %}
{% block content %}
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="../static/img/jumbo.png" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../static/img/jumbo.png" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="../static/img/jumbo.png" alt="Third slide">
</div>
</div>
</div>
<div class="tutoWrapper">
<H3>LEARN</H3>
{{page}}
</div>
{% endblock %}
......@@ -18,6 +18,8 @@
<div class="tutoWrapper">
<H3>LEARN</H3>
ICI LE MD SERA
</div>
{% for article in articles %}
<li><a href="/learn/{{article.path}}">{{article.title}}</a></li>
{% endfor %}
</div>
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment