Skip to content

Commit fec19d9

Browse files
authored
Reverse name order when building author list (#206)
* Reverse name order when building author list * Oops put the previous fix back in
1 parent 94aba6a commit fec19d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

site/_extensions/gallery_generator.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def _run_cffconvert(command):
4343
error_message = stderr.decode("utf-8").strip()
4444
raise RuntimeError(f"cffconvert command failed: {error_message}")
4545

46+
def _make_standard_name(name):
47+
'''Take string input like LASTNAME, FIRSTNAME and return FIRSTNAME LASTNAME without comma'''
48+
lastfirst = name.split(', ')
49+
firstlast = lastfirst[::-1]
50+
standard = ' '.join(firstlast)
51+
return standard
4652

4753
def generate_repo_dicts(all_items):
4854

@@ -60,7 +66,7 @@ def generate_repo_dicts(all_items):
6066
cookbook_title = citation_dict["title"]
6167
description = citation_dict["description"]
6268
creators = citation_dict["creators"]
63-
names = [creator.get("name") for creator in creators]
69+
names = [_make_standard_name(creator.get("name")) for creator in creators]
6470
authors = ", ".join(names)
6571

6672
gallery_info_url = f"https://raw.githubusercontent.com/ProjectPythia/{repo}/main/_gallery_info.yml"

0 commit comments

Comments
 (0)