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:
@@ -14,15 +14,7 @@
|
||||
|
||||
<main class="main-content" id="main-content">
|
||||
<div class="mdc-top-app-bar--short-fixed-adjust">
|
||||
<div class="parallax-section article-title-section" data-jarallax data-speed="{{ site.parallax-speed }}" style="background-image: url('/images/{{ page.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}.jpg');">
|
||||
<h2 class="mdc-typography--headline3">{{ page.title }}</h2>
|
||||
</div>
|
||||
<figcaption class="mdc-typography--caption-text">{{ page.image-caption }}</figcaption>
|
||||
|
||||
<h3 class="mdc-typography--subtitle1">
|
||||
<time class="timeago" datetime="{{ page.date | date: '%Y-%m-%d' }}T{{ page.date | date: '%H:%M:%S' }}">{{ page.date | date: '%A %e %B %Y' }}</time>
|
||||
| by {{ page.authors }}
|
||||
</h3>
|
||||
{% include article-heading.html %}
|
||||
<div class="article-content">
|
||||
{{ content }}
|
||||
</div>
|
||||
|
||||
@@ -14,16 +14,7 @@
|
||||
|
||||
<main class="main-content" id="main-content">
|
||||
<div class="mdc-top-app-bar--short-fixed-adjust">
|
||||
<div class="parallax-section article-title-section" data-jarallax data-speed="{{ site.parallax-speed }}" style="background-image: url('/images/{{ page.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}.jpg');">
|
||||
<h2 class="mdc-typography--headline3">{{ page.title }}</h2>
|
||||
</div>
|
||||
<figcaption class="mdc-typography--caption-text">{{ page.image-caption }}</figcaption>
|
||||
|
||||
<h3 class="mdc-typography--subtitle1">
|
||||
<time class="timeago"
|
||||
datetime="{{ page.date | date: '%Y-%m-%d' }}T{{ page.date | date: '%H:%M:%S' }}">{{ page.date | date: '%A %e %B %Y' }}</time>
|
||||
| by {{ page.authors }}
|
||||
</h3>
|
||||
{% include article-heading.html %}
|
||||
<div class="article-content">
|
||||
<audio controls>
|
||||
<source src="{{ page.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}.ogg" type="audio/ogg">
|
||||
|
||||
@@ -14,16 +14,7 @@
|
||||
|
||||
<main class="main-content" id="main-content">
|
||||
<div class="mdc-top-app-bar--short-fixed-adjust">
|
||||
<div class="parallax-section article-title-section" data-jarallax data-speed="{{ site.parallax-speed }}" style="background-image: url('/images/{{ page.url | relative_url | remove: '.html' | replace: '/', '-' | remove: '-articles-' }}.jpg');">
|
||||
<h2 class="mdc-typography--headline3">{{ page.title }}</h2>
|
||||
</div>
|
||||
<figcaption class="mdc-typography--caption-text">{{ page.image-caption }}</figcaption>
|
||||
|
||||
<h3 class="mdc-typography--subtitle1">
|
||||
<time class="timeago"
|
||||
datetime="{{ page.date | date: '%Y-%m-%d' }}T{{ page.date | date: '%H:%M:%S' }}">{{ page.date | date: '%A %e %B %Y' }}</time>
|
||||
| by {{ page.authors }}
|
||||
</h3>
|
||||
{% include article-heading.html %}
|
||||
<div class="article-content">
|
||||
<iframe src="https://www.youtube.com/embed/{{ page.video-id }}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
||||
<figcaption class="mdc-typography--caption-text">{{ page.video-caption }}</figcaption>
|
||||
|
||||
@@ -30,22 +30,7 @@
|
||||
{% for article in articles %}
|
||||
{% assign articleyear = article.date | date: "%Y" %}
|
||||
{% if pageyear == articleyear %}
|
||||
<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 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user