Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions osf/metadata/serializers/google_dataset_json_ld.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ def metadata_as_dict(self) -> dict:

def format_creators(basket):
creator_data = []
for creator_iri in basket[DCTERMS.creator]:
for creator in basket.focus.dbmodel.contributors.all():
creator_data.append({
'@type': 'Person',
'name': next(basket[creator_iri:FOAF.name]),
'name': creator.fullname,
'givenName': creator.given_name,
'familyName': creator.family_name
})
return creator_data

Expand Down
1 change: 1 addition & 0 deletions website/profile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def serialize_user(user, node=None, admin=False, full=False, is_profile=False, i
'id': str(user._id),
'registered': user.is_registered,
'surname': user.family_name,
'given_name': user.given_name,
'fullname': fullname,
'shortname': fullname if len(fullname) < 50 else fullname[:23] + '...' + fullname[-23:],
'profile_image_url': user.profile_image_url(size=settings.PROFILE_IMAGE_MEDIUM),
Expand Down
8 changes: 6 additions & 2 deletions website/templates/base.mako
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="OSF" />

%for author in self.authors_meta()[:10]:
<meta name="dc.creator" content="${author}" />
%for author, creator in list(zip(self.authors_meta()[:10], self.creator_meta()[:10])):
<meta name="dc.creator" content="${creator}" />
<meta name="citation_author" content="${author}" />
%endfor
%for tag in self.keywords_meta()[:10]:
Expand Down Expand Up @@ -329,6 +329,10 @@
### The list of project contributors ###
</%def>

<%def name="creator_meta()">
### The list of project creators ###
</%def>

<%def name="datemodified_meta()">
### The project last modified date.
</%def>
Expand Down
8 changes: 8 additions & 0 deletions website/templates/project/project_base.mako
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@
</%def>

<%def name="authors_meta()">
%if node['contributors'] and not node['anonymous']:
<%
return [f'{contrib['surname']}, {contrib['given_name']}'for contrib in node['contributors'] if isinstance(contrib, dict)]
%>
%endif
</%def>

<%def name="creator_meta()">
%if node['contributors'] and not node['anonymous']:
<%
return [contrib['fullname'] for contrib in node['contributors'] if isinstance(contrib, dict)]
Expand Down
Loading