diff --git a/README.md b/README.md index ee96923..3eae9ce 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,36 @@ Your publications page is generated automatically from your BibTex bibliography. Simply edit `_bibliography/papers.bib`. You can also add new `*.bib` files and customize the look of your publications however you like by editing `_pages/publications.md`. +#### Author Annotation +In publications, the author entry for your self is identified by string `scholar:last_name` and string array `scholar:first_name` in `_config.yml`. If the entry matches the last name and one form of the first names, it will be underlined. +``` +scholar: + last_name: Einstein + first_name: [Albert, A.] +``` Keep meta-information about your co-authors in `_data/coauthors.yml` and Jekyll will insert links to their webpages automatically. +The coauthor data format in `_data/coauthors.yml` is as follows, +``` +"Adams": + - firstname: ["Edwin", "E.", "E. P.", "Edwin Plimpton"] + url: https://en.wikipedia.org/wiki/Edwin_Plimpton_Adams + +"Podolsky": + - firstname: ["Boris", "B.", "B. Y.", "Boris Yakovlevich"] + url: https://en.wikipedia.org/wiki/Boris_Podolsky + +"Rosen": + - firstname: ["Nathan", "N."] + url: https://en.wikipedia.org/wiki/Nathan_Rosen + +"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 +``` +If the entry matches one of the combinations of the last names and the first names, it will be highlighted and linked to the url provided.

diff --git a/_data/coauthors.yml b/_data/coauthors.yml index 21ed65b..0c1c954 100644 --- a/_data/coauthors.yml +++ b/_data/coauthors.yml @@ -1,8 +1,18 @@ -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": + - 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 diff --git a/_layouts/bib.html b/_layouts/bib.html index 241ac1c..b31e8a9 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -25,6 +25,16 @@ {% assign author_is_self = true %} {% endif %} {% endif %} + {% assign coauthor_url = nil %} + {% if site.data.coauthors[author.last] %} + {% for coauthor in site.data.coauthors[author.last] %} + {% if coauthor.firstname contains author.first %} + {% assign coauthor_url = coauthor.url %} + {% break %} + {% endif %} + {% endfor %} + {% endif %} + {% if forloop.length == 1 %} {% if author_is_self %} {{author.last}}, {{author.first}} @@ -36,8 +46,8 @@ {% if author_is_self %} {{author.last}}, {{author.first}}, {% else %} - {% if site.data.coauthors[author.last] %} - {{author.last}}, {{author.first}}, + {% if coauthor_url %} + {{author.last}}, {{author.first}}, {% else %} {{author.last}}, {{author.first}}, {% endif %} @@ -46,8 +56,8 @@ {% if author_is_self %} and {{author.last}}, {{author.first}} {% else %} - {% if site.data.coauthors[author.last] %} - and {{author.last}}, {{author.first}} + {% if coauthor_url %} + and {{author.last}}, {{author.first}} {% else %} and {{author.last}}, {{author.first}} {% endif %}