Skip to content

Commit

Permalink
Conditionally add students to the main nav
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdoc committed Sep 10, 2024
1 parent ed450da commit 76d8479
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy({"src/_assets/img/passThrough/the-globe-church-og.jpg": "_assets/img/the-globe-church-og.jpg"});
eleventyConfig.addPassthroughCopy({"src/_assets/img/passThrough/**": "assets/img/passThrough"});

eleventyConfig.addGlobalData("buildDate", new Date());

return {
templateFormats: ["html", "njk", "md", "11ty.js"],
pathPrefix: "/",
Expand Down
6 changes: 6 additions & 0 deletions src/_includes/blocks/header.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% set currentMonth = buildDate.getMonth() + 1 %}

<a class="sr-only" href="#site-content">
Skip to site content
</a>
Expand Down Expand Up @@ -55,6 +57,10 @@
<a class="text-white text-xl no-underline hover:underline" href="/preaching">Preaching</a>
<a class="text-white text-xl no-underline hover:underline" href="/blog">Church Blog</a>
<a class="text-white text-xl no-underline hover:underline" href="/get-involved">Get Involved</a>
{# conditionally show if July–October #}
{% if (currentMonth > 7) and (currentMonth < 11) %}
<a class="text-white text-xl no-underline hover:underline" href="/get-involved/students/">Students</a>
{% endif %}
<a class="text-white text-xl no-underline hover:underline" href="/contact">Contact</a>
</nav>

Expand Down

0 comments on commit 76d8479

Please sign in to comment.