Duplicate note title to prevent in-place modification

Fixes https://github.com/maximevaillancourt/digital-garden-jekyll-template/issues/21
This commit is contained in:
Maxime Vaillancourt 2020-11-02 22:54:30 +00:00 committed by GitHub
parent 51ac8b2390
commit 8538d12445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,11 @@ class BidirectionalLinksGenerator < Jekyll::Generator
end end
def note_id_from_note(note) def note_id_from_note(note)
note.data['title'].gsub!(/\W+/, ' ') note.data['title']
note.data['title'].delete(' ').to_i(36).to_s .dup
.gsub(/\W+/, ' ')
.delete(' ')
.to_i(36)
.to_s
end end
end end