1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 13:07:58 +00:00

Fix "edit this page on GH" link on documentation website

This commit is contained in:
Romein van Buren 2023-06-29 13:58:39 +02:00
parent 3dbf8fc98b
commit eba7e84fc8
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
2 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
const path = require('path');
module.exports = { module.exports = {
eleventyNavigation: { eleventyNavigation: {
key: data => data.title, key: data => data.title,
@ -12,6 +14,6 @@ module.exports = {
github: { github: {
reportDocsIssue: data => `${data.meta.repoUrl}/issues/new?assignees=garraflavatra&labels=documentation&projects=&template=docs.yml&source=${encodeURIComponent(data.meta.siteUrl + data.page.url)}`, reportDocsIssue: data => `${data.meta.repoUrl}/issues/new?assignees=garraflavatra&labels=documentation&projects=&template=docs.yml&source=${encodeURIComponent(data.meta.siteUrl + data.page.url)}`,
licenseUrl: data => `${data.meta.repoUrl}/blob/main/LICENSE`, licenseUrl: data => `${data.meta.repoUrl}/blob/main/LICENSE`,
pageSourceUrl: data => `${data.meta.repoUrl}/blob/main/${data.page.inputPath}`, pageSourceUrl: data => `${data.meta.repoUrl}/blob/main/${path.relative(process.cwd(), data.page.inputPath)}`,
}, },
}; };

View File

@ -7,7 +7,7 @@ module.exports = async function() {
return { stars: json.stargazers_count || 0 }; return { stars: json.stargazers_count || 0 };
} }
catch (error) { catch (error) {
console.error('ERROR | Could not fetch GitHub stars:', error); console.error('Error: could not fetch GitHub stars:', error);
return { stars: 0 }; return { stars: 0 };
} }
} }