What about german umlauts in yml files?

in setting files - is it ok to use umlauts like ‘ä’ as they are or can/should I write them like in html: ä
in .md files I can use tags but what about the yml files?
thank you.

Umlauts are nowadays just a case of unicode. And it works in yml files, I just added an umlaut to my “author: …” field and it appeared correctly in the pertinent header file.

thank you, yes it does - I just wanted to see if there are any potential issues with doing this.
So is the whole uuml tagging not needed anymore? I see some sites that have the ‘raw’ umlauts in the html …

As long as the HTML document is marked as UTF-8 (i.e. <meta charset="utf-8">), you can freely use raw/unescaped characters.

1 Like

Yes I have used raw / unescaped accent characters or emojis before in HTML.

You could store them unescaped in YAML or markdown and force Jekyll to escape as HTML them if you need. Don’t know if this filter is what you was but can’t see alternatives

---
field: 'ë'
---

{{ page.field |  escape }}

Filters

From CloudCannon, linked there

Returns an escaped version of html.

{{ "<p>Jekyll</p>" | escape }}
&amp;lt;p&amp;gt;Jekyll&amp;lt;/p&amp;gt;
1 Like

ok - so what do I do if the umlaut is in the title (name) of a blogpost?

if I write … br&uuml;he the post appears properly as brühe but the resulting url is 404
if I write … bruehe the resulting url works but the post shows bruehe as title
if I write … brühe the title works and the url works but the url ending is bru-he …
what to do?

oh, wait - I can name the title in front matter … too easy

1 Like

I couldn’t reproduce the 404 you mention. Could you give more details, like OS, Ruby/Jekyll, Web server, etc?

Here’s the quick test I ran (macOS 11, Ruby 2.7, Jekyll 4, Jekyll’s server):

jekyll new test
cd test

With editor:
Rename: _post/2021-02-10-welcome-to-jekyll.markdown
To: _post/2021-02-10-welcome-to-brühe.markdown
Change post title to: title: "Welcome to brühe!"

Now when I run it with Jekyll built-in server, the navigation works fine:

bundle exec jekyll serve

same here macos 11 ruby 2.7 jekyll 4 jekyll’s server
navigation works fine - yes …

but what does your url say? - mine would be
localhost:4000/blog/bru-he (and bru-he is not bruehe … for grep and so on)

the 404 is when I tag it - &uuml; in the file name of the .md … sorry I forgot to preformat that in the original post

In all popular browsers, the post’s URL is displayed in the address bar as:

http://127.0.0.1:4000/jekyll/update/2021/02/10/welcome-to-brühe.html

Copying the URL with Safari gives the identical Unicode text, whilst other browsers incorrectly (some would say conservatively) copy it as ASCII with percent-encoding:

http://127.0.0.1:4000/jekyll/update/2021/02/10/welcome-to-br%C3%BChe.html

Jekyll’s page.url shows the original file names bytes (decomposed-Unicode) with percent-encoding:
.../welcome-to-bru%CC%88he.html

Are you using &uuml; in the actual file name (i.e. in the Finder)? Or to encode HREF attributes?

in the actual filename - date-title.md - but now I will name it ‘bruehe’ and then adjust the title in the frontmatter to the raw brühe :slight_smile:

interesting - my safari won’t show the raw umlaut in this jekyll theme in the url - gets replaced by ‘u-’

I find chrome shows URLs escaped but firefox shows them as readable. Such as quotes or colon in a query.