Commit 2699bbde3c
Unsigned
Layout: unified ยท split
.github/CONTRIBUTING.md +27 โ20
| @@ -130,6 +130,8 @@ classDiagram | ||
| 130 | 130 | +description: string |
| 131 | 131 | +url: string |
| 132 | 132 | +github: string? |
| 133 | +codeberg: string? | |
| 134 | +git: string? | |
| 133 | 135 | +icon: string? |
| 134 | 136 | +followWith: string? |
| 135 | 137 | +securityAudited: boolean? |
| @@ -155,26 +157,26 @@ At a high-level, the file exports an array of categories, each containing a `nam | ||
| 155 | 157 | categories: |
| 156 | 158 | - name: Essentials |
| 157 | 159 | sections: [] |
| 158 | - name: Communication | |
| 160 | - name: Communication | |
| 159 | 161 | sections: [] |
| 160 | - name: Security Tools | |
| 162 | - name: Security Tools | |
| 161 | 163 | sections: [] |
| 162 | 164 | ``` |
| 163 | 165 | |
| 164 | 166 | Each category contains a `name` an array of `sections` (like sub-categories) |
| 165 | 167 | |
| 166 | 168 | ```yaml |
| 167 | - name: Communication | |
| 168 | sections: | |
| 169 | - name: Encrypted Messaging | |
| 170 | services: [] | |
| 171 | - name: P2P Messaging | |
| 172 | intro: ... | |
| 173 | services: [] | |
| 174 | - name: Encrypted Email | |
| 175 | services: [] | |
| 176 | - name: Email Clients | |
| 177 | services: [] | |
| 169 | - name: Communication | |
| 170 | sections: | |
| 171 | - name: Encrypted Messaging | |
| 172 | services: [] | |
| 173 | - name: P2P Messaging | |
| 174 | intro: ... | |
| 175 | services: [] | |
| 176 | - name: Encrypted Email | |
| 177 | services: [] | |
| 178 | - name: Email Clients | |
| 179 | services: [] | |
| 178 | 180 | ``` |
| 179 | 181 | |
| 180 | 182 | And within each section, we find a list of `services`, each containing a listing. For example: |
| @@ -213,6 +215,9 @@ Each service (aka an app/website/software) has the following fields: | ||
| 213 | 215 | | `url` | The fully qualified domain name of the listing's homepage | `string` | Required | |
| 214 | 216 | | `icon` | A path to an icon file for the listing's logo. Must be square, no less than 64x64 and no larger than 512x512 pixels | `string` | Required | |
| 215 | 217 | | `github` | The GitHub repository hosting the listing's source code. In the format of `[owner]/[repo]` | `string` | Optional | |
| 218 | | `codeberg` | The Codeberg repository hosting the listing's source code. In the format of `[owner]/[repo]` | `string` | Optional | | |
| 219 | | `git` | Full URL to the listing's source repository on any other git host (GitLab, Gitea, self-hosted, etc.) | `string` | Optional | | |
| 220 | | `followWith` | Short text shown in parentheses after the listing's name, e.g. its platform, if not cross-platform | `string` | Optional | | |
| 216 | 221 | | `securityAudited` | Has the listing been audited by an accredited security researcher, with the report publicly published? | `bool` | Optional | |
| 217 | 222 | | `acceptsCrypto` | If payment is required/accepted, do they accept anonymous payments using cryptocurrency, such as Monero? | `bool` | Optional | |
| 218 | 223 | | `openSource` | Is the source code in its entirety published somewhere accessible so it can be built-from-source or self-hosted? | `bool` | Optional | |
| @@ -266,9 +271,11 @@ Below is the full list of checks - it's basically the same as what is listed in | ||
| 266 | 271 | - ๐ก **Duplicate name** - Service name must not already exist |
| 267 | 272 | - ๐ก **Duplicate URL** - Service URL must not already exist |
| 268 | 273 | - ๐ก **Description length** - Should be 50โ250 characters |
| 269 | - ๐ก **Open source + GitHub** - If marked open source, must include `github` field | |
| 274 | - ๐ก **Open source + repo** - If marked open source, must include a `github`, `codeberg` or `git` field | |
| 270 | 275 | - **Project Health** |
| 271 | 276 | - ๐ก **Links reachable** - Service URL and icon must not return 404 |
| 277 | - ๐ก **Repo exists** - The linked GitHub repository must not return a 404 | |
| 278 | - ๐ก **New account** - Flags PRs from very recently created GitHub accounts | |
| 272 | 279 | - ๐ก **Author disclosure** - If PR author owns the repo, they should disclose it |
| 273 | 280 | - ๐ก **Not inactive** - Repo should have a push within the last 90 days |
| 274 | 281 | - ๐ก **Minimum age** - Repo should be โฅ4 months old |
| @@ -278,13 +285,13 @@ Below is the full list of checks - it's basically the same as what is listed in | ||
| 278 | 285 | - ๐ก **Not archived** - Repo must not be archived |
| 279 | 286 | - ๐ก **No security alerts** - No open critical/high Dependabot alerts |
| 280 | 287 | - ๐ก **Minimum stars** - Repo should have โฅ100 stars |
| 281 | - ๐ก **Spam detection** - Flags if user opened โฅ5 PRs to other awesome-* repos in 24h | |
| 288 | - ๐ก **Spam detection** - Flags if the author opened โฅ3 PRs to other awesome-* repos, or PRs across โฅ7 distinct repos, in the last 2 days | |
| 282 | 289 | - **Addition Info** (fyi only, no pass/fail requirements or warnings) |
| 283 | - ๐ต **Website check** (if has `website`) - Quickly checks for basic security requirements for website | |
| 284 | - ๐ต **Source check** (if has `github`) - Brief audit of core GitHub metrics from submitted the repo | |
| 285 | - ๐ต **Android check** (if has `android`) - Lists the trackers, permissions and stats for the Android app | |
| 286 | - ๐ต **iOS check** (if has `ios`) - Shows average rating, and app stats from the Apple App Store | |
| 287 | - ๐ต **Privacy Policy check** (if has `tosdr`) - Outputs the privacy score from ToS;DR and links to policy | |
| 290 | - ๐ต **Website check** (if has `url`) - Quickly checks for basic security requirements for website | |
| 291 | - ๐ต **Source check** (if has `github`) - Brief audit of core GitHub metrics from the submitted repo | |
| 292 | - ๐ต **Android check** (if has `androidApp`) - Lists the trackers, permissions and stats for the Android app | |
| 293 | - ๐ต **iOS check** (if has `iosApp`) - Shows average rating, and app stats from the Apple App Store | |
| 294 | - ๐ต **Privacy Policy check** (if has `tosdrId`) - Outputs the privacy score from ToS;DR and links to policy | |
| 288 | 295 | |
| 289 | 296 | </details> |
| 290 | 297 | |
api/open-api-spec.yml +4
| @@ -152,6 +152,10 @@ components: | ||
| 152 | 152 | properties: |
| 153 | 153 | github: |
| 154 | 154 | type: string |
| 155 | codeberg: | |
| 156 | type: string | |
| 157 | git: | |
| 158 | type: string | |
| 155 | 159 | icon: |
| 156 | 160 | type: string |
| 157 | 161 | followWith: |
api/src/types.ts +2
| @@ -7,6 +7,8 @@ export interface ShortService { | ||
| 7 | 7 | |
| 8 | 8 | export interface Service extends ShortService { |
| 9 | 9 | github?: string; |
| 10 | codeberg?: string; | |
| 11 | git?: string; | |
| 10 | 12 | icon?: string; |
| 11 | 13 | followWith?: string; |
| 12 | 14 | securityAudited?: boolean; |
lib/checks/check-additions.py +10 โ4
| @@ -21,6 +21,7 @@ SCHEMA_ERRORS_PATH = "/tmp/schema-errors.json" | ||
| 21 | 21 | MAX_SCHEMA_ERRORS_SHOWN = 10 |
| 22 | 22 | |
| 23 | 23 | REQUIRED_FIELDS = ("name", "description", "url", "icon") |
| 24 | REPO_FIELDS = ("github", "codeberg", "git") | |
| 24 | 25 | |
| 25 | 26 | CONTRIBUTING = "https://github.com/Lissy93/awesome-privacy/blob/main/.github/CONTRIBUTING.md" |
| 26 | 27 | |
| @@ -57,11 +58,16 @@ DESC_LENGTH_MSG = ( | ||
| 57 | 58 | f" character range. Please see our [Contributing Guidelines]({CONTRIBUTING}#description)" |
| 58 | 59 | ) |
| 59 | 60 | OPENSOURCE_GITHUB_MSG = ( |
| 60 | "You marked this service as open source but didn't include a `github` field." | |
| 61 | " Please add the repository link" | |
| 61 | "You marked this service as open source but didn't include a repository link." | |
| 62 | " Please add a `github`, `codeberg` or `git` field" | |
| 62 | 63 | ) |
| 63 | 64 | |
| 64 | 65 | |
| 66 | def _has_repo(fields): | |
| 67 | """Return True if a service has any source-repository field set.""" | |
| 68 | return any(fields.get(f) for f in REPO_FIELDS) | |
| 69 | ||
| 70 | ||
| 65 | 71 | def load_json(path): |
| 66 | 72 | """Load JSON from a file, returning None on any error.""" |
| 67 | 73 | try: |
| @@ -140,7 +146,7 @@ def check_open_source(diff): | ||
| 140 | 146 | """Return a finding if an added service has openSource missing or not true.""" |
| 141 | 147 | for svc in diff.get("services", {}).get("added", []): |
| 142 | 148 | fields = svc.get("fields", {}) |
| 143 | if fields.get("openSource") is not True and not fields.get("github"): | |
| 149 | if fields.get("openSource") is not True and not _has_repo(fields): | |
| 144 | 150 | return OPENSOURCE_MSG |
| 145 | 151 | return None |
| 146 | 152 | |
| @@ -239,7 +245,7 @@ def check_opensource_github(diff): | ||
| 239 | 245 | """Return a finding if an added service is open source but has no github field.""" |
| 240 | 246 | for svc in diff.get("services", {}).get("added", []): |
| 241 | 247 | fields = svc.get("fields", {}) |
| 242 | if fields.get("openSource") is True and not fields.get("github"): | |
| 248 | if fields.get("openSource") is True and not _has_repo(fields): | |
| 243 | 249 | return OPENSOURCE_GITHUB_MSG |
| 244 | 250 | return None |
| 245 | 251 | |
lib/review-listings.py +9 โ5
| @@ -6,7 +6,7 @@ Checks: | ||
| 6 | 6 | - https-url: homepage URL uses HTTPS |
| 7 | 7 | - icon-reachable: icon URL does not 404 |
| 8 | 8 | - description-len: description is 50 to 280 chars (over 420 escalates to warn) |
| 9 | - opensource-github: openSource listings include a github field | |
| 9 | - opensource-github: openSource listings include a github, codeberg or git field | |
| 10 | 10 | - duplicate-url: no URL appears in more than one listing |
| 11 | 11 | - androidApp-valid: androidApp is a package name, not a URL |
| 12 | 12 | - iosApp-reachable: App Store URL resolves |
| @@ -222,10 +222,14 @@ def _description_len(entry: Entry, ctx: Context) -> Iterable[Finding]: | ||
| 222 | 222 | |
| 223 | 223 | @check("opensource-github") |
| 224 | 224 | def _opensource_github(entry: Entry, ctx: Context) -> Iterable[Finding]: |
| 225 | """openSource: true services must include a github field.""" | |
| 226 | if entry.service.get("openSource") is True and not entry.service.get("github"): | |
| 227 | yield _finding(entry, "opensource-github", "warn", | |
| 228 | "marked openSource but missing `github` field") | |
| 225 | """openSource: true services must include a github, codeberg or git field.""" | |
| 226 | svc = entry.service | |
| 227 | if svc.get("openSource") is True and not ( | |
| 228 | svc.get("github") or svc.get("codeberg") or svc.get("git") | |
| 229 | ): | |
| 230 | yield _finding(entry, "opensource-github", "error", | |
| 231 | "marked openSource but missing a repository link " | |
| 232 | "(`github`, `codeberg` or `git`)") | |
| 229 | 233 | |
| 230 | 234 | |
| 231 | 235 | @check("androidApp-valid") |
lib/schema.json +8
| @@ -32,6 +32,14 @@ | ||
| 32 | 32 | "type": ["string", "null"], |
| 33 | 33 | "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://github\\.com/.+)$" |
| 34 | 34 | }, |
| 35 | "codeberg": { | |
| 36 | "type": ["string", "null"], | |
| 37 | "pattern": "^([a-zA-Z0-9._-]+/[a-zA-Z0-9._-]+|https://codeberg\\.org/.+)$" | |
| 38 | }, | |
| 39 | "git": { | |
| 40 | "type": ["string", "null"], | |
| 41 | "pattern": "^https?://.+" | |
| 42 | }, | |
| 35 | 43 | "icon": { |
| 36 | 44 | "type": ["string", "null"], |
| 37 | 45 | "pattern": "^https?://.+" |
lib/validate-awesome-privacy.py +3 โ1
| @@ -57,7 +57,9 @@ def resolve_path(data, path_parts): | ||
| 57 | 57 | FIELD_HINTS = { |
| 58 | 58 | "url": "must start with http:// or https://", |
| 59 | 59 | "icon": "must start with http:// or https://", |
| 60 | "github": "must be `user/repo` or a full https://github.com/... URL", | |
| 60 | "github": "must be `user/repo`", | |
| 61 | "codeberg": "must be `user/repo`", | |
| 62 | "git": "must be a full http(s):// URL to the source repository", | |
| 61 | 63 | "iosApp": "must be a full https://apps.apple.com/... URL", |
| 62 | 64 | "androidApp": "must be a package name like `com.example.app`", |
| 63 | 65 | "discordInvite": "must be a discord invite code or https://discord.gg/... URL", |
web/src/components/things/ChangelogTimeline.svelte +4 โ4
| @@ -611,16 +611,16 @@ | ||
| 611 | 611 | color: var(--changelog-add); |
| 612 | 612 | } |
| 613 | 613 | &.rem { |
| 614 | background: color-mix(in srgb, var(--changelog-rem) 33%, transparent); | |
| 615 | color: var(--changelog-rem); | |
| 614 | background: color-mix(in srgb, var(--changelog-rej) 33%, transparent); | |
| 615 | color: var(--changelog-rej); | |
| 616 | 616 | } |
| 617 | 617 | &.mod { |
| 618 | 618 | background: color-mix(in srgb, var(--changelog-mod) 33%, transparent); |
| 619 | 619 | color: var(--changelog-mod); |
| 620 | 620 | } |
| 621 | 621 | &.rej { |
| 622 | background: color-mix(in srgb, var(--changelog-rej) 33%, transparent); | |
| 623 | color: var(--changelog-rej); | |
| 622 | background: color-mix(in srgb, var(--changelog-rem) 33%, transparent); | |
| 623 | color: var(--changelog-rem); | |
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | |
web/src/components/things/ListingHero.astro +14 โ2
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | import type { Section, Service } from '../../types/Service'; |
| 3 | 3 | import { slugify } from '@utils/fetch-data'; |
| 4 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; | |
| 4 | import { parseMarkdown, formatLink, codebergUrl } from '@utils/parse-markdown'; | |
| 5 | 5 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 6 | 6 | import SaveListing from '@components/things/SaveListing.svelte'; |
| 7 | 7 | import ServiceIcon from '@components/things/ServiceIcon.astro'; |
| @@ -19,6 +19,8 @@ const { | ||
| 19 | 19 | description, |
| 20 | 20 | url, |
| 21 | 21 | github, |
| 22 | codeberg, | |
| 23 | git, | |
| 22 | 24 | tosdrId, |
| 23 | 25 | iosApp, |
| 24 | 26 | androidApp, |
| @@ -46,6 +48,16 @@ const infoLinks = [ | ||
| 46 | 48 | href: `https://github.com/${github}`, |
| 47 | 49 | text: `github.com/${github}`, |
| 48 | 50 | }, |
| 51 | codeberg && { | |
| 52 | label: 'Codeberg', | |
| 53 | href: codebergUrl(codeberg), | |
| 54 | text: formatLink(codebergUrl(codeberg)), | |
| 55 | }, | |
| 56 | git && { | |
| 57 | label: 'Source', | |
| 58 | href: git, | |
| 59 | text: formatLink(git), | |
| 60 | }, | |
| 49 | 61 | tosdrId && { |
| 50 | 62 | label: 'Privacy', |
| 51 | 63 | href: privacyPolicyLink, |
| @@ -104,7 +116,7 @@ const highlights = [ | ||
| 104 | 116 | cls: 'warning', |
| 105 | 117 | title: `${name} is not open source`, |
| 106 | 118 | }, |
| 107 | (openSource || (github && openSource !== false)) && { | |
| 119 | (openSource || ((github || codeberg || git) && openSource !== false)) && { | |
| 108 | 120 | icon: 'openSource', |
| 109 | 121 | text: 'Open Source', |
| 110 | 122 | cls: 'great', |
web/src/components/things/ServiceCard.astro +15 โ1
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | --- |
| 2 | import { formatLink } from '@utils/parse-markdown'; | |
| 2 | import { formatLink, codebergUrl } from '@utils/parse-markdown'; | |
| 3 | 3 | import type { Service } from 'src/types/Service'; |
| 4 | 4 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 5 | 5 | import SaveListing from '@components/things/SaveListing.svelte'; |
| @@ -54,6 +54,20 @@ const { service, sectionName, categoryName } = Astro.props; | ||
| 54 | 54 | </a> |
| 55 | 55 | ) |
| 56 | 56 | } |
| 57 | { | |
| 58 | service.codeberg && ( | |
| 59 | <a class="link" href={codebergUrl(service.codeberg)}> | |
| 60 | <FontAwesome iconName="sourceCode" /> Codeberg | |
| 61 | </a> | |
| 62 | ) | |
| 63 | } | |
| 64 | { | |
| 65 | service.git && ( | |
| 66 | <a class="link" href={service.git}> | |
| 67 | <FontAwesome iconName="sourceCode" /> Source | |
| 68 | </a> | |
| 69 | ) | |
| 70 | } | |
| 57 | 71 | <a |
| 58 | 72 | href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`} |
| 59 | 73 | > |
web/src/components/things/ServiceCard.svelte +21 โ1
| @@ -2,7 +2,7 @@ | ||
| 2 | 2 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 3 | 3 | import SaveListing from '@components/things/SaveListing.svelte'; |
| 4 | 4 | import { slugify } from '@utils/fetch-data'; |
| 5 | import { formatLink } from '@utils/parse-markdown'; | |
| 5 | import { formatLink, codebergUrl } from '@utils/parse-markdown'; | |
| 6 | 6 | import type { Service } from 'src/types/Service'; |
| 7 | 7 | |
| 8 | 8 | interface Props { |
| @@ -70,6 +70,26 @@ | ||
| 70 | 70 | <FontAwesome iconName="sourceCode" /> GitHub |
| 71 | 71 | </a> |
| 72 | 72 | {/if} |
| 73 | {#if service.codeberg} | |
| 74 | <a | |
| 75 | class="link" | |
| 76 | href={codebergUrl(service.codeberg)} | |
| 77 | target="_blank" | |
| 78 | rel="noopener noreferrer" | |
| 79 | > | |
| 80 | <FontAwesome iconName="sourceCode" /> Codeberg | |
| 81 | </a> | |
| 82 | {/if} | |
| 83 | {#if service.git} | |
| 84 | <a | |
| 85 | class="link" | |
| 86 | href={service.git} | |
| 87 | target="_blank" | |
| 88 | rel="noopener noreferrer" | |
| 89 | > | |
| 90 | <FontAwesome iconName="sourceCode" /> Source | |
| 91 | </a> | |
| 92 | {/if} | |
| 73 | 93 | <a href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}> |
| 74 | 94 | <FontAwesome iconName="viewReport" /> View Report โ |
| 75 | 95 | </a> |
web/src/components/things/ServiceList.astro +24 โ2
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | import Button from '@components/form/Button.astro'; |
| 3 | import { parseMarkdown, formatLink } from '@utils/parse-markdown'; | |
| 3 | import { parseMarkdown, formatLink, codebergUrl } from '@utils/parse-markdown'; | |
| 4 | 4 | import type { Service } from 'src/types/Service'; |
| 5 | 5 | import FontAwesome from '@components/form/FontAwesome.svelte'; |
| 6 | 6 | import DeleteListing from '@components/things/DeleteListing.svelte'; |
| @@ -111,7 +111,8 @@ const sortedServices = [...(services || [])].sort((a, b) => | ||
| 111 | 111 | </span> |
| 112 | 112 | )} |
| 113 | 113 | {service.openSource || |
| 114 | (service.github && service.openSource !== false) ? ( | |
| 114 | ((service.github || service.codeberg || service.git) && | |
| 115 | service.openSource !== false) ? ( | |
| 115 | 116 | <span |
| 116 | 117 | class="meta-item great" |
| 117 | 118 | title={`${service.name} is open source`} |
| @@ -135,6 +136,27 @@ const sortedServices = [...(services || [])].sort((a, b) => | ||
| 135 | 136 | </a> |
| 136 | 137 | </span> |
| 137 | 138 | )} |
| 139 | {service.codeberg && ( | |
| 140 | <span | |
| 141 | class="meta-item" | |
| 142 | title={`View ${service.name} on Codeberg`} | |
| 143 | > | |
| 144 | <a href={codebergUrl(service.codeberg)} target="_blank"> | |
| 145 | <FontAwesome iconName="sourceCode" />{' '} | |
| 146 | {formatLink(codebergUrl(service.codeberg))} | |
| 147 | </a> | |
| 148 | </span> | |
| 149 | )} | |
| 150 | {service.git && ( | |
| 151 | <span | |
| 152 | class="meta-item" | |
| 153 | title={`View ${service.name} source code`} | |
| 154 | > | |
| 155 | <a href={service.git} target="_blank"> | |
| 156 | <FontAwesome iconName="sourceCode" /> Source | |
| 157 | </a> | |
| 158 | </span> | |
| 159 | )} | |
| 138 | 160 | </div> |
| 139 | 161 | <div class="view-service"> |
| 140 | 162 | <a |
web/src/pages/[...listing].astro +9 โ1
| @@ -15,6 +15,7 @@ import SocialShare from '@components/form/Social.astro'; | ||
| 15 | 15 | import DataActions from '@components/things/DataActions.svelte'; |
| 16 | 16 | import type { AwesomePrivacy, Section, Service } from '../types/Service'; |
| 17 | 17 | import { fetchData, slugify } from '@utils/fetch-data'; |
| 18 | import { codebergUrl } from '@utils/parse-markdown'; | |
| 18 | 19 | import { fetchChangelog } from '@utils/fetch-changelog'; |
| 19 | 20 | import { fetchGitHubStats } from '@utils/fetch-repo-info'; |
| 20 | 21 | import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy'; |
| @@ -39,6 +40,8 @@ const { | ||
| 39 | 40 | description, |
| 40 | 41 | url, |
| 41 | 42 | github, |
| 43 | codeberg, | |
| 44 | git, | |
| 42 | 45 | tosdrId, |
| 43 | 46 | discordInvite, |
| 44 | 47 | subreddit, |
| @@ -235,6 +238,11 @@ const makeSoftwareSchema = () => { | ||
| 235 | 238 | .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1') |
| 236 | 239 | .replace(/[*_`~]/g, '') |
| 237 | 240 | .trim(); |
| 241 | const codeRepository = github | |
| 242 | ? `https://github.com/${github}` | |
| 243 | : codeberg | |
| 244 | ? codebergUrl(codeberg) | |
| 245 | : git || null; | |
| 238 | 246 | return { |
| 239 | 247 | '@context': 'https://schema.org', |
| 240 | 248 | '@type': 'SoftwareApplication', |
| @@ -245,7 +253,7 @@ const makeSoftwareSchema = () => { | ||
| 245 | 253 | ...(operatingSystem.length && { |
| 246 | 254 | operatingSystem: operatingSystem.join(', '), |
| 247 | 255 | }), |
| 248 | ...(github && { codeRepository: `https://github.com/${github}` }), | |
| 256 | ...(codeRepository && { codeRepository }), | |
| 249 | 257 | }; |
| 250 | 258 | }; |
| 251 | 259 | --- |
web/src/types/Service.ts +2
| @@ -9,6 +9,8 @@ export interface Service { | ||
| 9 | 9 | description: string; |
| 10 | 10 | url: string; |
| 11 | 11 | github?: string; |
| 12 | codeberg?: string; | |
| 13 | git?: string; | |
| 12 | 14 | icon?: string; |
| 13 | 15 | links?: Array<{ |
| 14 | 16 | title: string; |
web/src/utils/do-searchy-searchy.ts +6
| @@ -9,6 +9,8 @@ export interface SearchItem { | ||
| 9 | 9 | name?: string; |
| 10 | 10 | url?: string; |
| 11 | 11 | github?: string; |
| 12 | codeberg?: string; | |
| 13 | git?: string; | |
| 12 | 14 | logo?: string; |
| 13 | 15 | } |
| 14 | 16 | |
| @@ -42,6 +44,8 @@ export const prepareSearchItems = (categories: Category[]): SearchItem[] => { | ||
| 42 | 44 | description: service.description, |
| 43 | 45 | url: service.url, |
| 44 | 46 | github: service.github || '', |
| 47 | codeberg: service.codeberg || '', | |
| 48 | git: service.git || '', | |
| 45 | 49 | category: category.name, |
| 46 | 50 | sectionName: section.name, |
| 47 | 51 | logo: service.icon || '', |
| @@ -61,6 +65,8 @@ export const searchOptions = { | ||
| 61 | 65 | { name: 'notableMentions', weight: 0.5 }, |
| 62 | 66 | { name: 'alternativeTo', weight: 0.5 }, |
| 63 | 67 | { name: 'github', weight: 0.4 }, |
| 68 | { name: 'codeberg', weight: 0.4 }, | |
| 69 | { name: 'git', weight: 0.3 }, | |
| 64 | 70 | { name: 'url', weight: 0.2 }, |
| 65 | 71 | { name: 'description', weight: 0.1 }, |
| 66 | 72 | { name: 'intro', weight: 0.1 }, |
web/src/utils/parse-markdown.ts +4
| @@ -44,3 +44,7 @@ export const formatLink = (link: string) => { | ||
| 44 | 44 | .replace(/^(https?:\/\/)?(www\.)?/, '') |
| 45 | 45 | .replace(/\/+$/, ''); |
| 46 | 46 | }; |
| 47 | ||
| 48 | // Resolve a `codeberg` field (either `owner/repo` shorthand or a full URL) to a full URL. | |
| 49 | export const codebergUrl = (codeberg: string) => | |
| 50 | /^https?:\/\//.test(codeberg) ? codeberg : `https://codeberg.org/${codeberg}`; | |