-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does permalink:"{{ title | slugify }}"
support multi-byte languages like Japanese?
#2537
Comments
I believe that is Japanese, correct? One workaround might be using the page's filename instead of slugifying the title, if that works. ---
title: こんにちは
permalink: "/article/{{ page.fileSlug }}/"
---
<h1>{{ title }}</h1> UPDATE: Here's my build log: npm run build
> [email protected] build
> eleventy
[11ty] Writing www/article/こんにちは/index.html from ./src/こんにちは.md (liquid)
[11ty] Wrote 1 file in 0.06 seconds (v1.0.2) |
I also found https://github.com/lovell/limax which seems to support Japanese; if you were looking for translated slugified strings. // Overwrite the built-in `slugify` filter.
eleventyConfig.addFilter("slugify", require("limax")); src/こんにちは.md---
title: こんにちは
permalink: "/article/{{ title | slugify }}/"
---
<h1>{{ title }}</h1> OUTPUT> eleventy
[11ty] Writing www/article/konnichiha/index.html from ./src/こんにちは.md (liquid)
[11ty] Wrote 1 file in 0.06 seconds (v1.0.2) I'm not sure if that's transliterating correctly, but… maybe? |
@pdehaan Thank you sooo much!!
I tried this, and works fine! |
@pdehaan How should I do? |
This seems to work for me in [email protected]. src/こんにちは.md---
title: こんにちは
permalink: "/article/{{ title | slugify }}/"
tags: ["ねこ","犬"]
---
<h1>{{ title }}</h1> src/index.md---
title: multibyte 犬 test
---
<h1>collections['犬']</h1>
{% for p in collections['犬'] %}
title={{ p.data.title }}
{% endfor %} OUTPUT<h1>collections['犬']</h1>
<p>title=こんにちは</p> |
Thank you for your help! I'm using eleventy-base-blog, And now, "猫" tag is working fine. |
Pushed some warnings and guidance for this to https://www.11ty.dev/docs/filters/slugify/ Thanks y’all! |
I set post like below.
こんにちは.md
hello.md
And then, hello.md compiled
/article/hello/index.html
but こんにちは.md is compiled
/article/index.html
.Is this issue of slugify? or other issue?
The text was updated successfully, but these errors were encountered: