mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Enable auto-population & remove author pages
Make the navbar, main article list and content of articles (images, dates and authors) populate automatically, and remove pages for each author.
This commit is contained in:
18
index.md
18
index.md
@@ -4,18 +4,26 @@ description: News articles written by Reading School students in year 8
|
||||
layout: article-list
|
||||
---
|
||||
|
||||
{% for article in site.categories.articles %}
|
||||
<div class="mdc-card">
|
||||
<div class="mdc-card__media mdc-card__media--16-9" style="background-image:url('/images/article_name--cover.jpg');"></div>
|
||||
<div class="mdc-card__media mdc-card__media--16-9 {{ article.url | relative_url | replace: '/', '-' | replace: '.', '-' }}"></div>
|
||||
<div class="mdc-card-content">
|
||||
<h2 class="mdc-typography--headline6">Title</h2>
|
||||
<h2 class="mdc-typography--headline6">{{ article.title }}</h2>
|
||||
<h3 class="mdc-typography--subtitle2">
|
||||
<time class="timeago" datetime="2018-11-21T07:08:0Z">Wednesday 21st November 2018</time>
|
||||
| by <a href="/authors/name">Name</a>
|
||||
<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>
|
||||
<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='/articles/article_name';">Read</button>
|
||||
<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>
|
||||
|
||||
<style>
|
||||
.{{ article.url | relative_url | replace: '/', '-' | replace: '.', '-' }} {
|
||||
background-image: url("/images/{{ article.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}--cover.jpg");
|
||||
}
|
||||
</style>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user