Skills metadata

merge-requests/30/head
Bob Mottram 2021-05-16 11:52:16 +01:00
parent a0d10b7c14
commit c1eda4399b
2 changed files with 6 additions and 2 deletions

View File

@ -578,9 +578,11 @@ def personUpgradeActor(baseDir: str, personJson: {},
if personJson.get('occupationName'): if personJson.get('occupationName'):
occupationName = personJson['occupationName'] occupationName = personJson['occupationName']
del personJson['occupationName'] del personJson['occupationName']
updateActor = True
if personJson.get('occupation'): if personJson.get('occupation'):
occupationName = personJson['occupation'] occupationName = personJson['occupation']
del personJson['occupation'] del personJson['occupation']
updateActor = True
# if the older skills format is being used then switch # if the older skills format is being used then switch
# to the new one # to the new one

View File

@ -722,10 +722,12 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str,
skillsMarkup = '' skillsMarkup = ''
if actorJson.get('hasOccupation'): if actorJson.get('hasOccupation'):
skillsList = actorJson['hasOccupation']['skills'] occupationStr = ''
if actorJson['hasOccupation'].get('name'): if actorJson['hasOccupation'].get('name'):
occupationName = actorJson['hasOccupation']['name'] occupationName = actorJson['hasOccupation']['name']
occupationStr = ' "name": "' + occupationName + '",\n' occupationStr += ' "name": "' + occupationName + '",\n'
skillsList = actorJson['hasOccupation']['skills']
if skillsList:
skillsMarkup = \ skillsMarkup = \
' "hasOccupation": {\n' + \ ' "hasOccupation": {\n' + \
' "@type": "Occupation",\n' + \ ' "@type": "Occupation",\n' + \