Handling optional "date" field in past readings list

This commit is contained in:
Lucas Cimon 2019-02-08 11:13:48 +01:00
parent 5712d577b0
commit c9c730f727
No known key found for this signature in database
GPG Key ID: 08DA831E717571EE
3 changed files with 4 additions and 3 deletions

View File

@ -86,6 +86,7 @@
updateArticlesVisibility(); updateArticlesVisibility();
}; };
// This is a bit redundant with /tag/$tag.html pages, but is slightly more powerful as it allow to combine multiple filters
let queryParams = parseQuery(window.location.search); let queryParams = parseQuery(window.location.search);
for (let [qpName, qpValue] of Object.entries(queryParams)) { for (let [qpName, qpValue] of Object.entries(queryParams)) {
if (!qpValue) { continue; } if (!qpValue) { continue; }

View File

@ -266,7 +266,7 @@
</div> </div>
</aside> </aside>
<script src="{{SITEURL}}/theme/bundle-SHARE-{{SHARE|string|first|length|string|first}}-MG_FILTER_TAGS-{{MG_FILTER_TAGS|string|first|length|string|first}}-SHORTSHA1-b4c4e94.js"></script> <script src="{{SITEURL}}/theme/bundle-SHARE-{{SHARE|string|first|length|string|first}}-MG_FILTER_TAGS-{{MG_FILTER_TAGS|string|first|length|string|first}}-SHORTSHA1-efddc02.js"></script>
{% include 'disqus_count.html' %} {% include 'disqus_count.html' %}
{% include 'analytics.html' %} {% include 'analytics.html' %}

4
templates/past_readings.html Executable file → Normal file
View File

@ -9,8 +9,8 @@
<div class="uk-grid"> <div class="uk-grid">
{% for reading in READINGS %} {% for reading in READINGS %}
<figure class="uk-width-1-1 uk-width-small-1-2 uk-width-medium-1-3"> <figure class="uk-width-1-1 uk-width-small-1-2 uk-width-medium-1-3">
<img class="uk-thumbnail" src="{{ reading['img_url'] }}" alt="{{ reading['description'] }}"> <img class="uk-thumbnail" src="{{ reading['img_url'] }}" alt="{{ reading['description']+' '+reading.get('date', '') }}">
<figcaption>{{ reading['description'] }}</figcaption> <figcaption>{{ reading['description']+' '+reading.get('date', '') }}</figcaption>
</figure> </figure>
{% endfor %} {% endfor %}
</div> </div>