Add alternate source repository links
This commit is contained in:
18
app.js
18
app.js
@@ -30,11 +30,14 @@ function matchesSearch(project) {
|
||||
const haystack = [
|
||||
project.name,
|
||||
project.description,
|
||||
project.url,
|
||||
project.gitUrl,
|
||||
project.sourceforgeUrl,
|
||||
project.siteUrl,
|
||||
project.language,
|
||||
project.license,
|
||||
project.tags.join(" ")
|
||||
].join(" ").toLowerCase();
|
||||
].filter(Boolean).join(" ").toLowerCase();
|
||||
|
||||
return haystack.includes(query);
|
||||
}
|
||||
@@ -55,11 +58,22 @@ function actions(project) {
|
||||
const liveLink = project.siteUrl
|
||||
? `<a class="project-link live" href="${project.siteUrl}">Launch</a>`
|
||||
: "";
|
||||
const selfHostedLink = project.gitUrl
|
||||
? `<a class="project-link" href="${project.gitUrl}">git.seanstarkey.dev</a>`
|
||||
: "";
|
||||
const sourceforgeLink = project.sourceforgeUrl
|
||||
? `<a class="project-link" href="${project.sourceforgeUrl}">SourceForge</a>`
|
||||
: "";
|
||||
const githubLink = project.url
|
||||
? `<a class="project-link" href="${project.url}">GitHub</a>`
|
||||
: "";
|
||||
|
||||
return `
|
||||
<span class="project-actions">
|
||||
${liveLink}
|
||||
<a class="project-link" href="${project.url}">GitHub</a>
|
||||
${selfHostedLink}
|
||||
${sourceforgeLink}
|
||||
${githubLink}
|
||||
</span>
|
||||
`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user