diff --git a/.eleventy.js b/.eleventy.js index 54aa362..af07320 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -22,6 +22,7 @@ module.exports = function (eleventyConfig) { // Shortcodes eleventyConfig.addNunjucksAsyncShortcode("rwdImg", shortcodes.rwdImg); eleventyConfig.addNunjucksAsyncShortcode("socialImg", shortcodes.socialImg); + eleventyConfig.addNunjucksShortcode("mapUrl", shortcodes.mapUrl); eleventyConfig.addNunjucksShortcode("svgIcon", shortcodes.svgIcon); eleventyConfig.addNunjucksShortcode("dateRange", shortcodes.dateRange); diff --git a/src/_data/meta.js b/src/_data/meta.js index edc7a4d..952ba88 100644 --- a/src/_data/meta.js +++ b/src/_data/meta.js @@ -18,5 +18,10 @@ module.exports = function () { linkedin: "theglobechurch", email: "info@globe.church", registeredAddress: "GlobeOffice, 83 Mill Lofts, County St, London SE1 4AD", + overrides: { + serviceTime: "4pm", + location: "Haberdashers’ Borough Academy,94b Southwark Bridge Rd, London SE1 0EX", + nearestUnderground: "Borough" + } }; }; diff --git a/src/_includes/blocks/augmentedPages.njk b/src/_includes/blocks/augmentedPages.njk index 15da052..afc8a27 100644 --- a/src/_includes/blocks/augmentedPages.njk +++ b/src/_includes/blocks/augmentedPages.njk @@ -1,6 +1,6 @@ {% set aug = collections.augmented | augmentedPageCheck(p.slug) %} -{% if aug %} +{% if aug and aug.data.pagePosition === augLocation %} {% if build.env !== "production" %} {% endif %} diff --git a/src/_utils/11ty.shortcodes.js b/src/_utils/11ty.shortcodes.js index faac12c..1c14be2 100644 --- a/src/_utils/11ty.shortcodes.js +++ b/src/_utils/11ty.shortcodes.js @@ -58,6 +58,12 @@ module.exports = { return `${title}`; }, + mapUrl: function(address) { + if (!address) { return null } + + return `https://www.google.com/maps/search/?api=1&query=${ encodeURIComponent(address) }`; + }, + dateRange: function(startDate, endDate) { const my = 'MMMM YYYY'; diff --git a/src/augmentedPages/about.njk b/src/augmentedPages/about.njk index 2324d8e..997ae27 100644 --- a/src/augmentedPages/about.njk +++ b/src/augmentedPages/about.njk @@ -1,4 +1,5 @@ --- +pagePosition: bottom ---
diff --git a/src/augmentedPages/contact.njk b/src/augmentedPages/contact.njk index 4cdc9e0..64501a3 100644 --- a/src/augmentedPages/contact.njk +++ b/src/augmentedPages/contact.njk @@ -1,3 +1,7 @@ +--- +pagePosition: bottom +--- +

Stay in touch

diff --git a/src/augmentedPages/sundays.njk b/src/augmentedPages/sundays.njk new file mode 100644 index 0000000..6a5151f --- /dev/null +++ b/src/augmentedPages/sundays.njk @@ -0,0 +1,18 @@ +--- +pagePosition: top +--- + +{% if meta.overrides and meta.overrides.location %} +
+ + + venue change + + +

The Globe Church is meeting this Sunday, {{ meta.overrides.serviceTime }} at {{ meta.overrides.location }}.

+ +

It's a few minutes walk from {{ meta.overrides.nearestUnderground }} Underground station.

+ +

See a map.

+
+{% endif %} diff --git a/src/calendar/index.njk b/src/calendar/index.njk index e3d56fa..51feca4 100644 --- a/src/calendar/index.njk +++ b/src/calendar/index.njk @@ -20,11 +20,25 @@ featuredImage: "./src/_assets/img/core/the-globe-church-people.jpg"

Church Calendar

+ + {% if meta.overrides and meta.overrides.location %} +

+ + venue change + +
+ The Globe Church is meeting this Sunday, {{ meta.overrides.serviceTime }} at {{ meta.overrides.location }}. +

+ It's a few minutes walk from {{ meta.overrides.nearestUnderground }} Underground station. +

+ {% else %}

{{ meta.sundays | safe }}

+ {% endif %}

Join us this Sunday

+

{% svgIcon "icon-arrowDown", "h-6 w-6 inline-block transition group-hover:translate-y-1" %} diff --git a/src/index.njk b/src/index.njk index 83224ad..4c0e8e8 100644 --- a/src/index.njk +++ b/src/index.njk @@ -35,6 +35,21 @@ eleventyComputed: this Sunday + {% if meta.overrides and meta.overrides.location %} +

+ + venue change + +
+ The Globe Church is meeting this Sunday, {{ meta.overrides.serviceTime }} at {{ meta.overrides.location }}. +

+ It's a few minutes walk from {{ meta.overrides.nearestUnderground }} Underground station. +

+

+ Find out more + See a map +

+ {% else %}

{{ meta.sundays | safe }}

@@ -42,6 +57,7 @@ eleventyComputed: See a map

+ {% endif %}
diff --git a/src/pages/page.njk b/src/pages/page.njk index abf8a9a..236317e 100644 --- a/src/pages/page.njk +++ b/src/pages/page.njk @@ -33,6 +33,9 @@ {% endif %} + {% set augLocation = "top" %} + {% include 'blocks/augmentedPages.njk' %} +
@@ -42,6 +45,7 @@ +{% set augLocation = "bottom" %} {% include 'blocks/augmentedPages.njk' %} {% if childPages | length > 0 or parentPage | length > 0 %}