feat(build): inject repo link, add blank targets and remove links to itself

This commit is contained in:
Pihkaal
2024-09-13 14:09:13 +02:00
parent 8a209ede07
commit 7cccc49768

View File

@@ -86,8 +86,23 @@ export const manifest = (): Plugin => ({
repo: project, repo: project,
}); });
const content = await getRepoFileContent(project, "README.md"); const content = await getRepoFileContent(project, "README.md");
let html = converter.makeHtml(content);
const html = converter.makeHtml(content); // that's honestly not really clean but it does exactly what i need
if (!repo.private) {
html = html.replace(
'id="links">',
`><a href=\"https://github.com/pihkaal/${project}\">Repo</a> •`,
);
}
html = html
.replace(new RegExp('href="https', "g"), 'target="_blank" href="https')
.replace(
new RegExp('target="_blank" href="https://pihkaal.me', "g"),
'href="#',
);
projects.push({ projects.push({
name: project, name: project,