example correction that prevents author's cover images from being ove… (#28)
* example correction that prevents author's cover images from being overwritten by inherited code in index.html * article, author, category and tag extends to base.html instead of index.html
This commit is contained in:
parent
b29690fba3
commit
b60a72e189
4 changed files with 36 additions and 7 deletions
|
@ -1,4 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ article.title }}{% endblock %}
|
||||
|
||||
{# <!-- Choosing cover image --> #}
|
||||
|
@ -14,14 +15,14 @@
|
|||
{% else %}
|
||||
{% set selected_cover = SITEURL+"/"+article.og_image %}
|
||||
{% endif %}
|
||||
{% elif article.color %}
|
||||
{% set selected_color = article.color %}
|
||||
{% 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 article.color %}
|
||||
{% set selected_color = article.color %}
|
||||
{% elif HEADER_COLOR %}
|
||||
{% set selected_color = HEADER_COLOR %}
|
||||
{% endif %}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{% extends "index.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ SITENAME }} - Articles by {{ author_name }}{% endblock %}
|
||||
|
||||
<!-- To support both image in relative path and url -->
|
||||
{% set author_name = author.name | title %}
|
||||
|
@ -32,8 +34,6 @@
|
|||
{% set selected_color = HEADER_COLOR %}
|
||||
{% endif %}
|
||||
|
||||
{% block title %}{{ SITENAME }} - Articles by {{ author_name }}{% endblock %}
|
||||
|
||||
{% block opengraph %}
|
||||
{{ super() }}
|
||||
<meta property="og:title" content="{{ SITENAME }} - Articles by {{ author }}">
|
||||
|
@ -114,3 +114,12 @@
|
|||
{% endif %}
|
||||
|
||||
{% endblock header %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="index" class="container">
|
||||
<main class="content" role="main">
|
||||
{% include "partials/loop.html" %}
|
||||
</main>
|
||||
</div>
|
||||
{% endblock content %}
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "index.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ SITENAME }} - Articles in the {{ category }} category{% endblock %}
|
||||
|
||||
|
@ -51,3 +51,12 @@
|
|||
</div>
|
||||
</header>
|
||||
{% endblock header %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="index" class="container">
|
||||
<main class="content" role="main">
|
||||
{% include "partials/loop.html" %}
|
||||
</main>
|
||||
</div>
|
||||
{% endblock content %}
|
|
@ -1,4 +1,5 @@
|
|||
{% extends "index.html" %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ SITENAME }} - Tag {{ tag }}{% endblock %}
|
||||
|
||||
{# <!-- Choosing cover image --> #}
|
||||
|
@ -50,3 +51,12 @@
|
|||
</div>
|
||||
</header>
|
||||
{% endblock header %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div id="index" class="container">
|
||||
<main class="content" role="main">
|
||||
{% include "partials/loop.html" %}
|
||||
</main>
|
||||
</div>
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue