Skip to content

Commit 47eb0fd

Browse files
author
Phil Hawksworth
committed
escape URL clashing characters
1 parent 1297200 commit 47eb0fd

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.eleventy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ module.exports = function(eleventyConfig) {
163163

164164
eleventyConfig.addFilter("replace", (str, from, to) => {
165165
if (str) {
166-
// return str.replace(/from/g, to);
167166
return str.replace(new RegExp(from, "g"), to);
168167
}
169168
});

src/site/glossary-pages.njk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ layout: layouts/base.njk
99

1010
eleventyComputed:
1111
title: "{{ item.term }}"
12-
description: "What is {{ item.term }}? {{ item.summary }}"
13-
ogimage: "/img/og/glossary/{{ item.term }}/{{ item.summary | replace(',','%252C') }}"
12+
description: "What is {{ item.term }}? {{ item.summary}}"
13+
ogimage: "/img/og/glossary/{{ item.term | replace(',','%252C') | replace('/', '%252F') }}/{{ item.summary | replace(',','%252C') | replace('/', '%252F') }}"
1414

1515
---
1616

1717

1818
<section class="mt-16">
1919
<h1 class="text-3xl">Glossary</h1>
20-
<p class="w-2/3"><a href="/glossary">A collection of terms</a> often used when talking about Jamstack and associated web technologies.</p>
20+
<p class="w-2/3"><a href="/glossary/">A collection of terms</a> often used when talking about Jamstack and associated web technologies.</p>
2121
</section>
2222

2323
<section class="border-gray-400 border-b mb-10">

0 commit comments

Comments
 (0)