Header fixes (#25)

* #21 changing logic to selecting cover image

- For categories, tags

- Some code refactor and indenting

* #21 initial codes for pelican unit tests

* #21 few more testing changes

* Ref #21 unit tests for article tests coverimages

* Ref #21 unit tests for page, tags, category and author coverimages

* Ref #21 readme updated
This commit is contained in:
Arul 2018-05-14 13:26:35 +05:30 committed by GitHub
parent 994b999633
commit 7b26ad1013
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1283 additions and 127 deletions

View file

@ -3,21 +3,33 @@
<!-- To support both image in relative path and url -->
{% set author_name = author.name | title %}
{% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO %}
{% set author_avatar = AUTHORS_BIO[author.name.lower()].image %}
{% if author_avatar %}
{% if author_avatar|lower|truncate(4, True, '') != "http" %}
{% set author_avatar = SITEURL+"/"+author_avatar %}
{% endif %}
{% set author_avatar = AUTHORS_BIO[author.name.lower()].image %}
{% if author_avatar %}
{% if author_avatar|lower|truncate(4, True, '') == "http" %}
{% set selected_avatar = author_avatar %}
{% else %}
{% set selected_avatar = SITEURL+"/"+author_avatar %}
{% endif %}
{% endif %}
{% set author_cover = AUTHORS_BIO[author.name.lower()].cover %}
{% if author_cover %}
{% if author_cover|lower|truncate(4, True, '') != "http" %}
{% set author_cover= SITEURL+"/"+author_cover %}
{% endif %}
{% set author_cover = AUTHORS_BIO[author.name.lower()].cover %}
{% if author_cover %}
{% if author_cover|lower|truncate(4, True, '') == "http" %}
{% set selected_cover = author_cover %}
{% else %}
{% set selected_cover = SITEURL+"/"+author_cover %}
{% endif %}
{% endif %}
{% set author_name = AUTHORS_BIO[author.name.lower()].name or author.name %}
{% set author_name = AUTHORS_BIO[author.name.lower()].name or author.name %}
{% elif HEADER_COVER %}
{% if HEADER_COVER|lower|truncate(4, True, '') == "http" %}
{% set selected_cover = HEADER_COVER %}
{% else %}
{% set selected_cover = SITEURL+"/"+HEADER_COVER %}
{% endif %}
{% elif HEADER_COLOR %}
{% set selected_color = HEADER_COLOR %}
{% endif %}
{% block title %}{{ SITENAME }} - Articles by {{ author_name }}{% endblock %}
@ -50,14 +62,12 @@
<a class="menu-button"><i class="ic ic-menu"></i> Menu</a>
</span>
</nav>
{% if AUTHORS_BIO and author.name.lower() in AUTHORS_BIO and author_cover %}
<div class="blog-cover cover" style="background-image: url('{{ author_cover }}')">
{% elif HEADER_COVER %}
<div class="blog-cover cover" style="background-image: url('{{ HEADER_COVER }}')">
{% elif HEADER_COLOR %}
<div class="post-cover cover" style="background-color: {{ HEADER_COLOR }}">
{% if selected_cover %}
<div class="blog-cover cover" style="background-image: url('{{ selected_cover }}')">
{% elif selected_color %}
<div class="blog-cover cover" style="background-color: {{ selected_color }}">
{% else %}
<div class="post-cover cover" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg')">
<div class="blog-cover cover" style="background-image: url('{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/post-bg.jpg')">
{% endif %}
</div>
</header>
@ -66,9 +76,9 @@
<section id="blog-author" class="has-cover" >
<div class="inner">
<aside class="post-author">
{% if author_avatar %}
{% if selected_avatar %}
<figure class="post-author-avatar">
<img src="{{author_avatar}}" alt="{{author_name}}" />
<img src="{{selected_avatar}}" alt="{{author_name}}" />
</figure>
{% endif %}
<div class="post-author-bio">