Upload Testproject
This commit is contained in:
6
Podcast/templates/blog-post.html
Normal file
6
Podcast/templates/blog-post.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends "layout.html" %}
|
||||
{% from "macros/blog.html" import render_blog_post %}
|
||||
{% block title %}{{ this.title }}{% endblock %}
|
||||
{% block body %}
|
||||
{{ render_blog_post(this) }}
|
||||
{% endblock %}
|
||||
11
Podcast/templates/blog.html
Normal file
11
Podcast/templates/blog.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "layout.html" %}
|
||||
{% from "macros/blog.html" import render_blog_post %}
|
||||
{% from "macros/pagination.html" import render_pagination %}
|
||||
{% block title %}{{ this.title }}{% endblock %}
|
||||
{% block body %}
|
||||
{% for child in this.pagination.items %}
|
||||
{{ render_blog_post(child, from_index=true) }}
|
||||
{% endfor %}
|
||||
|
||||
{{ render_pagination(this.pagination) }}
|
||||
{% endblock %}
|
||||
29
Podcast/templates/layout.html
Normal file
29
Podcast/templates/layout.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="{{ '/static/style.css'|url }}">
|
||||
<title>{% block title %}Welcome{% endblock %} — PodcastLektor</title>
|
||||
<body>
|
||||
<header>
|
||||
<h1>PodcastLektor</h1>
|
||||
<nav>
|
||||
<ul class="nav navbar-nav">
|
||||
<li{% if this._path == '/' %} class="active"{% endif
|
||||
%}><a href="{{ '/'|url }}">Welcome</a></li>
|
||||
{% for href, title in [
|
||||
['/blog', 'Blog'],
|
||||
['/projects', 'Projects'],
|
||||
['/about', 'About']
|
||||
] %}
|
||||
<li{% if this.is_child_of(href) %} class="active"{% endif
|
||||
%}><a href="{{ href|url }}">{{ title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="page">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
<footer>
|
||||
© Copyright 2022 by Homer S..
|
||||
</footer>
|
||||
</body>
|
||||
20
Podcast/templates/macros/blog.html
Normal file
20
Podcast/templates/macros/blog.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{% macro render_blog_post(post, from_index=false) %}
|
||||
<div class="blog-post">
|
||||
{% if from_index %}
|
||||
<h2><a href="{{ post|url }}">{{ post.title }}</a></h2>
|
||||
{% else %}
|
||||
<h2>{{ post.title }}</h2>
|
||||
{% endif %}
|
||||
<p class="meta">
|
||||
written by
|
||||
{% if post.twitter_handle %}
|
||||
<a href="https://twitter.com/{{ post.twitter_handle
|
||||
}}">{{ post.author or post.twitter_handle }}</a>
|
||||
{% else %}
|
||||
{{ post.author }}
|
||||
{% endif %}
|
||||
on {{ post.pub_date }}
|
||||
</p>
|
||||
{{ post.body }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
15
Podcast/templates/macros/pagination.html
Normal file
15
Podcast/templates/macros/pagination.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% macro render_pagination(pagination) %}
|
||||
<div class="pagination">
|
||||
{% if pagination.has_prev %}
|
||||
<a href="{{ pagination.prev|url }}">« Previous</a>
|
||||
{% else %}
|
||||
<span class="disabled">« Previous</span>
|
||||
{% endif %}
|
||||
| {{ pagination.page }} |
|
||||
{% if pagination.has_next %}
|
||||
<a href="{{ pagination.next|url }}">Next »</a>
|
||||
{% else %}
|
||||
<span class="disabled">Next »</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
6
Podcast/templates/page.html
Normal file
6
Podcast/templates/page.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block title %}{{ this.title }}{% endblock %}
|
||||
{% block body %}
|
||||
<h2>{{ this.title }}</h2>
|
||||
{{ this.body }}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user