Skip to content

Commit 800042e

Browse files
authored
Merge pull request #49 from MWDelaney/slugify-fix
Fix slugify bug(ify)
2 parents 6aaf287 + 12bbcd3 commit 800042e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/content/pages/pages.11tydata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
export default {
1717
eleventyComputed: {
1818
// Generate permalink URLs for pages
19-
permalink: (data) => {
19+
permalink: function(data) {
2020
// If the page has an explicit permalink, use it
2121
if (data.permalink) return data.permalink;
2222

2323
// If no permalink is provided, generate permalink from title using slugify filter
2424
if (data.title) {
25-
const slug = data.eleventy.env.filters.slugify(data.title);
25+
const slug = this.slugify(data.title);
2626
return `/${slug}/`;
2727
}
2828

src/content/posts/posts.11tydata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
export default {
1818
eleventyComputed: {
1919
// Generate permalink URLs for blog posts
20-
permalink: (data) => {
20+
permalink: function(data) {
2121

2222
// If the post date is in the future, do not publish
2323
if (data.date && new Date(data.date) > new Date()) {
@@ -29,7 +29,7 @@ export default {
2929

3030
// If no permalink is provided, generate permalink from title using slugify filter
3131
if (data.title) {
32-
const slug = data.eleventy.env.filters.slugify(data.title);
32+
const slug = this.slugify(data.title);
3333
return `/blog/${slug}/`;
3434
}
3535

0 commit comments

Comments
 (0)