Skip to content

Commit

Permalink
projects: remove custom github and homepage url
Browse files Browse the repository at this point in the history
since repos can be individually included or excluded from the dataset,
there is no longer a need for overriding these URLs (for which pants was
the main use case)
  • Loading branch information
willnorris committed Oct 23, 2021
1 parent 68abcd7 commit 57efa25
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions static/js/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

// Put custom repo GitHub URLs in this object, keyed by nameWithOwner repo name.
var customGithubURL = {
"twitter/pants": "https://github.com/pantsbuild/pants",
}

var getGithubURL = function(project) {
return customGithubURL[project.nameWithOwner] || 'https://github.com/' + project.nameWithOwner
}


// Put custom repo Website URLs in this object, keyed by nameWithOwner repo name
var customWebsiteURL = {
"twitter/pants": "https://www.pantsbuild.org/",
}

var getHomepageURL = function(project) {
return customWebsiteURL[project.nameWithOwner] || project.homepageURL
}

/* Create project cards */
var renderProjects = function(projectsList, searchString="") {
// Parent div to hold all the project cards
Expand Down Expand Up @@ -71,14 +52,14 @@ var renderProjects = function(projectsList, searchString="") {

// GitHub link
var githubLink = document.createElement('a')
githubLink.href = getGithubURL(project)
githubLink.href = `https://github.com/${project.nameWithOwner}`
githubLink.innerHTML = "GitHub"
githubLink.target = "_blank"
githubLink.rel = "noopener"
projectLinksDiv.appendChild(githubLink)

// Website link (with clause)
var homepageURL = getHomepageURL(project)
var homepageURL = project.homepageURL
if (homepageURL != "") {
var websiteLink = document.createElement('a')
websiteLink.href = homepageURL
Expand Down

0 comments on commit 57efa25

Please sign in to comment.