Improve all templates: blog/page/blog-post

This commit is contained in:
PCoder 2019-10-02 20:24:19 +05:30
parent 3740799f86
commit 84e1ae8eda
4 changed files with 118 additions and 65 deletions

View file

@ -3,6 +3,19 @@
{% from "macros/pagination.html" import render_pagination %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
<header class="intro-header" style="background-image: url('/u/static/images/home-bg.jpg');">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>ungleich blog</h1>
<hr class="small">
<span class="subheading"></span>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">

View file

@ -57,44 +57,46 @@
</div>
</nav>
<!-- Navigation END -->
<header class="intro-header" style="background-image: url('/u/static/images/home-bg.jpg');">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>ungleich blog</h1>
<hr class="small">
<span class="subheading"></span>
</div>
</div>
</div>
</div>
</header>
<header>
<h1>{{ self.title() }}</h1>
<nav>
<ul class="nav navbar-nav">
<li{% if this._path == '/' %} class="active"{% endif
%}><a href="{{ '/'|url }}">ungleich.ch</a></li>
{% for href, title in [
['/u/blog', 'the new ungleich blog'],
] %}
<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>
&copy; Copyright 2019 by <a href="https://ungleich.ch">ungleich</a>.
</footer>
<hr />
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center">
<li>
<a href="https://twitter.com/ungleich">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://www.linkedin.com/company/ungleich-gmbh">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://github.com/ungleich">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright">
Copyright © ungleich GmbH 2019
</p>
</div>
</div>
</div>
</footer>
</body>

View file

@ -1,30 +1,29 @@
{% macro render_blog_post(post, from_index=false) %}
<div class="post-preview">
<div class="row">
<div class="col-md-4">
{% if from_index %}<h2><a href="{{ post|url }}"><img style="margin-top:11%" src="{{post.thumbnail}}"/></a></h2>{% else %}<h2><img style="margin-top:11%" src="{{post.thumbnail}}"/></h2>{% endif %}
</div>
<div class="col-md-8">
{% if from_index %}<a href="{{ post|url }}"><h2 class="post-title">{{ post.title }}</h2></a>
{% if from_index %}
<div class="post-preview">
<div class="row">
<div class="col-md-4">
{% if from_index %}<h2><a href="{{ post|url }}"><img style="margin-top:11%" src="{{post.thumbnail}}"/></a></h2>{% else %}<h2><img style="margin-top:11%" src="{{post.thumbnail}}"/></h2>{% endif %}
</div>
<div class="col-md-8">
{% if from_index %}<a href="{{ post|url }}"><h2 class="post-title">{{ post.title }}</h2></a>
{% else %}
<h2 class="post-title">{{ post.title }}</h2>
{% endif %}
<p class="post-meta" style="font-size:0.9em;">
Posted on {{ post.pub_date }} by {% if post.twitter_handle %}<a href="https://twitter.com/{{ post.twitter_handle }}">{{ post.author or post.twitter_handle }}</a>{% else %}{{ post.author }} {% endif %}
</p>
<p class="post-subtitle">
<p>
{{ post.abstract }}
</p>
</p>
</div>
</div>
<hr>
</div>
{% else %}
<h2 class="post-title">{{ post.title }}</h2>
{{ post.body }}
{% endif %}
<p class="post-meta" style="font-size:0.9em;">
Posted on {{ post.pub_date }} by {% if post.twitter_handle %}<a href="https://twitter.com/{{ post.twitter_handle }}">{{ post.author or post.twitter_handle }}</a>{% else %}{{ post.author }} {% endif %}
</p>
<p class="post-subtitle">
<p>
{% if from_index %}
{{ post.abstract }}
{% else %}
{{ post.body }}
{% endif %}
</p>
</p>
</div>
</div>
</div>
<hr>
{% endmacro %}

View file

@ -1,6 +1,45 @@
{% extends "layout.html" %}
{% block title %}{{ this.title }}{% endblock %}
<header>
<h1>{{ self.title() }}</h1>
<nav>
<ul class="nav navbar-nav">
<li{% if this._path == '/' %} class="active"{% endif
%}><a href="{{ '/'|url }}">ungleich.ch</a></li>
{% for href, title in [
['/u/blog', 'the new ungleich blog'],
] %}
<li{% if this.is_child_of(href) %} class="active"{% endif
%}><a href="{{ href|url }}">{{ title }}</a></li>
{% endfor %}
</ul>
</nav>
</header>
{% block body %}
<h2>{{ this.title }}</h2>
{{ this.body }}
<header class="intro-header" style="background-image: url('/u/static/images/home-bg.jpg');">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1>{{ this.title }}</h1>
<hr class="small">
<span class="subheading"></span>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="app app-blog span8">
<article>
<div class="blog-content">
{{ this.body }}
</div>
</article>
</div>
</div>
</div>
</div>
{% endblock %}