mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 11:27:06 +00:00
Account for when no articles exist
When no articles exist, the navbar doesn't show the 'Articles' title, and the home page displays an appropriate message
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
||||||
<span class="mdc-list-item__text">Home Page</span>
|
<span class="mdc-list-item__text">Home Page</span>
|
||||||
</a>
|
</a>
|
||||||
|
{% if site.categories.articles %}
|
||||||
<div class="mdc-list-group">
|
<div class="mdc-list-group">
|
||||||
<h3 class="mdc-list-group__subheader">Articles</h3>
|
<h3 class="mdc-list-group__subheader">Articles</h3>
|
||||||
{% for page in site.categories.articles %}
|
{% for page in site.categories.articles %}
|
||||||
@@ -21,6 +22,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
|
|
||||||
<meta name="HandheldFriendly" content="True">
|
|
||||||
<link rel="icon" href="/images/favicon.ico">
|
|
||||||
|
|
||||||
<!-- add to homescreen for Chrome on Android -->
|
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
|
||||||
<link rel="icon" sizes="192x192" href="/images/favicon.png">
|
|
||||||
|
|
||||||
<!-- add to homescreen for Safari on iOS -->
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="Title | Reading School">
|
|
||||||
<link rel="apple-touch-icon-precomposed" href="/images/favicon.png">
|
|
||||||
|
|
||||||
<!-- tile icon & colour for Windows 8 -->
|
|
||||||
<meta name="msapplication-TileImage" content="/images/favicon.png">
|
|
||||||
<meta name="msapplication-TileColor" content="#d84315">
|
|
||||||
|
|
||||||
<title>Title | Reading School</title>
|
|
||||||
<meta name="description" content="<p>Content</p>
|
|
||||||
">
|
|
||||||
|
|
||||||
<!-- import Roboto (font) -->
|
|
||||||
<link href="/css/roboto.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- import jQuery -->
|
|
||||||
<script src="/js/jquery.min.js"></script>
|
|
||||||
|
|
||||||
<!-- import jQuery timeago -->
|
|
||||||
<script src="/js/jquery.timeago.min.js"></script>
|
|
||||||
|
|
||||||
<!-- import cookie JavaScript -->
|
|
||||||
<script src="/js/cookies.js"></script>
|
|
||||||
|
|
||||||
<!-- import Material Design components & icons -->
|
|
||||||
<link href="/css/material-components-web.min.css" rel="stylesheet">
|
|
||||||
<link href="/css/material_icons.css" rel="stylesheet">
|
|
||||||
<script src="/js/material-components-web.min.js"></script>
|
|
||||||
|
|
||||||
<!-- import local styling & scripts -->
|
|
||||||
<script src="/js/global.js"></script>
|
|
||||||
<link href="/css/global.css" rel="stylesheet">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<link href="/css/article-page.css" rel="stylesheet">
|
|
||||||
<body>
|
|
||||||
<!-- cookie notice is included automatically -->
|
|
||||||
<div id="cookies">
|
|
||||||
<p>Just to let you know, we use cookies on our site.</p>
|
|
||||||
<p><a href="javascript:void(0);" id="close-cookies">OK</a></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- content of navbar is included via jQuery -->
|
|
||||||
<aside class="mdc-drawer mdc-drawer--modal">
|
|
||||||
<div class="mdc-drawer__content">
|
|
||||||
<nav class="mdc-list">
|
|
||||||
<div style="margin: 15px;text-align:center;">
|
|
||||||
<img src="/images/page-logo.png" style="width: 90%;"/>
|
|
||||||
</div>
|
|
||||||
<a class="mdc-list-item" href="https://reading-school.co.uk" data-mdc-auto-init="MDCRipple">
|
|
||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">school</i>
|
|
||||||
<span class="mdc-list-item__text">Reading School Website</span>
|
|
||||||
</a>
|
|
||||||
<a class="mdc-list-item" href="/" data-mdc-auto-init="MDCRipple">
|
|
||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
|
||||||
<span class="mdc-list-item__text">Home Page</span>
|
|
||||||
</a>
|
|
||||||
<div class="mdc-list-group">
|
|
||||||
<h3 class="mdc-list-group__subheader">Articles</h3>
|
|
||||||
|
|
||||||
<a class="mdc-list-item" href="/articles/2019/01/01/article-name.html" data-mdc-auto-init="MDCRipple">
|
|
||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">assignment</i>
|
|
||||||
<span class="mdc-list-item__text">Title</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<div class="mdc-drawer-scrim"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="mdc-drawer-app-content">
|
|
||||||
<header class="mdc-top-app-bar mdc-top-app-bar--short" id="app-bar">
|
|
||||||
<div class="mdc-top-app-bar__row">
|
|
||||||
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start">
|
|
||||||
<a href="javascript:void(0);" class="material-icons mdc-top-app-bar__navigation-icon">menu</a>
|
|
||||||
<span class="mdc-top-app-bar__title">BBC Young Reporter | Reading School</span>
|
|
||||||
</section>
|
|
||||||
<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
|
|
||||||
<a href="/" class="mdc-top-app-bar__action-item" aria-label="Reading School" style="padding:0;">
|
|
||||||
<img src="/images/logo-white.png" alt="Reading School Logo" style="height:100%;"/>
|
|
||||||
</a>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
|
|
||||||
<main class="main-content" id="main-content">
|
|
||||||
<div class="mdc-top-app-bar--short-fixed-adjust">
|
|
||||||
<h2 class="mdc-typography--headline2">Title</h2>
|
|
||||||
<h3 class="mdc-typography--subtitle1">
|
|
||||||
<time class="timeago" datetime="2019-01-01T07:01:00">Tuesday 1 January 2019</time>
|
|
||||||
| by Name
|
|
||||||
</h3>
|
|
||||||
<figure>
|
|
||||||
<img src="/images/2019-01-01-article-name--cover.jpg" style="width:100%;">
|
|
||||||
<figcaption class="mdc-typography--caption-text">A brass statue of a child, in a garden</figcaption>
|
|
||||||
</figure>
|
|
||||||
<p>Content</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
<footer>
|
|
||||||
© Reading School 2019 | Made by <a href="https://matthew-grove.ml">Matthew Grove</a>
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 179 KiB |
@@ -70,15 +70,7 @@
|
|||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
||||||
<span class="mdc-list-item__text">Home Page</span>
|
<span class="mdc-list-item__text">Home Page</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="mdc-list-group">
|
|
||||||
<h3 class="mdc-list-group__subheader">Articles</h3>
|
|
||||||
|
|
||||||
<a class="mdc-list-item" href="/articles/2019/01/01/article-name.html" data-mdc-auto-init="MDCRipple">
|
|
||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">assignment</i>
|
|
||||||
<span class="mdc-list-item__text">Title</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
@@ -105,25 +97,10 @@
|
|||||||
<main class="main-content" id="main-content">
|
<main class="main-content" id="main-content">
|
||||||
<div class="mdc-top-app-bar--short-fixed-adjust">
|
<div class="mdc-top-app-bar--short-fixed-adjust">
|
||||||
|
|
||||||
<div class="mdc-card">
|
<center>We haven't got any articles for you yet! Come back during this year's BBC Young Reporter day to see what Reading School's year 8 students have produced!</center>
|
||||||
<div class="mdc-card__media mdc-card__media--16-9 -articles-2019-01-01-article-name-html"></div>
|
|
||||||
<div class="mdc-card-content">
|
|
||||||
<h2 class="mdc-typography--headline6">Title</h2>
|
|
||||||
<h3 class="mdc-typography--subtitle2">
|
|
||||||
<time class="timeago" datetime="2019-01-01T07:01:00">Tuesday 1 January 2019</time>
|
|
||||||
| by Name
|
|
||||||
</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/2019/01/01/article-name.html';">Read</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.-articles-2019-01-01-article-name-html {
|
center {
|
||||||
background-image: url("/images/2019-01-01-article-name--cover.jpg");
|
margin: 25vh auto 25vh auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -3,25 +3,18 @@
|
|||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/</loc>
|
<loc>/</loc>
|
||||||
<lastmod>2019-01-27</lastmod>
|
<lastmod>2019-01-28</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
<url>
|
<url>
|
||||||
<loc>/sitemap.xml</loc>
|
<loc>/sitemap.xml</loc>
|
||||||
<lastmod>2019-01-27</lastmod>
|
<lastmod>2019-01-28</lastmod>
|
||||||
<changefreq>daily</changefreq>
|
<changefreq>daily</changefreq>
|
||||||
<priority>0.5</priority>
|
<priority>0.5</priority>
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<url>
|
|
||||||
<loc>/articles/2019/01/01/article-name.html</loc>
|
|
||||||
<lastmod>2019-01-27</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
<priority>0.5</priority>
|
|
||||||
</url>
|
|
||||||
|
|
||||||
</urlset>
|
</urlset>
|
||||||
|
|||||||
9
index.md
9
index.md
@@ -4,6 +4,7 @@ description: News articles written by Reading School students in year 8
|
|||||||
layout: article-list
|
layout: article-list
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% if site.categories.articles %}
|
||||||
{% for article in site.categories.articles %}
|
{% for article in site.categories.articles %}
|
||||||
<div class="mdc-card">
|
<div class="mdc-card">
|
||||||
<div class="mdc-card__media mdc-card__media--16-9 {{ article.url | relative_url | replace: '/', '-' | replace: '.', '-' }}"></div>
|
<div class="mdc-card__media mdc-card__media--16-9 {{ article.url | relative_url | replace: '/', '-' | replace: '.', '-' }}"></div>
|
||||||
@@ -27,3 +28,11 @@ layout: article-list
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<center>We haven't got any articles for you yet! Come back during this year's BBC Young Reporter day to see what Reading School's year 8 students have produced!</center>
|
||||||
|
<style>
|
||||||
|
center {
|
||||||
|
margin: 25vh auto 25vh auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user