From 7cccc497685b7fbf46e22f85f7a6158a1dd2a241 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Fri, 13 Sep 2024 14:09:13 +0200 Subject: [PATCH] feat(build): inject repo link, add blank targets and remove links to itself --- build/manifestPlugin.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build/manifestPlugin.ts b/build/manifestPlugin.ts index 6637509..358f360 100644 --- a/build/manifestPlugin.ts +++ b/build/manifestPlugin.ts @@ -86,8 +86,23 @@ export const manifest = (): Plugin => ({ repo: project, }); 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">', + `>Repo •`, + ); + } + + 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({ name: project,