From 7024decef451cdf34251198e182c5d086e5777bb Mon Sep 17 00:00:00 2001 From: Maxime Vaillancourt Date: Tue, 15 Mar 2022 18:34:44 -0400 Subject: [PATCH] Add support for non-latin note titles --- _notes/your-first-note.md | 2 ++ _notes/안녕하세요.md | 6 ++++++ _plugins/bidirectional_links_generator.rb | 7 +------ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 _notes/안녕하세요.md diff --git a/_notes/your-first-note.md b/_notes/your-first-note.md index c80bdde..30da1fd 100644 --- a/_notes/your-first-note.md +++ b/_notes/your-first-note.md @@ -15,6 +15,8 @@ To link to another note, you can use multiple syntaxes. The following four use t - Using the note's title, with a label: [[A note about cats|link to the note about cats using the note title]] - Using the note's filename, with a label: [[cats|link to the note about cats using the note's filename]] +Non-latin languages are supported too: [[안녕하세요]]. + In all cases, if the double-bracket link does not point to a valid note, the double brackets will still be shown, like this: [[there is no note that matches this link]]. Alternatively, you can use regular [Markdown syntax](https://www.markdownguide.org/getting-started/) for links, with a relative link to the other note, like this: [this is a Markdown link to the note about cats](/cats){: .internal-link}. Don't forget to use the `.internal-link` class to make sure the link is styled as an internal link (without the little arrow). diff --git a/_notes/안녕하세요.md b/_notes/안녕하세요.md new file mode 100644 index 0000000..fab3466 --- /dev/null +++ b/_notes/안녕하세요.md @@ -0,0 +1,6 @@ +--- +title: 안녕하세요 +--- + +This template supports any language. Come as you are! :) + diff --git a/_plugins/bidirectional_links_generator.rb b/_plugins/bidirectional_links_generator.rb index d588a27..430b96a 100644 --- a/_plugins/bidirectional_links_generator.rb +++ b/_plugins/bidirectional_links_generator.rb @@ -104,11 +104,6 @@ class BidirectionalLinksGenerator < Jekyll::Generator end def note_id_from_note(note) - note.data['title'] - .dup - .gsub(/\W+/, ' ') - .delete(' ') - .to_i(36) - .to_s + note.data['title'].bytes.join end end