mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Make editing footer & navbar links easier
Pull links from resource files
This commit is contained in:
@@ -2,15 +2,17 @@
|
||||
<section>
|
||||
<h4>Reading School</h4>
|
||||
<ul class="plain">
|
||||
<li><a href="https://twitter.com/readingsch" target="_blank"><i class="icon fa-twitter"> </i>Twitter</a></li>
|
||||
<li><a href="https://instagram.com/reading_sch" target="_blank"><i class="icon fa-instagram"> </i>Instagram</a></li>
|
||||
<li><a href="https://facebook.com/ReadingSchoolOfficial" target="_blank"><i class="icon fa-facebook"> </i>Facebook</a></li>
|
||||
{% for link in site.data.school-links %}
|
||||
<li><a href="{{ link.url }}" target="_blank"><i class="icon fa-{{ link.icon }}"> </i>{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
<section>
|
||||
<h4>English Department</h4>
|
||||
<ul class="plain">
|
||||
<li><a href="https://twitter.com/RSEnglishDept" target="_blank"><i class="icon fa-twitter"> </i>Twitter</a></li>
|
||||
{% for link in site.data.english-department-links %}
|
||||
<li><a href="{{ link.url }}" target="_blank"><i class="icon fa-{{ link.icon }}"> </i>{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -10,17 +10,18 @@
|
||||
<!-- Nav -->
|
||||
<nav id="menu">
|
||||
<ul class="links">
|
||||
<li><a href="https://reading-school.co.uk" class="main-navbar-link">Reading School Website</a></li>
|
||||
<li><a href="/" class="{% if page.url == '/' %}current-page-link{% endif %} main-navbar-link">Home</a></li>
|
||||
{% for link in site.data.navigation-links %}
|
||||
<li><a href="{{ link.url }}" target="_blank" class="{% if page.url == link.url %}current-page-link{% endif %} main-navbar-link">{{ link.title }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
{% for article in site.articles reversed %}
|
||||
{% assign currentdate = article.date | date: "%Y" %}
|
||||
{% if currentdate != date %}
|
||||
{% assign year_url = "/years/" | append: currentdate | append: ".html" %}
|
||||
<li><a href="/years/{{ currentdate }}" class="{% if page.url == year_url %}current-page-link{% endif %} year-navbar-link"></a>{{ currentdate }}</a></li>
|
||||
{% assign date = currentdate %}
|
||||
{% endif %}
|
||||
<li><a href="{{ article.url | relative_url }}" class="{% if article.url == page.url %}current-page-link{% endif %} article-navbar-link">{{ article.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% for article in site.articles reversed %}
|
||||
{% assign currentdate = article.date | date: "%Y" %}
|
||||
{% if currentdate != date %}
|
||||
{% assign year_url = "/years/" | append: currentdate | append: ".html" %}
|
||||
<li><a href="/years/{{ currentdate }}" class="{% if page.url == year_url %}current-page-link{% endif %} year-navbar-link"></a>{{ currentdate }}</a></li>
|
||||
{% assign date = currentdate %}
|
||||
{% endif %}
|
||||
<li><a href="{{ article.url | relative_url }}" class="{% if article.url == page.url %}current-page-link{% endif %} article-navbar-link">{{ article.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user