From 3dc34bd77d1c6258bf1e63ba3308d94f2e2e1855 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 10:12:10 +0100 Subject: [PATCH 01/14] Set locations for roles --- person.py | 14 ++++++++++++++ skills.py | 5 +++++ tests.py | 8 ++++++++ 3 files changed, 27 insertions(+) diff --git a/person.py b/person.py index ea7b228b2..d9f407690 100644 --- a/person.py +++ b/person.py @@ -288,6 +288,10 @@ def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int, { '@type': 'Occupation', 'name': "", + "location": { + "@type": "VirtualLocation", + "url": httpPrefix + '://' + domain + }, 'skills': [] } ], @@ -584,10 +588,15 @@ def personUpgradeActor(baseDir: str, personJson: {}, # if the older skills format is being used then switch # to the new one if not personJson.get('hasOccupation'): + personDomain = personJson['id'].split('/users/')[0] personJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': occupationName, + "location": { + "@type": "VirtualLocation", + "url": personDomain + }, 'skills': [] } ] @@ -605,10 +614,15 @@ def personUpgradeActor(baseDir: str, personJson: {}, updateActor = True if not isinstance(personJson['hasOccupation'], list): + personDomain = personJson['id'].split('/users/')[0] personJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': occupationName, + "location": { + "@type": "VirtualLocation", + "url": personDomain + }, 'skills': [] } ] diff --git a/skills.py b/skills.py index c97c678fd..f55e4b8fe 100644 --- a/skills.py +++ b/skills.py @@ -82,10 +82,15 @@ def setActorSkillLevel(actorJson: {}, if not actorJson: return True if not actorJson.get('hasOccupation'): + actorDomain = actorJson['id'].split('/users/')[0] actorJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': '', + "location": { + "@type": "VirtualLocation", + "url": actorDomain + }, 'skills': [] } ] diff --git a/tests.py b/tests.py index 5b22e7860..8d95bef52 100644 --- a/tests.py +++ b/tests.py @@ -3666,6 +3666,10 @@ def testSkills() -> None: { '@type': 'Occupation', 'name': "Sysop", + "location": { + "@type": "VirtualLocation", + "url": "https://jazzy.hedgehog" + }, 'skills': [] } ] @@ -3688,6 +3692,10 @@ def testRoles() -> None: { '@type': 'Occupation', 'name': "Sysop", + "location": { + "@type": "VirtualLocation", + "url": "https://mostly.giraffe" + }, 'skills': [] } ] From a9740565ca86b6270de3ff76581e17d89b191dea Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 10:28:15 +0100 Subject: [PATCH 02/14] Set location on role --- person.py | 19 ++++++++++++++++--- roles.py | 5 +++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/person.py b/person.py index d9f407690..b1662e443 100644 --- a/person.py +++ b/person.py @@ -619,14 +619,27 @@ def personUpgradeActor(baseDir: str, personJson: {}, { '@type': 'Occupation', 'name': occupationName, - "location": { - "@type": "VirtualLocation", - "url": personDomain + 'location': { + '@type': 'VirtualLocation', + 'url': personDomain }, 'skills': [] } ] updateActor = True + else: + # add location if it is missing + for index in range(len(personJson['hasOccupation'])): + ocItem = personJson['hasOccupation'][index] + if ocItem.get('hasOccupation'): + ocItem = ocItem['hasOccupation'] + if not ocItem.get('location'): + personDomain = personJson['id'].split('/users/')[0] + ocItem['location'] = { + "@type": "VirtualLocation", + "url": personDomain + } + updateActor = True # if no roles are defined then ensure that the admin # roles are configured diff --git a/roles.py b/roles.py index 3655c99e9..76ea529d0 100644 --- a/roles.py +++ b/roles.py @@ -140,11 +140,16 @@ def _setActorRole(actorJson: {}, roleName: str) -> bool: if occupationItem['hasOccupation']['name'] == roleName: return True statusNumber, published = getStatusNumber() + actorDomain = actorJson['id'].split('/users/')[0] newRole = { "@type": "Role", "hasOccupation": { "@type": "Occupation", "name": roleName, + 'location': { + '@type': 'VirtualLocation', + 'url': actorDomain + }, "occupationalCategory": { "@type": "CategoryCode", "inCodeSet": { From 983d045ea1c5a5d6ccc39b03f1e3d4ddb7a74421 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 10:42:13 +0100 Subject: [PATCH 03/14] Role locations within metadata --- webapp_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp_utils.py b/webapp_utils.py index b84c128ff..5cbdd4746 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -725,6 +725,7 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, if isinstance(actorJson['hasOccupation'], list): skillsMarkup = ' "hasOccupation": [\n' firstEntry = True + actorDomain = actorJson['id'].split('/users/')[0] for skillDict in actorJson['hasOccupation']: if skillDict['@type'] == 'Role': if not firstEntry: @@ -742,6 +743,12 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "hasOccupation": {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + roleName + '",\n' + skillsMarkup += ' "location": {\n' + skillsMarkup += \ + ' "@type": "VirtualLocation",\n' + skillsMarkup += \ + ' "url": "' + actorDomain + '"\n' + skillsMarkup += ' },\n' skillsMarkup += ' "occupationalCategory": {\n' skillsMarkup += ' "@type": "CategoryCode",\n' skillsMarkup += ' "inCodeSet": {\n' @@ -776,6 +783,11 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' + skillsMarkup += ' "location": {\n' + skillsMarkup += ' "@type": "VirtualLocation",\n' + skillsMarkup += \ + ' "url": "' + actorDomain + '"\n' + skillsMarkup += ' },\n' skillsMarkup += \ ' "skills": ' + skillsListStr + '\n' skillsMarkup += ' }' From e1c26fb19bc45fe28e8df9c8d9c1206978ce465b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 10:45:31 +0100 Subject: [PATCH 04/14] Occupation location --- webapp_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index 5cbdd4746..589db0033 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -743,7 +743,7 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "hasOccupation": {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + roleName + '",\n' - skillsMarkup += ' "location": {\n' + skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ ' "@type": "VirtualLocation",\n' skillsMarkup += \ @@ -783,7 +783,7 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' - skillsMarkup += ' "location": {\n' + skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += ' "@type": "VirtualLocation",\n' skillsMarkup += \ ' "url": "' + actorDomain + '"\n' From d71c2b5d21140ecc9a83fa383203e2d22e5318f1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 10:48:54 +0100 Subject: [PATCH 05/14] Occupation location list --- webapp_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index 589db0033..0aff3933d 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -743,12 +743,12 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "hasOccupation": {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + roleName + '",\n' - skillsMarkup += ' "occupationLocation": {\n' + skillsMarkup += ' "occupationLocation": [{\n' skillsMarkup += \ ' "@type": "VirtualLocation",\n' skillsMarkup += \ ' "url": "' + actorDomain + '"\n' - skillsMarkup += ' },\n' + skillsMarkup += ' }],\n' skillsMarkup += ' "occupationalCategory": {\n' skillsMarkup += ' "@type": "CategoryCode",\n' skillsMarkup += ' "inCodeSet": {\n' @@ -783,11 +783,11 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' - skillsMarkup += ' "occupationLocation": {\n' + skillsMarkup += ' "occupationLocation": [{\n' skillsMarkup += ' "@type": "VirtualLocation",\n' skillsMarkup += \ ' "url": "' + actorDomain + '"\n' - skillsMarkup += ' },\n' + skillsMarkup += ' }],\n' skillsMarkup += \ ' "skills": ' + skillsListStr + '\n' skillsMarkup += ' }' From 8e679aa08a9eca927596f9882c949690e148eb4c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 11:04:26 +0100 Subject: [PATCH 06/14] occupation location --- person.py | 9 ++++++--- roles.py | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/person.py b/person.py index b1662e443..ff80678df 100644 --- a/person.py +++ b/person.py @@ -619,7 +619,7 @@ def personUpgradeActor(baseDir: str, personJson: {}, { '@type': 'Occupation', 'name': occupationName, - 'location': { + 'occupationLocation': { '@type': 'VirtualLocation', 'url': personDomain }, @@ -633,9 +633,12 @@ def personUpgradeActor(baseDir: str, personJson: {}, ocItem = personJson['hasOccupation'][index] if ocItem.get('hasOccupation'): ocItem = ocItem['hasOccupation'] - if not ocItem.get('location'): + if ocItem.get('location'): + del ocItem['location'] + updateActor = True + if not ocItem.get('occupationLocation'): personDomain = personJson['id'].split('/users/')[0] - ocItem['location'] = { + ocItem['occupationLocation'] = { "@type": "VirtualLocation", "url": personDomain } diff --git a/roles.py b/roles.py index 76ea529d0..f149a36df 100644 --- a/roles.py +++ b/roles.py @@ -146,9 +146,9 @@ def _setActorRole(actorJson: {}, roleName: str) -> bool: "hasOccupation": { "@type": "Occupation", "name": roleName, - 'location': { - '@type': 'VirtualLocation', - 'url': actorDomain + "occupationLocation": { + "@type": "VirtualLocation", + "url": actorDomain }, "occupationalCategory": { "@type": "CategoryCode", From e2c74cdaf483ffc4fcac47bbe3acfcaee3f00d87 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 11:08:09 +0100 Subject: [PATCH 07/14] Remove list --- webapp_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index 0aff3933d..589db0033 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -743,12 +743,12 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "hasOccupation": {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + roleName + '",\n' - skillsMarkup += ' "occupationLocation": [{\n' + skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ ' "@type": "VirtualLocation",\n' skillsMarkup += \ ' "url": "' + actorDomain + '"\n' - skillsMarkup += ' }],\n' + skillsMarkup += ' },\n' skillsMarkup += ' "occupationalCategory": {\n' skillsMarkup += ' "@type": "CategoryCode",\n' skillsMarkup += ' "inCodeSet": {\n' @@ -783,11 +783,11 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' - skillsMarkup += ' "occupationLocation": [{\n' + skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += ' "@type": "VirtualLocation",\n' skillsMarkup += \ ' "url": "' + actorDomain + '"\n' - skillsMarkup += ' }],\n' + skillsMarkup += ' },\n' skillsMarkup += \ ' "skills": ' + skillsListStr + '\n' skillsMarkup += ' }' From b60ba0431ecf5e563bd1368491390b2603aa24ba Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 11:27:14 +0100 Subject: [PATCH 08/14] fediverse city --- person.py | 23 ++++++++++------------- roles.py | 5 ++--- skills.py | 7 +++---- tests.py | 12 ++++++------ webapp_utils.py | 9 ++++----- 5 files changed, 25 insertions(+), 31 deletions(-) diff --git a/person.py b/person.py index ff80678df..492f5bd1e 100644 --- a/person.py +++ b/person.py @@ -288,9 +288,9 @@ def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int, { '@type': 'Occupation', 'name': "", - "location": { - "@type": "VirtualLocation", - "url": httpPrefix + '://' + domain + "occupationLocation": { + "@type": "City", + "name": "Fediverse" }, 'skills': [] } @@ -588,14 +588,13 @@ def personUpgradeActor(baseDir: str, personJson: {}, # if the older skills format is being used then switch # to the new one if not personJson.get('hasOccupation'): - personDomain = personJson['id'].split('/users/')[0] personJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': occupationName, - "location": { - "@type": "VirtualLocation", - "url": personDomain + "occupationLocation": { + "@type": "City", + "name": "Fediverse" }, 'skills': [] } @@ -614,14 +613,13 @@ def personUpgradeActor(baseDir: str, personJson: {}, updateActor = True if not isinstance(personJson['hasOccupation'], list): - personDomain = personJson['id'].split('/users/')[0] personJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': occupationName, 'occupationLocation': { - '@type': 'VirtualLocation', - 'url': personDomain + '@type': 'City', + 'name': 'Fediverse' }, 'skills': [] } @@ -637,10 +635,9 @@ def personUpgradeActor(baseDir: str, personJson: {}, del ocItem['location'] updateActor = True if not ocItem.get('occupationLocation'): - personDomain = personJson['id'].split('/users/')[0] ocItem['occupationLocation'] = { - "@type": "VirtualLocation", - "url": personDomain + "@type": "City", + "name": "Fediverse" } updateActor = True diff --git a/roles.py b/roles.py index f149a36df..0c6de6cd0 100644 --- a/roles.py +++ b/roles.py @@ -140,15 +140,14 @@ def _setActorRole(actorJson: {}, roleName: str) -> bool: if occupationItem['hasOccupation']['name'] == roleName: return True statusNumber, published = getStatusNumber() - actorDomain = actorJson['id'].split('/users/')[0] newRole = { "@type": "Role", "hasOccupation": { "@type": "Occupation", "name": roleName, "occupationLocation": { - "@type": "VirtualLocation", - "url": actorDomain + "@type": "City", + "url": "Fediverse" }, "occupationalCategory": { "@type": "CategoryCode", diff --git a/skills.py b/skills.py index f55e4b8fe..1a4fec44c 100644 --- a/skills.py +++ b/skills.py @@ -82,14 +82,13 @@ def setActorSkillLevel(actorJson: {}, if not actorJson: return True if not actorJson.get('hasOccupation'): - actorDomain = actorJson['id'].split('/users/')[0] actorJson['hasOccupation'] = [ { '@type': 'Occupation', 'name': '', - "location": { - "@type": "VirtualLocation", - "url": actorDomain + "occupationLocation": { + "@type": "City", + "name": "Fediverse" }, 'skills': [] } diff --git a/tests.py b/tests.py index 8d95bef52..6155b42eb 100644 --- a/tests.py +++ b/tests.py @@ -3666,9 +3666,9 @@ def testSkills() -> None: { '@type': 'Occupation', 'name': "Sysop", - "location": { - "@type": "VirtualLocation", - "url": "https://jazzy.hedgehog" + "occupationLocation": { + "@type": "City", + "name": "Fediverse" }, 'skills': [] } @@ -3692,9 +3692,9 @@ def testRoles() -> None: { '@type': 'Occupation', 'name': "Sysop", - "location": { - "@type": "VirtualLocation", - "url": "https://mostly.giraffe" + 'occupationLocation': { + '@type': 'City', + 'name': 'Fediverse' }, 'skills': [] } diff --git a/webapp_utils.py b/webapp_utils.py index 589db0033..25fc7351a 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -725,7 +725,6 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, if isinstance(actorJson['hasOccupation'], list): skillsMarkup = ' "hasOccupation": [\n' firstEntry = True - actorDomain = actorJson['id'].split('/users/')[0] for skillDict in actorJson['hasOccupation']: if skillDict['@type'] == 'Role': if not firstEntry: @@ -745,9 +744,9 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "name": "' + roleName + '",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ - ' "@type": "VirtualLocation",\n' + ' "@type": "City",\n' skillsMarkup += \ - ' "url": "' + actorDomain + '"\n' + ' "name": "' + city + '"\n' skillsMarkup += ' },\n' skillsMarkup += ' "occupationalCategory": {\n' skillsMarkup += ' "@type": "CategoryCode",\n' @@ -784,9 +783,9 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' skillsMarkup += ' "occupationLocation": {\n' - skillsMarkup += ' "@type": "VirtualLocation",\n' + skillsMarkup += ' "@type": "City",\n' skillsMarkup += \ - ' "url": "' + actorDomain + '"\n' + ' "name": "' + city + '"\n' skillsMarkup += ' },\n' skillsMarkup += \ ' "skills": ' + skillsListStr + '\n' From 8ff0a3a33ed985c71a48b6c103a252acf01f33f2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 11:29:07 +0100 Subject: [PATCH 09/14] Upgrade to fediverse city --- person.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/person.py b/person.py index 492f5bd1e..84d0af727 100644 --- a/person.py +++ b/person.py @@ -640,6 +640,13 @@ def personUpgradeActor(baseDir: str, personJson: {}, "name": "Fediverse" } updateActor = True + else: + if ocItem['occupationLocation']['@type'] != 'City': + ocItem['occupationLocation'] = { + "@type": "City", + "name": "Fediverse" + } + updateActor = True # if no roles are defined then ensure that the admin # roles are configured From 4537e96d8aba2ba756cba2f342fefcfa3090c1a3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 11:46:31 +0100 Subject: [PATCH 10/14] Use modified city --- webapp_utils.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index 25fc7351a..e2fe92b97 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -720,6 +720,24 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, if not actorJson: return htmlStr + cityMarkup = '' + if city: + city = city.lower().title() + addComma = '' + countryMarkup = '' + if ',' in city: + country = city.split(',', 1)[1].strip().title() + city = city.split(',', 1)[0] + countryMarkup = \ + ' "addressCountry": "' + country + '"\n' + addComma = ',' + cityMarkup = \ + ' "address": {\n' + \ + ' "@type": "PostalAddress",\n' + \ + ' "addressLocality": "' + city + '"' + addComma + '\n' + \ + countryMarkup + \ + ' },\n' + skillsMarkup = '' if actorJson.get('hasOccupation'): if isinstance(actorJson['hasOccupation'], list): @@ -793,23 +811,6 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, firstEntry = False skillsMarkup += '\n ],\n' - cityMarkup = '' - if city: - city = city.lower().title() - addComma = '' - countryMarkup = '' - if ',' in city: - country = city.split(',', 1)[1].strip().title() - city = city.split(',', 1)[0] - countryMarkup = \ - ' "addressCountry": "' + country + '"\n' - addComma = ',' - cityMarkup = \ - ' "address": {\n' + \ - ' "@type": "PostalAddress",\n' + \ - ' "addressLocality": "' + city + '"' + addComma + '\n' + \ - countryMarkup + \ - ' },\n' description = removeHtml(actorJson['summary']) nameStr = removeHtml(actorJson['name']) personMarkup = \ From f7645a8853365374df6185aa6478dbf2f15b343b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 12:33:59 +0100 Subject: [PATCH 11/14] Add role description --- roles.py | 1 + webapp_utils.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/roles.py b/roles.py index 0c6de6cd0..9e2672af2 100644 --- a/roles.py +++ b/roles.py @@ -145,6 +145,7 @@ def _setActorRole(actorJson: {}, roleName: str) -> bool: "hasOccupation": { "@type": "Occupation", "name": roleName, + "description": "Fediverse instance role", "occupationLocation": { "@type": "City", "url": "Fediverse" diff --git a/webapp_utils.py b/webapp_utils.py index e2fe92b97..40dd698ff 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -760,6 +760,8 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "hasOccupation": {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + roleName + '",\n' + skillsMarkup += ' "description": ' + \ + '"Fediverse instance role",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ ' "@type": "City",\n' @@ -800,6 +802,8 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' {\n' skillsMarkup += ' "@type": "Occupation",\n' skillsMarkup += ' "name": "' + ocName + '",\n' + skillsMarkup += ' "description": ' + \ + '"Fediverse instance occupation",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += ' "@type": "City",\n' skillsMarkup += \ From 1a19735e70b71b33d681cac619d2d896e1d20322 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 12:42:42 +0100 Subject: [PATCH 12/14] Main entity for schema validation --- webapp_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp_utils.py b/webapp_utils.py index 40dd698ff..28df49776 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -762,6 +762,8 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "name": "' + roleName + '",\n' skillsMarkup += ' "description": ' + \ '"Fediverse instance role",\n' + skillsMarkup += ' "mainEntityOfPage": "' + \ + actorJson['id'] + '",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ ' "@type": "City",\n' @@ -804,6 +806,8 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "name": "' + ocName + '",\n' skillsMarkup += ' "description": ' + \ '"Fediverse instance occupation",\n' + skillsMarkup += ' "mainEntityOfPage": "' + \ + actorJson['id'] + '",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += ' "@type": "City",\n' skillsMarkup += \ From 18f0a82a4708ea9bd940862f016a03c8bc589527 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 13:08:13 +0100 Subject: [PATCH 13/14] Remove mainEntity --- webapp_utils.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webapp_utils.py b/webapp_utils.py index 28df49776..40dd698ff 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -762,8 +762,6 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "name": "' + roleName + '",\n' skillsMarkup += ' "description": ' + \ '"Fediverse instance role",\n' - skillsMarkup += ' "mainEntityOfPage": "' + \ - actorJson['id'] + '",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += \ ' "@type": "City",\n' @@ -806,8 +804,6 @@ def htmlHeaderWithPersonMarkup(cssFilename: str, instanceTitle: str, skillsMarkup += ' "name": "' + ocName + '",\n' skillsMarkup += ' "description": ' + \ '"Fediverse instance occupation",\n' - skillsMarkup += ' "mainEntityOfPage": "' + \ - actorJson['id'] + '",\n' skillsMarkup += ' "occupationLocation": {\n' skillsMarkup += ' "@type": "City",\n' skillsMarkup += \ From a839e914d2af70af143fc9b5a19b9961de64173c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 17 May 2021 15:25:46 +0100 Subject: [PATCH 14/14] Add a license for blog content --- webapp_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp_utils.py b/webapp_utils.py index 40dd698ff..953f74837 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -888,6 +888,11 @@ def htmlHeaderWithBlogMarkup(cssFilename: str, instanceTitle: str, authorUrl = httpPrefix + '://' + domain + '/users/' + nickname aboutUrl = httpPrefix + '://' + domain + '/about.html' + + # license for content on the site may be different from + # the software license + contentLicenseUrl = 'https://creativecommons.org/licenses/by/3.0' + blogMarkup = \ ' \n'