diff --git a/bin/create_hugo_pages.py b/bin/create_hugo_pages.py index d807ea52d1..a2ca3d17f0 100755 --- a/bin/create_hugo_pages.py +++ b/bin/create_hugo_pages.py @@ -137,7 +137,7 @@ def create_people(srcdir, clean=False): data = yaml.load(f, Loader=Loader) # Create a page stub for each person for name, entry in data.items(): - person_dir = "{}/content/people/{}".format(srcdir, name[0]) + person_dir = "{}/content/people/{}/{}".format(srcdir, entry["slug"][0], entry["slug"]) if not os.path.exists(person_dir): os.makedirs(person_dir) yaml_data = {"name": name, "title": entry["full"], "lastname": entry["last"]} diff --git a/bin/create_hugo_yaml.py b/bin/create_hugo_yaml.py index 0b93ef26c2..f5eb8f22dc 100755 --- a/bin/create_hugo_yaml.py +++ b/bin/create_hugo_yaml.py @@ -30,6 +30,7 @@ from docopt import docopt from collections import defaultdict +from slugify import slugify from tqdm import tqdm import logging as log import os @@ -76,7 +77,7 @@ def export_anthology(anthology, outdir, clean=False, dryrun=False): name = anthology.people.get_canonical_name(id_) log.debug("export_anthology: processing person '{}'".format(repr(name))) data = name.as_dict() - data["slug"] = id_ + data["slug"] = slugify(repr(name)) or "NONE" if id_ in anthology.people.comments: data["comment"] = anthology.people.comments[id_] if id_ in anthology.people.similar: diff --git a/data/yaml/name_variants.yaml b/data/yaml/name_variants.yaml index 6c73c6149e..ad962cc9af 100644 --- a/data/yaml/name_variants.yaml +++ b/data/yaml/name_variants.yaml @@ -7469,6 +7469,8 @@ - canonical: {first: Bruce, last: Porter} variants: - {first: Bruce W., last: Porter} +- canonical: {first: Matt, last: Post} + id: 0000-0002-1297-6794 - canonical: {first: Oana, last: Postolache} variants: - {first: Oana-Diana, last: Postolache} diff --git a/hugo/layouts/partials/author_link.html b/hugo/layouts/partials/author_link.html index 9c8c2669d0..4615fb490f 100644 --- a/hugo/layouts/partials/author_link.html +++ b/hugo/layouts/partials/author_link.html @@ -8,7 +8,8 @@ - person: A dict with key "id" (the ID of the person to link to, e.g., "hector-martinez-alonso"), and optional key "full" (a variant spelling) - class (optional): CSS classes for the link */}} -{{ $first_letter := slicestr .person.id 0 1 }} -{{ $entry := index .ctx.Site.Data.people $first_letter .person.id }} -{{ $link_to := printf "/people/%s/%s.md" $first_letter .person.id }} +{{ $id_first_letter := slicestr .person.id 0 1 }} +{{ $entry := index .ctx.Site.Data.people $id_first_letter .person.id }} +{{ $name_first_letter := slicestr $entry.slug 0 1 }} +{{ $link_to := printf "/people/%s/%s/%s.md" $name_first_letter $entry.slug .person.id }} {{ if isset .person "full" }}{{ .person.full }}{{ else }}{{ $entry.full }}{{ end }}