diff --git a/_data/coauthors.yml b/_data/coauthors.yml index 8ed521248d81..5a989cf01e3e 100644 --- a/_data/coauthors.yml +++ b/_data/coauthors.yml @@ -1,34 +1,34 @@ -"Adams": +"adams": - firstname: ["Edwin", "E.", "E. P.", "Edwin Plimpton"] url: https://en.wikipedia.org/wiki/Edwin_Plimpton_Adams -"Podolsky": +"podolsky": - firstname: ["Boris", "B.", "B. Y.", "Boris Yakovlevich"] url: https://en.wikipedia.org/wiki/Boris_Podolsky -"Rosen": +"rosen": - firstname: ["Nathan", "N."] url: https://en.wikipedia.org/wiki/Nathan_Rosen -"Bach": +"bach": - firstname: ["Johann Sebastian", "J. S."] url: https://en.wikipedia.org/wiki/Johann_Sebastian_Bach - firstname: ["Carl Philipp Emanuel", "C. P. E."] url: https://en.wikipedia.org/wiki/Carl_Philipp_Emanuel_Bach -"Przibram": +"przibram": - firstname: ["Karl"] url: https://link.springer.com/article/10.1007/s00016-019-00242-z -"Schrödinger": +"schrodinger": - firstname: ["Erwin"] url: https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger -"Lorentz": +"lorentz": - firstname: ["Hendrik Antoon"] url: https://en.wikipedia.org/wiki/Hendrik_Lorentz -"Planck": +"planck": - firstname: ["Max"] url: https://en.wikipedia.org/wiki/Max_Planck diff --git a/_layouts/bib.html b/_layouts/bib.html index 6ef0648c523f..248a90751ab6 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -52,8 +52,9 @@ {%- endif -%} {%- endif -%} {%- assign coauthor_url = nil -%} - {%- if site.data.coauthors[author_last_name] -%} - {%- for coauthor in site.data.coauthors[author_last_name] -%} + {%- assign clean_last_name = author_last_name | downcase | remove_accents -%} + {%- if site.data.coauthors[clean_last_name] -%} + {%- for coauthor in site.data.coauthors[clean_last_name] -%} {%- if coauthor.firstname contains author.first -%} {%- assign coauthor_url = coauthor.url -%} {%- break -%} diff --git a/_plugins/remove-accents.rb b/_plugins/remove-accents.rb new file mode 100644 index 000000000000..2dd40a4016ac --- /dev/null +++ b/_plugins/remove-accents.rb @@ -0,0 +1,32 @@ +# based on https://distresssignal.org/busting-css-cache-with-jekyll-md5-hash +# https://gist.github.com/BryanSchuetz/2ee8c115096d7dd98f294362f6a667db +module Jekyll + module CleanString + class RemoveAccents + require 'i18n' + I18n.config.available_locales = :en + + attr_accessor :string + + def initialize(string:) + self.string = string + end + + def digest! + remove_accents + end + + private + + def remove_accents + I18n.transliterate(string) + end + end + + def remove_accents(string) + RemoveAccents.new(string: string).digest! + end + end +end + +Liquid::Template.register_filter(Jekyll::CleanString) \ No newline at end of file