Overview page: fallback to title + text instead of filler image

This commit is contained in:
Nico Schottelius 2020-04-23 19:50:59 +02:00
parent d9a07fddf1
commit 067571fc35
2 changed files with 27 additions and 2 deletions

View file

@ -13,6 +13,10 @@ headline2: Your own IP Space
--- ---
headline3: At Data Center Light headline3: At Data Center Light
--- ---
header_background_color: #6298CB
---
header_text_color: text-light
---
content1_text: content1_text:
## For whom is BGP peering? ## For whom is BGP peering?

View file

@ -6,6 +6,22 @@
<div class="container"> <div class="container">
{% for childpage in this.children %} {% for childpage in this.children %}
{# Setup default settings for the overview #}
{% if childpage.header_background_color %}
{% set div_style = 'background-color:' + childpage.header_background_color + ';' %}
{% else %}
{% set div_style = 'background-color: #6FB0E5;' %}
{% endif %}
{% if childpage.header_text_color %}
{% set div_classes = childpage.header_text_color %}
{% else %}
{% set div_classes = 'text-light' %}
{% endif %}
{% if loop.first %} {% if loop.first %}
<div class="row mb-3"> <div class="row mb-3">
{% endif %} {% endif %}
@ -16,8 +32,13 @@
<img class="card-img-top" src="{{ childpage.image }}" <img class="card-img-top" src="{{ childpage.image }}"
alt="{{ childpage.title }}"> alt="{{ childpage.title }}">
{% else %} {% else %}
<img class="card-img-top" src="/u/image/cards/placeholder.jpg" <div style="{{ div_style }} font-weight: bold; padding-left:
alt="{{ childpage.title }}"> 12px; padding-right: 6px; text-transform: uppercase;"
class="{{ div_classes }} display-4">
&nbsp;<br/>
{{ childpage.title }}<sup style="font-weight: normal;"></sup><br/>
&nbsp;<br/>
</div>
{% endif %} {% endif %}
</a> </a>
<div class="card-body"> <div class="card-body">