mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Reduce duplicated code and automate more things
Also change styling for article captions (author/when published)
This commit is contained in:
17
index.md
17
index.md
@@ -26,22 +26,7 @@ layout: home
|
||||
{% endif %}
|
||||
{% if currentdate_count < 3 %}
|
||||
{% assign currentdate_count = currentdate_count | plus: 1 %}
|
||||
<div class="mdc-card" onclick="window.location='{{ article.url | relative_url }}';">
|
||||
<div class="mdc-card__media mdc-card__media--16-9" style="background-image: url('/images/{{ article.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}.jpg');"></div>
|
||||
<div class="mdc-card-content">
|
||||
<h2 class="mdc-typography--headline6">{{ article.title }}</h2>
|
||||
<h3 class="mdc-typography--subtitle2">
|
||||
<time class="timeago" datetime="{{ article.date | date: '%Y-%m-%d' }}T{{ article.date | date: '%H:%M:%S' }}">{{ article.date | date: '%A %e %B %Y' }}</time>
|
||||
| by {{ article.authors }}
|
||||
</h3>
|
||||
<div class="mdc-typography--body2 article-description">{{ article.description }}</div>
|
||||
</div>
|
||||
<div class="mdc-card__actions">
|
||||
<div class="mdc-card__action-buttons">
|
||||
<button class="mdc-button mdc-card__action mdc-card__action--button" data-mdc-auto-init="MDCRipple" onclick="window.location='{{ article.url | relative_url }}';">Read</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include mdc-card.html article=article %}
|
||||
{% endif %}
|
||||
{% if currentdate != date %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user