Skip to content

Commit 434171e

Browse files
authored
Merge pull request #187 from jerboa88/183-add-project-ratings-to-structured-data
183 add project ratings to structured data
2 parents e405d10 + 57a8665 commit 434171e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/templates/page/project.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export const Head = ({
103103
description: project.description,
104104
path: location.pathname,
105105
};
106+
const computedStargazerCount = project.stargazerCount ?? 0;
106107

107108
let githubRepoProjectProps = {};
108109

@@ -143,6 +144,13 @@ export const Head = ({
143144
'@id': JSON_LD_AUTHOR_PATH,
144145
},
145146
url: getAbsoluteUrl(location.pathname).toString(),
147+
aggregateRating: {
148+
'@type': 'AggregateRating',
149+
bestRating: 1,
150+
worstRating: 1,
151+
ratingValue: 1,
152+
ratingCount: computedStargazerCount,
153+
},
146154
offers: {
147155
'@type': 'Offer',
148156
price: 0,

0 commit comments

Comments
 (0)