Skip to content

Commit

Permalink
Update location
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdoc committed Nov 5, 2023
1 parent 12a059f commit 84bb919
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 5 additions & 0 deletions src/_data/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ module.exports = function () {
linkedin: "theglobechurch",
email: "[email protected]",
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"
}
};
};
2 changes: 1 addition & 1 deletion src/_includes/blocks/augmentedPages.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set aug = collections.augmented | augmentedPageCheck(p.slug) %}

{% if aug %}
{% if aug and aug.data.pagePosition === augLocation %}
{% if build.env !== "production" %}
<!-- Augmented Content from ./src/augmentedContent/{{p.slug}} -->
{% endif %}
Expand Down
6 changes: 6 additions & 0 deletions src/_utils/11ty.shortcodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ module.exports = {
return `<svg class="${cls}">${title}<use xlink:href="/_assets/svgSprite.svg#svg-${name}"></use></svg>`;
},

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';
Expand Down
1 change: 1 addition & 0 deletions src/augmentedPages/about.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
pagePosition: bottom
---

<section class="mt-20 c-church-value c-church-value--relational">
Expand Down
4 changes: 4 additions & 0 deletions src/augmentedPages/contact.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagePosition: bottom
---

<section class="mt-12 px-4">
<div class="lg:container mx-auto mb-4 p-4 border border-orange sm:mb-8" id="newsletter">
<h2 class="glbHeading">Stay in touch</h2>
Expand Down
18 changes: 18 additions & 0 deletions src/augmentedPages/sundays.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
pagePosition: top
---

{% if meta.overrides and meta.overrides.location %}
<div class="mx-auto lg:container mb-4 border-orange border p-4">

<span class="rounded bg-orange px-2 py-1 mb-2 text-xs text-white inline-block uppercase font-bold">
venue change
</span>

<p>The Globe Church is meeting this Sunday, <strong>{{ meta.overrides.serviceTime }}</strong> at <strong>{{ meta.overrides.location }}</strong>.</p>

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

<p><a href="{% mapUrl meta.overrides.location %}" class="text-blue decoration-orange" target="_blank" rel="noopener">See a map</a>.</p>
</div>
{% endif %}
14 changes: 14 additions & 0 deletions src/calendar/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,25 @@ featuredImage: "./src/_assets/img/core/the-globe-church-people.jpg"
<div class="inset-4 mx-auto lg:container grid items-center sm:bg-transparent sm:absolute">
<div class="p-8 sm:px-4 sm:max-w-[40%] text-white lg:text-lg">
<h1 class="glbHeading text-white lg:text-2xl">Church Calendar</h1>

{% if meta.overrides and meta.overrides.location %}
<p class="max-w-lg mt-4">
<span class="rounded bg-white px-2 py-1 mb-2 text-xs text-orange inline-block uppercase font-bold">
venue change
</span>
<br />
The Globe Church is meeting this Sunday, <strong>{{ meta.overrides.serviceTime }}</strong> at <strong>{{ meta.overrides.location }}</strong>.
<br /><br />
It's a few minutes walk from {{ meta.overrides.nearestUnderground }} Underground station.
</p>
{% else %}
<p class="my-4">
{{ meta.sundays | safe }}
</p>
{% endif %}

<p class="my-4"><a href="/sundays" class="glbBtn bg-blue hover:bg-white hover:text-orange">Join us this Sunday</a></p>

<p>
<a href="#thisWeek" class="text-white no-underline inline-flex gap-2 items-center group">
{% svgIcon "icon-arrowDown", "h-6 w-6 inline-block transition group-hover:translate-y-1" %}
Expand Down
16 changes: 16 additions & 0 deletions src/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,29 @@ eleventyComputed:
this Sunday
</h2>
{% if meta.overrides and meta.overrides.location %}
<p class="max-w-lg">
<span class="rounded bg-orange px-2 py-1 mb-2 text-xs text-white inline-block uppercase font-bold">
venue change
</span>
<br />
The Globe Church is meeting this Sunday, <strong>{{ meta.overrides.serviceTime }}</strong> at <strong>{{ meta.overrides.location }}</strong>.
<br /><br />
It's a few minutes walk from {{ meta.overrides.nearestUnderground }} Underground station.
</p>
<p class="mt-8">
<a href="/sundays" class="px-2 py-1 mr-2 rounded bg-blue text-white no-underline transition-colors hover:bg-orange">Find out more</a>
<a href="{% mapUrl meta.overrides.location %}" class="text-blue decoration-orange" target="_blank" rel="noopener">See a map</a>
</p>
{% else %}
<div>
<p class="max-w-lg">{{ meta.sundays | safe }}</p>
<p class="mt-8">
<a href="/sundays" class="px-2 py-1 mr-2 rounded bg-blue text-white no-underline transition-colors hover:bg-orange">Find out more</a>
<a href="https://goo.gl/maps/ZYWE7cPGxr9NWBB1A" class="text-blue decoration-orange" target="_blank" rel="noopener">See a map</a>
</p>
</div>
{% endif %}
</div>
<div class="block relative min-h-[200px] order-1 sm:order-2 sm:min-h-[400px] w-full bg-cover bg-center text-white overflow-hidden">
Expand Down
4 changes: 4 additions & 0 deletions src/pages/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
{% endif %}
</header>

{% set augLocation = "top" %}
{% include 'blocks/augmentedPages.njk' %}


<div class="mx-auto lg:container">
<article class="px-4 prose prose-globeBlue">
Expand All @@ -42,6 +45,7 @@

</main>

{% set augLocation = "bottom" %}
{% include 'blocks/augmentedPages.njk' %}

{% if childPages | length > 0 or parentPage | length > 0 %}
Expand Down

0 comments on commit 84bb919

Please sign in to comment.