|
3 | 3 | * SPDX-License-Identifier: Apache-2.0 |
4 | 4 | */ |
5 | 5 |
|
6 | | -// Put custom repo GitHub URLs in this object, keyed by nameWithOwner repo name. |
7 | | -var customGithubURL = { |
8 | | - "twitter/pants": "https://github.com/pantsbuild/pants", |
9 | | -} |
10 | | - |
11 | | -var getGithubURL = function(project) { |
12 | | - return customGithubURL[project.nameWithOwner] || 'https://github.com/' + project.nameWithOwner |
13 | | -} |
14 | | - |
15 | | - |
16 | | -// Put custom repo Website URLs in this object, keyed by nameWithOwner repo name |
17 | | -var customWebsiteURL = { |
18 | | - "twitter/pants": "https://www.pantsbuild.org/", |
19 | | -} |
20 | | - |
21 | | -var getHomepageURL = function(project) { |
22 | | - return customWebsiteURL[project.nameWithOwner] || project.homepageURL |
23 | | -} |
24 | | - |
25 | 6 | /* Create project cards */ |
26 | 7 | var renderProjects = function(projectsList, searchString="") { |
27 | 8 | // Parent div to hold all the project cards |
@@ -71,14 +52,14 @@ var renderProjects = function(projectsList, searchString="") { |
71 | 52 |
|
72 | 53 | // GitHub link |
73 | 54 | var githubLink = document.createElement('a') |
74 | | - githubLink.href = getGithubURL(project) |
| 55 | + githubLink.href = `https://github.com/${project.nameWithOwner}` |
75 | 56 | githubLink.innerHTML = "GitHub" |
76 | 57 | githubLink.target = "_blank" |
77 | 58 | githubLink.rel = "noopener" |
78 | 59 | projectLinksDiv.appendChild(githubLink) |
79 | 60 |
|
80 | 61 | // Website link (with clause) |
81 | | - var homepageURL = getHomepageURL(project) |
| 62 | + var homepageURL = project.homepageURL |
82 | 63 | if (homepageURL != "") { |
83 | 64 | var websiteLink = document.createElement('a') |
84 | 65 | websiteLink.href = homepageURL |
|
0 commit comments