Skip to content

How Do I Make A Tag Page For A Tag With an Apostrophe? #3202

Closed Answered by Thysbelon
Thysbelon asked this question in Q&A
Discussion options

You must be logged in to vote

I think nunjucks is the reason I was struggling. I made two similar templates:

test's.njk

---
customKey: "test's"
permalink: "/{{ customKey | replace(''',`'`) }}/"
---
<h1>Test</h1>

test's2.11ty.js

module.exports = {

data() {
	return {
		customKey: "test's2",
		permalink: data => `/${data.customKey}/`
	}
},

render(data) {
return `
	<h1>test2</h1>
`;
}
}

The njk template generated test&#39;s. The 11ty.js template generated test's2

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Thysbelon
Comment options

You must be logged in to vote
1 reply
@pdehaan
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants