Add repo key to degoogle.yml for open-source projects
This commit is contained in:
parent
d73b1f34db
commit
b71ac865df
18
_build.js
18
_build.js
|
@ -118,7 +118,10 @@ function generateServiceSection(data) {
|
|||
let text = item.text.trim();
|
||||
|
||||
// Append the F-Droid badge to the name
|
||||
if (item.fdroid) name = name.concat(' ' + fdroidLink(item.fdroid));
|
||||
if (item.fdroid) name = name.concat('<br/>', fdroidLink(item.fdroid));
|
||||
|
||||
// Append the Repo badge to the name
|
||||
if (item.repo) name = name.concat('<br/>', repoLink(item.repo));
|
||||
|
||||
// Build the row
|
||||
let tableItem = `| ${name} | ${eyes} | ${text} |`;
|
||||
|
@ -136,7 +139,18 @@ function generateServiceSection(data) {
|
|||
* @param {String} appId The package identifier on F-Droid
|
||||
*/
|
||||
function fdroidLink(appId) {
|
||||
return `[![F-Droid](https://img.shields.io/f-droid/v/${appId}?style=flat-square)](https://f-droid.org/en/packages/${appId}/)`;
|
||||
return `[![F-Droid](https://img.shields.io/f-droid/v/${appId}?style=flat-square&logo=f-droid)](https://f-droid.org/en/packages/${appId}/)`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a badge acting as a link to a source repository for an app.
|
||||
* @param {String} repo The repository url
|
||||
*/
|
||||
function repoLink(repo) {
|
||||
let repoURL = new URL(repo);
|
||||
let repoHost = path.basename(repoURL.hostname, path.extname(repoURL.hostname))
|
||||
if (repoHost.includes(".")) repoHost = path.extname(repoHost).replace(".", "")
|
||||
return `[![Repo](https://img.shields.io/badge/open-source-blue?style=flat-square&logo=${repoHost})](${repo})`
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue