Commit e1bf34dab0

e1bf34dab0a9650d1095381255afa8bf87e32d89

parent: 7391917b9e

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-08-08 21:46 UTC

Adds trailing slash for every page, as it was inconsistant before

Layout: unified · split

web/src/components/scafold/Footer.astro +1 −1
@@ -3,7 +3,7 @@ const year = new Date().getFullYear();
33---
44
55<footer>
6 <a href="/about">Awesome Privacy</a> is licensed under <a
6 <a href="/about/">Awesome Privacy</a> is licensed under <a
77 href="https://github.com/Lissy93/awesome-privacy/blob/main/LICENSE"
88 target="_blank"
99 rel="noopener noreferrer">CC0 1.0 Universal</a
web/src/components/scafold/NavBar.astro +6 −7
@@ -3,12 +3,12 @@ import FontAwesome from '@components/form/FontAwesome.svelte';
33import ThemeSwitcher from '@components/form/ThemeSwitcher.svelte';
44
55const navLinks = [
6 { label: 'View All', href: '/all' },
7 { label: 'Search', href: '/search' },
8 { label: 'Changelog', href: '/changelog' },
9 // { label: 'API', href: '/api' }, // TODO: restore once API is built out
10 { label: 'Saved', href: '/inventory', id: 'saved-nav-link', hidden: true },
11 { label: 'About', href: '/about' },
6 { label: 'View All', href: '/all/' },
7 { label: 'Search', href: '/search/' },
8 { label: 'Changelog', href: '/changelog/' },
9 // { label: 'API', href: '/api/' }, // TODO: restore once API is built out
10 { label: 'Saved', href: '/inventory/', id: 'saved-nav-link', hidden: true },
11 { label: 'About', href: '/about/' },
1212 {
1313 label: 'GitHub',
1414 href: 'https://github.com/lissy93/awesome-privacy',
@@ -253,5 +253,4 @@ const navLinks = [
253253 }
254254 }
255255 }
256
257256</style>
web/src/components/things/AddNewService.svelte +2 −2
@@ -117,7 +117,7 @@
117117
118118<p>
119119 Before completing this form, you must ensure that the service you are adding
120 aligns with the <a href="/about#creteria">Requirements</a> for Awesome
120 aligns with the <a href="/about/#creteria">Requirements</a> for Awesome
121121 Privacy.
122122 <br />
123123 You'll need a GitHub account in order to submit this form.
@@ -174,7 +174,7 @@
174174 </select>
175175 <p>
176176 Choose the top-level category, which should align with the <a
177 href="/browse">one of these</a
177 href="/browse/">one of these</a
178178 >.
179179 </p>
180180 </div>
web/src/components/things/ChangelogTimeline.svelte +3 −3
@@ -160,7 +160,7 @@
160160 function serviceLink(s: ServiceChange, isRemoval: boolean): string {
161161 const c = slugify(s.category),
162162 sc = slugify(s.section);
163 return isRemoval ? `/${c}/${sc}` : `/${c}/${sc}/${slugify(s.name)}`;
163 return isRemoval ? `/${c}/${sc}/` : `/${c}/${sc}/${slugify(s.name)}/`;
164164 }
165165
166166 type ChangeRow = {
@@ -229,7 +229,7 @@
229229 badge: 'New Section',
230230 cls: 'add',
231231 name: v.name,
232 href: `/${slugify(v.category)}/${slugify(v.name)}`,
232 href: `/${slugify(v.category)}/${slugify(v.name)}/`,
233233 })),
234234 ...sc.removed.map((v) => ({
235235 badge: 'Section Removed',
@@ -241,7 +241,7 @@
241241 badge: 'Section Renamed',
242242 cls: 'mod',
243243 name: `${v.from.section} → ${v.to.section}`,
244 href: `/${slugify(v.to.category)}/${slugify(v.to.section)}`,
244 href: `/${slugify(v.to.category)}/${slugify(v.to.section)}/`,
245245 path:
246246 v.from.category === v.to.category
247247 ? `in ${v.to.category}`
web/src/components/things/DataActions.svelte +2 −2
@@ -118,7 +118,7 @@
118118 />
119119 Note that some of the information shown above has been aggregated from external
120120 sources, a list of these can be found
121 <a href="/about#our-data">data documentation</a>.
121 <a href="/about/#our-data">data documentation</a>.
122122 </p>
123123
124124 <h4>Origin Data</h4>
@@ -157,7 +157,7 @@
157157 >
158158 <FontAwesome iconName="edit" /> Submit Edit to {serviceName}
159159 </a>
160 <a class="button-link" href="/submit">
160 <a class="button-link" href="/submit/">
161161 <FontAwesome iconName="add" /> Add alternative
162162 </a>
163163 </div>
web/src/components/things/LatestUpdates.astro +3 −3
@@ -59,7 +59,7 @@ const formatDate = (iso: string) =>
5959 <li>
6060 <a
6161 class="service-link"
62 href={`/${slugify(a.category)}/${slugify(a.section)}/${slugify(a.name)}`}
62 href={`/${slugify(a.category)}/${slugify(a.section)}/${slugify(a.name)}/`}
6363 >
6464 {a.service && (
6565 <ServiceIcon
@@ -76,7 +76,7 @@ const formatDate = (iso: string) =>
7676 title={`In ${a.category}${a.author ? ` submitted by @${a.author}` : ''} on ${formatDate(a.date)}`}
7777 >
7878 In{' '}
79 <a class="inline" href={`/${slugify(a.category)}`}>
79 <a class="inline" href={`/${slugify(a.category)}/`}>
8080 {a.category}
8181 </a>
8282 {a.author && (
@@ -99,7 +99,7 @@ const formatDate = (iso: string) =>
9999 ))}
100100 </ul>
101101 <div class="footer">
102 <a class="small-button" href="/changelog">
102 <a class="small-button" href="/changelog/">
103103 View full changelog &rarr;
104104 </a>
105105 </div>
web/src/components/things/ListingHero.astro +4 −4
@@ -141,9 +141,9 @@ const highlights = [
141141 <div class="breadcrumbs">
142142 <span>
143143 <a href="/">Awesome Privacy</a>
144 ➔ <a href={`/${catSlug}`}>{categoryName}</a>
145 ➔ <a href={`/${catSlug}/${secSlug}`}>{parentSection.name}</a>
146 ➔ <a href={`/${catSlug}/${secSlug}/${slugify(name)}`}>{name}</a>
144 ➔ <a href={`/${catSlug}/`}>{categoryName}</a>
145 ➔ <a href={`/${catSlug}/${secSlug}/`}>{parentSection.name}</a>
146 ➔ <a href={`/${catSlug}/${secSlug}/${slugify(name)}/`}>{name}</a>
147147 </span>
148148 </div>
149149 <div class="save-listing">
@@ -197,7 +197,7 @@ const highlights = [
197197 <ul>
198198 {otherServices.map((s: Service) => (
199199 <li>
200 <a href={`/${catSlug}/${secSlug}/${slugify(s.name)}`}>
200 <a href={`/${catSlug}/${secSlug}/${slugify(s.name)}/`}>
201201 {s.name}
202202 </a>
203203 </li>
web/src/components/things/SaveListing.svelte +1 −1
@@ -59,7 +59,7 @@
5959
6060 {#if showLabel && isSaved}
6161 <div class="done-msg">
62 You can view all saved items in your <a href="/inventory">Inventory</a>
62 You can view all saved items in your <a href="/inventory/">Inventory</a>
6363 </div>
6464 {/if}
6565</div>
web/src/components/things/SavedServices.svelte +8 −6
@@ -1,15 +1,14 @@
11<script lang="ts">
22 import { onMount } from 'svelte';
33
4 import type { Category, Service } from '../../types/Service';
5 import { slugify } from '@utils/fetch-data';
4 import type { Service } from '../../types/Service';
5 import { fetchCategories, slugify } from '@utils/fetch-data';
66 import ServiceCard from './ServiceCard.svelte';
77
88 interface Props {
9 allData: Category[];
109 serviceList?: string[] | null;
1110 }
12 const { allData, serviceList = null }: Props = $props();
11 const { serviceList = null }: Props = $props();
1312
1413 interface SavedServices {
1514 category: string;
@@ -20,9 +19,12 @@
2019 let savedServices: SavedServices[] = $state([]);
2120
2221 onMount(async () => {
23 const results: SavedServices[] = [];
2422 const saved =
2523 serviceList || JSON.parse(localStorage.getItem('savedServices') || '[]');
24 if (!saved.length) return;
25
26 const results: SavedServices[] = [];
27 const allData = await fetchCategories();
2628 saved.forEach((serviceId: string) => {
2729 const parts = serviceId.split('/');
2830 const categoryName = parts[0];
@@ -70,7 +72,7 @@
7072 </small>
7173 <p class="nope">Nothing saved yet!</p>
7274 <div class="footer">
73 <a class="small-button" href="/all">Browse all entries &rarr;</a>
75 <a class="small-button" href="/all/">Browse all entries &rarr;</a>
7476 </div>
7577 </div>
7678 {/if}
web/src/components/things/Search.svelte +11 −11
@@ -1,32 +1,30 @@
11<script lang="ts">
22 import { onMount } from 'svelte';
33 import Fuse from 'fuse.js';
4 import { slugify } from '@utils/fetch-data';
5 import type { Category } from '../../types/Service';
4 import { fetchCategories, slugify } from '@utils/fetch-data';
65 import { formatLink } from '@utils/parse-markdown';
76 import { prepareSearchItems, searchOptions } from '@utils/do-searchy-searchy';
87 import type { SearchItem } from '@utils/do-searchy-searchy';
98
109 interface Props {
11 data: Category[];
1210 previousSearch?: string | undefined;
1311 }
14 const { data, previousSearch = undefined }: Props = $props();
12 const { previousSearch = undefined }: Props = $props();
1513
1614 let fuse: Fuse<SearchItem> | null = $state(null);
1715 let searchQuery = $state('');
1816
1917 // Initialize Fuse.js
20 onMount(() => {
21 const items = prepareSearchItems(data);
18 onMount(async () => {
19 const items = prepareSearchItems(await fetchCategories());
2220 fuse = new Fuse(items, searchOptions);
2321 });
2422
2523 const makeResultLink = (cat?: string, sec?: string, itm?: string) => {
2624 if (!cat) return '/';
27 if (!sec) return `/${slugify(cat)}`;
28 if (!itm) return `/${slugify(cat)}/${slugify(sec)}`;
29 return `/${slugify(cat)}/${slugify(sec)}/${slugify(itm)}`;
25 if (!sec) return `/${slugify(cat)}/`;
26 if (!itm) return `/${slugify(cat)}/${slugify(sec)}/`;
27 return `/${slugify(cat)}/${slugify(sec)}/${slugify(itm)}/`;
3028 };
3129
3230 const makeResultText = (cat?: string, sec?: string, itm?: string) => {
@@ -71,7 +69,7 @@
7169 const active = results[activeIndex];
7270 window.location.href = active
7371 ? makeResultLink(active.category, active.sectionName, active.name)
74 : `/search/${encodeURIComponent(searchQuery)}`;
72 : `/search/${encodeURIComponent(searchQuery)}/`;
7573 }
7674 if (event.key === 'Escape') {
7775 searchQuery = '';
@@ -100,7 +98,9 @@
10098 aria-expanded={results.length > 0}
10199 aria-controls="search-results"
102100 aria-autocomplete="list"
103 aria-activedescendant={activeIndex >= 0 ? `search-result-${activeIndex}` : undefined}
101 aria-activedescendant={activeIndex >= 0
102 ? `search-result-${activeIndex}`
103 : undefined}
104104 bind:value={searchQuery}
105105 onkeydown={handleKeyDown}
106106 />
web/src/components/things/SectionList.astro +2 −2
@@ -23,7 +23,7 @@ const Heading = `h${headingLevel}` as 'h2' | 'h3';
2323 {title}{' '}
2424 </h1>
2525 ) : (
26 <a class="category-title" href={`/${slugify(title)}`}>
26 <a class="category-title" href={`/${slugify(title)}/`}>
2727 <Heading>{title}</Heading>
2828 </a>
2929 )
@@ -41,7 +41,7 @@ const Heading = `h${headingLevel}` as 'h2' | 'h3';
4141 {
4242 sections.map((section) => (
4343 <li class="section">
44 <a href={`/${slugify(title)}/${slugify(section.name)}`}>
44 <a href={`/${slugify(title)}/${slugify(section.name)}/`}>
4545 <span>{section.name}</span>
4646 <span class="service-count">
4747 ({section.services ? section.services.length : 0})
web/src/components/things/ServiceCard.astro +2 −2
@@ -19,7 +19,7 @@ const { service, sectionName, categoryName } = Astro.props;
1919 <div class="service-head">
2020 <a
2121 class="service-title"
22 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
22 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}/`}
2323 >
2424 <h4>{service.name}</h4>
2525 </a>
@@ -69,7 +69,7 @@ const { service, sectionName, categoryName } = Astro.props;
6969 )
7070 }
7171 <a
72 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
72 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}/`}
7373 >
7474 <FontAwesome iconName="viewReport" /> View Report ➔
7575 </a>
web/src/components/things/ServiceCard.svelte +2 −2
@@ -21,7 +21,7 @@
2121 <div class="service-head">
2222 <a
2323 class="service-title"
24 href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}
24 href={`/${categorySlug}/${sectionSlug}/${serviceRef}/`}
2525 >
2626 <h4>{service.name}</h4>
2727 </a>
@@ -90,7 +90,7 @@
9090 <FontAwesome iconName="sourceCode" /> Source
9191 </a>
9292 {/if}
93 <a href={`/${categorySlug}/${sectionSlug}/${serviceRef}`}>
93 <a href={`/${categorySlug}/${sectionSlug}/${serviceRef}/`}>
9494 <FontAwesome iconName="viewReport" /> View Report ➔
9595 </a>
9696 </div>
web/src/components/things/ServiceList.astro +3 −3
@@ -62,7 +62,7 @@ const sortedServices = [...(services || [])].sort((a, b) =>
6262
6363 <a
6464 class="service-title"
65 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
65 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}/`}
6666 >
6767 {subHeading ? <h3>{service.name}</h3> : <h2>{service.name}</h2>}
6868 </a>
@@ -160,7 +160,7 @@ const sortedServices = [...(services || [])].sort((a, b) =>
160160 </div>
161161 <div class="view-service">
162162 <a
163 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}`}
163 href={`/${slugify(categoryName)}/${slugify(sectionName)}/${slugify(service.name)}/`}
164164 >
165165 View {service.name} Report
166166 </a>
@@ -180,7 +180,7 @@ const sortedServices = [...(services || [])].sort((a, b) =>
180180 GitHub.
181181 <br />
182182 <span class="quick-submit">
183 Or submit an entry <a href="/submit">here</a>
183 Or submit an entry <a href="/submit/">here</a>
184184 </span>
185185 </p>
186186 )
web/src/components/things/SmartSuggestions.svelte +5 −5
@@ -1,8 +1,8 @@
11<script lang="ts">
22 import { onMount } from 'svelte';
3 import type { Category, Service } from '../../types/Service';
3 import type { Service } from '../../types/Service';
44 import { formatLink } from '@utils/parse-markdown';
5 import { slugify } from '@utils/fetch-data';
5 import { fetchCategories, slugify } from '@utils/fetch-data';
66 import { apiBase } from '@utils/api-config';
77
88 interface ServiceResult extends Service {
@@ -10,10 +10,9 @@
1010 }
1111
1212 interface Props {
13 categories: Category[];
1413 searchTerm: string;
1514 }
16 const { categories, searchTerm }: Props = $props();
15 const { searchTerm }: Props = $props();
1716
1817 let results: ServiceResult[] = $state([]);
1918
@@ -29,11 +28,12 @@
2928 );
3029
3130 const tmpResults: ServiceResult[] = [];
31 const categories = await fetchCategories();
3232 categories.forEach((category) => {
3333 (category.sections || []).forEach((section) => {
3434 (section.services || []).forEach((service) => {
3535 if (fetchedServices.includes(normalize(service.name))) {
36 const path = `/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`;
36 const path = `/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}/`;
3737 tmpResults.push({ ...service, path });
3838 return;
3939 }
web/src/layouts/Layout.astro +18 −13
@@ -27,6 +27,15 @@ const {
2727 customSchemaJson,
2828} = Astro.props;
2929
30// Crumbs arrive as '/', 'api' or 'category/section', so normalise to a canonical URL
31const crumbUrl = (item: string) => {
32 const path = item.replace(/^\/+|\/+$/g, '');
33 return `https://awesome-privacy.xyz/${path && `${path}/`}`;
34};
35
36// Always advertise the trailing-slash form, so server-rendered routes agree with the sitemap
37const canonical = crumbUrl(Astro.url.pathname);
38
3039const makeBreadcrumbs = () => {
3140 if (!breadcrumbs) return null;
3241 return {
@@ -36,7 +45,7 @@ const makeBreadcrumbs = () => {
3645 '@type': 'ListItem',
3746 position: index + 1,
3847 name: breadcrumb.name,
39 item: `https://awesome-privacy.xyz/${breadcrumb.item}`,
48 item: crumbUrl(breadcrumb.item),
4049 })),
4150 };
4251};
@@ -52,7 +61,7 @@ const makeSearchLd = () => {
5261 target: {
5362 '@type': 'EntryPoint',
5463 urlTemplate:
55 'https://awesome-privacy.xyz/search?q={search_term_string}',
64 'https://awesome-privacy.xyz/search/{search_term_string}/',
5665 },
5766 'query-input': 'required name=search_term_string',
5867 },
@@ -67,7 +76,9 @@ const makeSearchLd = () => {
6776 <script is:inline>
6877 const setTheme = () => {
6978 const stored = localStorage.getItem('theme');
70 const prefersLight = matchMedia('(prefers-color-scheme: light)').matches;
79 const prefersLight = matchMedia(
80 '(prefers-color-scheme: light)',
81 ).matches;
7182 document.documentElement.dataset.theme =
7283 stored || (prefersLight ? 'light' : 'dark');
7384 };
@@ -90,10 +101,7 @@ const makeSearchLd = () => {
90101 content={`Built by an actual human, in Astro. ${Astro.generator}`}
91102 />
92103 <meta name="robots" content="index, follow" />
93 <link
94 rel="canonical"
95 href={`https://awesome-privacy.xyz${Astro.url.pathname}`}
96 />
104 <link rel="canonical" href={canonical} />
97105 <link
98106 rel="alternate"
99107 type="application/rss+xml"
@@ -125,10 +133,7 @@ const makeSearchLd = () => {
125133 <!-- Social media meta tags (Open Graphh + Twitter) -->
126134 <meta property="og:site_name" content="Awesome Privacy" />
127135 <meta property="og:type" content="website" />
128 <meta
129 property="og:url"
130 content={`https://awesome-privacy.xyz${Astro.url.pathname}`}
131 />
136 <meta property="og:url" content={canonical} />
132137 <meta property="og:title" content={title} />
133138 <meta property="og:description" content={description} />
134139 <meta
@@ -252,8 +257,8 @@ const makeSearchLd = () => {
252257 ::after {
253258 animation-duration: 0.01ms !important;
254259 animation-iteration-count: 1 !important;
255 transition-property: color, background-color, border-color, box-shadow,
256 opacity !important;
260 transition-property:
261 color, background-color, border-color, box-shadow, opacity !important;
257262 }
258263 }
259264
web/src/pages/404.astro +3 −3
@@ -16,13 +16,13 @@ import Buton from '@components/form/Button.astro';
1616 Looking for somewhere else?
1717 <ul>
1818 <li>
19 <a href="/search">Search</a>
19 <a href="/search/">Search</a>
2020 </li>
2121 <li>
22 <a href="/browse">Browse</a>
22 <a href="/browse/">Browse</a>
2323 </li>
2424 <li>
25 <a href="/about">About</a>
25 <a href="/about/">About</a>
2626 </li>
2727 <li>
2828 <a href="https://github.com/lissy93/awesome-privacy">Source</a>
web/src/pages/[...listing].astro +14 −19
@@ -17,6 +17,7 @@ import DataActions from '@components/things/DataActions.svelte';
1717import type { AwesomePrivacy, Section, Service } from '../types/Service';
1818import { fetchData, slugify } from '@utils/fetch-data';
1919import { codebergUrl } from '@utils/parse-markdown';
20import { plainText, truncate } from '@utils/meta-tags';
2021import { fetchChangelog } from '@utils/fetch-changelog';
2122import { fetchGitHubStats } from '@utils/fetch-repo-info';
2223import { fetchSecurityReport } from '@utils/fetch-security-info';
@@ -91,16 +92,14 @@ const makeBreadcrumbs = () => {
9192 ];
9293};
9394
95const plainDescription = plainText(description);
96
9497const makeDescriptionTag = () => {
95 let desc = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `;
96 if (parentSection.services) {
97 desc += `Compare ${parentSection.services.map((s: Service) => s.name).join(' vs ')} more apps. `;
98 }
99 if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) {
100 desc += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')}. `;
101 }
102 desc += 'All this, and many more free and awesome tools and software.';
103 return desc;
98 const summary = `${name}: ${plainDescription}`.replace(/([^.!?])$/, '$1.');
99 if (summary.length >= 120) return truncate(summary);
100 return truncate(
101 `${summary} Compare it with other private ${parentSection.name.toLowerCase()} on Awesome Privacy.`,
102 );
104103};
105104
106105const filterServices = () => {
@@ -243,10 +242,6 @@ const makeSoftwareSchema = () => {
243242 androidApp && 'Android',
244243 url && 'Web',
245244 ].filter(Boolean);
246 const plainDescription = (description || '')
247 .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
248 .replace(/[*_`~]/g, '')
249 .trim();
250245 const codeRepository = github
251246 ? `https://github.com/${github}`
252247 : codeberg
@@ -365,7 +360,7 @@ const makeSoftwareSchema = () => {
365360 services={filterServices()}
366361 subHeading={true}
367362 noGitHubMetrics={true}
368 buttonLink={`/${catSlug}/${secSlug}`}
363 buttonLink={`/${catSlug}/${secSlug}/`}
369364 categoryName={categoryName}
370365 sectionName={parentSection.name}
371366 />
@@ -389,7 +384,7 @@ const makeSoftwareSchema = () => {
389384 <p>
390385 The REST API is free, no-auth and CORS-enabled. To learn more, view the <a
391386 href={`${apiBase}/docs`}>API Docs</a
392 > or read the <a href="/about#api">API Usage Guide</a>.
387 > or read the <a href="/about/#api">API Usage Guide</a>.
393388 </p>
394389 </section>
395390
@@ -401,7 +396,7 @@ const makeSoftwareSchema = () => {
401396 Share {name} and Awesome Privacy with your network!
402397 <div>
403398 <SocialShare
404 url={`${site}/${catSlug}/${secSlug}/${slugify(name)} `}
399 url={`${site}/${catSlug}/${secSlug}/${slugify(name)}/`}
405400 title={`Checkout ${name}! \n`}
406401 description={`Compare #${name} and other privacy-respecting ${parentSection.name} at ` +
407402 `Awesome-Privacy.xyz, the free and open source list of private software alternatives. ` +
@@ -414,7 +409,7 @@ const makeSoftwareSchema = () => {
414409 <div class="pagination-navigation">
415410 {
416411 previous ? (
417 <Button url={`/${catSlug}/${secSlug}/${slugify(previous)}`}>
412 <Button url={`/${catSlug}/${secSlug}/${slugify(previous)}/`}>
418413 <span>← Previous</span>
419414 <p>{previous}</p>
420415 </Button>
@@ -422,12 +417,12 @@ const makeSoftwareSchema = () => {
422417 <p class="nothing" />
423418 )
424419 }
425 <a href={`/${catSlug}/${secSlug}`} class="go-to-category">
420 <a href={`/${catSlug}/${secSlug}/`} class="go-to-category">
426421 View {parentSection.name} ({(parentSection.services || []).length})
427422 </a>
428423 {
429424 next && (
430 <Button url={`/${catSlug}/${secSlug}/${slugify(next)}`}>
425 <Button url={`/${catSlug}/${secSlug}/${slugify(next)}/`}>
431426 <span>Next →</span>
432427 <p>{next}</p>
433428 </Button>
web/src/pages/[...section].astro +24 −27
@@ -8,6 +8,7 @@ import ServiceList from '@components/things/ServiceList.astro';
88import type { AwesomePrivacy, Section, Service, ShortService } from '../types/Service';
99import { fetchData, slugify } from '@utils/fetch-data';
1010import { parseMarkdown } from '@utils/parse-markdown';
11import { truncate } from '@utils/meta-tags';
1112
1213interface Props {
1314 slug: string,
@@ -66,38 +67,34 @@ const makeBreadcrumbs = () => {
6667 * Make a string page intro, for the description tag
6768 */
6869const makeDescriptionTag = () => {
69 let description = `Privacy respecting ${title}. `;
70 let description = `Privacy-respecting ${title}. `;
7071 if (services && services.length > 0) {
71 const serviceList = services.map((serv: Service) => serv.name);
72 description += `Compare ${serviceList.join(' vs ')} and more private, open source apps and services now. `
72 description += `Compare ${services.map((serv: Service) => serv.name).join(', ')}. `;
7373 } else {
7474 description += `Find private apps and services. This section is still a work in progress. `;
7575 }
7676 if (alternativeTo && alternativeTo.length > 0) {
77 description += `The best secure encrypted alternatives to ${alternativeTo.join(', ')} in 2024. `;
77 description += `The best secure, encrypted alternatives to ${alternativeTo.join(', ')}.`;
7878 }
79 description += 'All this, and many more free and awesome tools and software.'
80 return description;
79 return truncate(description.trim());
8180};
8281
8382const makeCarasolData = () => {
8483 return {
8584 "@context": "https://schema.org",
8685 "@type": "ItemList",
87 "itemListElement": [
88 services.map((service, index) => ({
89 "@type": "ListItem",
90 "position": index + 1,
91 "url": `https://awesome-privacy.xyz/${slugify(categoryName)}/${slugify(title)}/${slugify(service.name)}`,
92 "item": {
93 "@type": "Service",
94 "name": service.name,
95 "description": service.description,
96 "image": service.icon,
97 "url": `https://awesome-privacy.xyz/${slugify(categoryName)}/${slugify(title)}/${slugify(service.name)}`
98 }
99 })),
100 ]
86 "itemListElement": services.map((service, index) => ({
87 "@type": "ListItem",
88 "position": index + 1,
89 "url": `https://awesome-privacy.xyz/${slugify(categoryName)}/${slugify(title)}/${slugify(service.name)}/`,
90 "item": {
91 "@type": "Service",
92 "name": service.name,
93 "description": service.description,
94 "image": service.icon,
95 "url": `https://awesome-privacy.xyz/${slugify(categoryName)}/${slugify(title)}/${slugify(service.name)}/`
96 }
97 }))
10198 }
10299};
103100
@@ -151,8 +148,8 @@ const { previous, next } = makePaginationLinks();
151148 <div class="breadcrumbs">
152149 <span>
153150 <a href="/">Awesome Privacy</a>
154 ➔ <a href={`/${slugify(categoryName)}`}>{categoryName}</a>
155 ➔ <a href={`/${slugify(categoryName)}/${slugify(title)}`}>{title}</a>
151 ➔ <a href={`/${slugify(categoryName)}/`}>{categoryName}</a>
152 ➔ <a href={`/${slugify(categoryName)}/${slugify(title)}/`}>{title}</a>
156153 </span>
157154 </div>
158155
@@ -177,7 +174,7 @@ const { previous, next } = makePaginationLinks();
177174 </p>
178175 <p>
179176 Discover the best {title} tools for Android, iPhone, Linux, PC and Chrome to download now.
180 And choose secure, self-hosted, peer-to-peer and independant alternatives in 2024
177 And choose secure, self-hosted, peer-to-peer and independant alternatives
181178 </p>
182179 <p>
183180 <b>Stop the invasion of privacy from big tech, improve data security stay safe.</b>
@@ -223,23 +220,23 @@ const { previous, next } = makePaginationLinks();
223220 <h2>Submit New Entry</h2>
224221 <p>
225222 Are we missing anything?
226 You can help us improve this page, by <a href="/submit">submitting a new entry</a>
223 You can help us improve this page, by <a href="/submit/">submitting a new entry</a>
227224 </p>
228225 </section>
229226 )}
230227
231228 <div class="pagination-navigation">
232229 { previous ? (
233 <Button url={`/${slugify(categoryName)}/${slugify(previous)}`}>
230 <Button url={`/${slugify(categoryName)}/${slugify(previous)}/`}>
234231 <span>← Previous</span>
235232 <p>{previous}</p>
236233 </Button>
237234 ) : <p class="nothing"></p>}
238 <a href={`/${slugify(categoryName)}`} class="go-to-category">
235 <a href={`/${slugify(categoryName)}/`} class="go-to-category">
239236 View all in {categoryName} ({otherSections.length})
240237 </a>
241238 { next && (
242 <Button url={`/${slugify(categoryName)}/${slugify(next)}`}>
239 <Button url={`/${slugify(categoryName)}/${slugify(next)}/`}>
243240 <span>Next →</span>
244241 <p>{next}</p>
245242 </Button>
web/src/pages/[category].astro +14 −16
@@ -40,18 +40,16 @@ const makeCarasolData = () => {
4040 return {
4141 '@context': 'https://schema.org',
4242 '@type': 'ItemList',
43 itemListElement: [
44 sections.map((section, index) => ({
45 '@type': 'ListItem',
46 position: index + 1,
47 url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}`,
48 item: {
49 '@type': 'Service',
50 name: section.name,
51 url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}`,
52 },
53 })),
54 ],
43 itemListElement: sections.map((section, index) => ({
44 '@type': 'ListItem',
45 position: index + 1,
46 url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}/`,
47 item: {
48 '@type': 'Service',
49 name: section.name,
50 url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}/`,
51 },
52 })),
5553 };
5654};
5755
@@ -82,15 +80,15 @@ const { previous, next } = makePaginationLinks();
8280 <div class="breadcrumbs">
8381 <span>
8482 <a href="/">Awesome Privacy</a>
85 ➔ <a href={`/${slugify(title)}`}>{title}</a>
83 ➔ <a href={`/${slugify(title)}/`}>{title}</a>
8684 </span>
8785 </div>
8886 <SectionList title={title} sections={sections} bigTitle={true} />
89 Or, <a href={`/all#${slugify(title)}`}>Browse All {title}</a>
87 Or, <a href={`/all/#${slugify(title)}`}>Browse All {title}</a>
9088 <div class="pagination-navigation">
9189 {
9290 previous ? (
93 <Button url={`/${slugify(previous)}`}>
91 <Button url={`/${slugify(previous)}/`}>
9492 <span>← Previous</span>
9593 <p>{previous}</p>
9694 </Button>
@@ -100,7 +98,7 @@ const { previous, next } = makePaginationLinks();
10098 }
10199 {
102100 next && (
103 <Button url={`/${slugify(next)}`}>
101 <Button url={`/${slugify(next)}/`}>
104102 <span>Next →</span>
105103 <p>{next}</p>
106104 </Button>
web/src/pages/all.astro +3 −3
@@ -49,13 +49,13 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
4949 <Fragment>
5050 <h2 id={slugify(category.name)}>
5151 <FontAwesome iconName={slugify(category.name)} />
52 <a href={`/${slugify(category.name)}`}>{category.name}</a>
52 <a href={`/${slugify(category.name)}/`}>{category.name}</a>
5353 </h2>
5454 <article>
5555 {category.sections.map((section: Section) => (
5656 <Fragment>
5757 <h3 id={`${slugify(category.name)}-${slugify(section.name)}`}>
58 <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>
58 <a href={`/${slugify(category.name)}/${slugify(section.name)}/`}>
5959 {section.name}
6060 </a>
6161 </h3>
@@ -74,7 +74,7 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
7474 <strong>This section is still a work in progress</strong><br />
7575 Check back soon, or help us complete it by submitting a
7676 <a href="https://github.com/lissy93/awesome-privacy">pull request</a>
77 or <a href="/submit">entry</a>.
77 or <a href="/submit/">entry</a>.
7878 </p>
7979 </div>
8080 )}
web/src/pages/browse.astro +8 −4
@@ -23,7 +23,7 @@ const categories: Category[] = (await fetchData())?.categories;
2323 </span>
2424 </div>
2525 <p class="sitemap-link">
26 Not sure what you're looking for? Take a look through <a href="/all"
26 Not sure what you're looking for? Take a look through <a href="/all/"
2727 >all listings</a
2828 >
2929 </p>
@@ -32,7 +32,11 @@ const categories: Category[] = (await fetchData())?.categories;
3232 {
3333 categories.map((category) => (
3434 <li class="category">
35 <SectionList title={category.name} sections={category.sections} headingLevel={2} />
35 <SectionList
36 title={category.name}
37 sections={category.sections}
38 headingLevel={2}
39 />
3640 </li>
3741 ))
3842 }
@@ -40,7 +44,7 @@ const categories: Category[] = (await fetchData())?.categories;
4044
4145 <div class="no-results">
4246 <p class="zilch">Nothing found 😢</p>
43 <p>Try a <a href="/search">deep search</a> instead</p>
47 <p>Try a <a href="/search/">deep search</a> instead</p>
4448 </div>
4549</Layout>
4650
@@ -100,7 +104,7 @@ const categories: Category[] = (await fetchData())?.categories;
100104 searchInput.addEventListener('keydown', function (event) {
101105 if (event.key === 'Enter') {
102106 event.preventDefault();
103 window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}`;
107 window.location.href = `/search/${encodeURIComponent(searchInput.value.trim())}/`;
104108 }
105109 if (event.key === 'Escape') {
106110 searchInput.value = '';
web/src/pages/index.astro +12 −15
@@ -12,22 +12,19 @@ import type { Category } from 'src/types/Service';
1212const categories = (await fetchData())?.categories || ([] as Category[]);
1313
1414const description =
15 'Privacy is a fundamental human right; ' +
16 "without it, we're just open books in a world where everyone's " +
17 "watching. Let's take control back.\n" +
18 'Migrating open-source applications which do not collect, sell or log your data is a great first step.' +
19 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
15 'Find privacy-respecting alternatives to the apps and services you use every day. ' +
16 'A curated directory of open source, secure and ad-free software.';
2017---
2118
22<Layout title="Home | Awesome Privacy" description={description}>
19<Layout description={description}>
2320 <Hero />
2421 <main>
2522 <div class="action-card">
26 <Search client:visible data={categories} />
23 <Search client:visible />
2724 <span class="action-divider">or</span>
28 <a href="/all" class="browse-cta"> Browse All Listings &rarr; </a>
25 <a href="/all/" class="browse-cta"> Browse All Listings &rarr; </a>
2926 </div>
30 <h2 class="browse-title"><a href="/all">Categories</a></h2>
27 <h2 class="browse-title"><a href="/all/">Categories</a></h2>
3128 <ul class="categories">
3229 {
3330 categories.map((category) => (
@@ -38,17 +35,17 @@ const description =
3835 }
3936 </ul>
4037 <div class="categories-footer">
41 <a class="small-button" href="/all">View everything &rarr;</a>
38 <a class="small-button" href="/all/">View everything &rarr;</a>
4239 </div>
4340
44 <h2><a href="/changelog">Latest Updates</a></h2>
41 <h2><a href="/changelog/">Latest Updates</a></h2>
4542 <LatestUpdates categories={categories} />
4643
47 <h2><a href="/inventory">Saved Items</a></h2>
48 <SavedServices allData={categories} client:load />
44 <h2><a href="/inventory/">Saved Items</a></h2>
45 <SavedServices client:load />
4946
5047 <h2>
51 <a href="/about">About</a>
48 <a href="/about/">About</a>
5249 </h2>
5350 <div class="about-summary">
5451 <p>
@@ -75,7 +72,7 @@ const description =
7572 > on GitHub.
7673 </p>
7774 <div class="about-footer">
78 <a class="small-button" href="/about">Keep reading &rarr;</a>
75 <a class="small-button" href="/about/">Keep reading &rarr;</a>
7976 </div>
8077 </div>
8178 </main>
web/src/pages/inventory/[...inventoryId].astro +2 −6
@@ -2,11 +2,7 @@
22import Layout from '@layouts/Layout.astro';
33import SavedServices from '@components/things/SavedServices.svelte';
44
5import { fetchData } from '@utils/fetch-data';
65import Button from '@components/form/Button.astro';
7import type { Category } from '../../types/Service';
8
9const categories = (await fetchData())?.categories || ([] as Category[]);
106
117export const prerender = false;
128
@@ -50,10 +46,10 @@ if (serviceList.error) {
5046 </div>
5147 )
5248 }
53 <SavedServices allData={categories} serviceList={serviceList} client:load />
49 <SavedServices serviceList={serviceList} client:load />
5450 <div class="buttons">
5551 <p>Not found what you're looking for?</p>
56 <Button url="/all">Browse Services</Button>
52 <Button url="/all/">Browse Services</Button>
5753 </div>
5854 </main>
5955</Layout>
web/src/pages/inventory/index.astro +2 −6
@@ -3,12 +3,8 @@ import Layout from '@layouts/Layout.astro';
33import SavedServices from '@components/things/SavedServices.svelte';
44import GetSharableLink from '@components/things/GetSharableLink.svelte';
55
6import { fetchData } from '@utils/fetch-data';
76import Button from '@components/form/Button.astro';
87import EditableTitle from '@components/form/EditableTitle.svelte';
9import type { Category } from '../../types/Service';
10
11const categories = (await fetchData())?.categories || ([] as Category[]);
128---
139
1410<Layout title="Saved Services">
@@ -18,10 +14,10 @@ const categories = (await fetchData())?.categories || ([] as Category[]);
1814 <EditableTitle client:load />
1915 <GetSharableLink client:load />
2016 </div>
21 <SavedServices allData={categories} client:load />
17 <SavedServices client:load />
2218 <div class="buttons">
2319 <p>Not found what you're looking for?</p>
24 <Button url="/all">Browse Services</Button>
20 <Button url="/all/">Browse Services</Button>
2521 </div>
2622 </main>
2723</Layout>
web/src/pages/search/[...searchTerm].astro +6 −7
@@ -67,13 +67,9 @@ const beer = putResultsIntoGroups();
6767<Layout title="Search | Awesome Privacy">
6868 <section>
6969 <h1>Search</h1>
70 <Search client:visible data={categories} previousSearch={searchTerm} />
70 <Search client:visible previousSearch={searchTerm} />
7171 </section>
72 <SmartSuggestions
73 client:visible
74 searchTerm={searchTerm || ''}
75 categories={categories}
76 />
72 <SmartSuggestions client:visible searchTerm={searchTerm || ''} />
7773 <section class="result-count">
7874 <h3>Deep Search</h3>
7975 <p>
@@ -84,7 +80,10 @@ const beer = putResultsIntoGroups();
8480 {
8581 beer.map((category) => (
8682 <div class="category">
87 <a class="category-title" href={`/${slugify(category.categoryName)}`}>
83 <a
84 class="category-title"
85 href={`/${slugify(category.categoryName)}/`}
86 >
8887 <h3>{category.categoryName}</h3>
8988 </a>
9089 <span class="section-icon">
web/src/pages/search/index.astro +3 −6
@@ -1,19 +1,16 @@
11---
22import Layout from '@layouts/Layout.astro';
3import { fetchData } from '@utils/fetch-data';
43
54import Search from '@components/things/Search.svelte';
6
7const categories = (await fetchData())?.categories;
85---
96
107<Layout title="Search | Awesome Privacy">
118 <section>
129 <h1>Search</h1>
13 <Search client:visible data={categories} />
10 <Search client:visible />
1411 <p class="sitemap-link">
15 Browse <a href="/all">all listings</a>, or see all pages in the <a
16 href="/sitemap">Sitemap</a
12 Browse <a href="/all/">all listings</a>, or see all pages in the <a
13 href="/sitemap/">Sitemap</a
1714 >
1815 </p>
1916 </section>
web/src/pages/sitemap.astro +21 −21
@@ -30,35 +30,35 @@ const categories = ((await fetchData()) as AwesomePrivacy)?.categories || [];
3030 <a href="/">Home</a>
3131 </li>
3232 <li>
33 <a href="/search">Search</a>
33 <a href="/search/">Search</a>
3434 </li>
3535 <li>
36 <a href="/all">View All</a>
36 <a href="/all/">View All</a>
3737 </li>
3838 <li>
39 <a href="/changelog">Changelog</a>
39 <a href="/changelog/">Changelog</a>
4040 </li>
4141 <li>
42 <a href="/inventory">My Inventory</a>
42 <a href="/inventory/">My Inventory</a>
4343 </li>
4444 <li>
45 <a href="/submit">Submit Listing</a>
45 <a href="/submit/">Submit Listing</a>
4646 </li>
4747 <li>
48 <a href="/api">API</a>
48 <a href="/api/">API</a>
4949 </li>
5050 <li>
51 <a href="/browse">Categories</a>
51 <a href="/browse/">Categories</a>
5252 <ul>
5353 {
5454 categories.map((category) => (
5555 <li>
56 <a href={`/${slugify(category.name)}`}>{category.name}</a>
56 <a href={`/${slugify(category.name)}/`}>{category.name}</a>
5757 <ul>
5858 {category.sections.map((section) => (
5959 <li>
6060 <a
61 href={`/${slugify(category.name)}/${slugify(section.name)}`}
61 href={`/${slugify(category.name)}/${slugify(section.name)}/`}
6262 >
6363 {section.name}
6464 </a>
@@ -66,7 +66,7 @@ const categories = ((await fetchData()) as AwesomePrivacy)?.categories || [];
6666 {(section.services || []).map((service) => (
6767 <li title={service.description || ''}>
6868 <a
69 href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`}
69 href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}/`}
7070 >
7171 {service.name}
7272 </a>
@@ -82,24 +82,24 @@ const categories = ((await fetchData()) as AwesomePrivacy)?.categories || [];
8282 </ul>
8383 </li>
8484 <li>
85 <a href="/about">About</a>
85 <a href="/about/">About</a>
8686 <ul>
87 <li><a href="/about#objective">Objective</a></li>
88 <li><a href="/about#criteria">Listing Criteria</a></li>
89 <li><a href="/about#contributing">Contributing</a></li>
87 <li><a href="/about/#objective">Objective</a></li>
88 <li><a href="/about/#criteria">Listing Criteria</a></li>
89 <li><a href="/about/#contributing">Contributing</a></li>
9090 <li>
91 <a href="/about#acknowledgements">Acknowledgements</a>
91 <a href="/about/#acknowledgements">Acknowledgements</a>
9292 <ul>
93 <li><a href="/about#contributors">Contributors</a></li>
94 <li><a href="/about#sponsors">Sponsors</a></li>
93 <li><a href="/about/#contributors">Contributors</a></li>
94 <li><a href="/about/#sponsors">Sponsors</a></li>
9595 </ul>
9696 </li>
97 <li><a href="/about#author">Author</a></li>
98 <li><a href="/about#license">License</a></li>
97 <li><a href="/about/#author">Author</a></li>
98 <li><a href="/about/#license">License</a></li>
9999 </ul>
100100 </li>
101101 <li>
102 <a href="/sitemap">Sitemap</a>
102 <a href="/sitemap/">Sitemap</a>
103103 </li>
104104 </ul>
105105 </main>
@@ -130,7 +130,7 @@ const categories = ((await fetchData()) as AwesomePrivacy)?.categories || [];
130130 case 'Enter':
131131 event.preventDefault();
132132 const searchTerm = encodeURIComponent(filterInput.value);
133 window.location.href = `/search/${searchTerm}`;
133 window.location.href = `/search/${searchTerm}/`;
134134 break;
135135 case 'Escape':
136136 filterInput.value = '';
web/src/pages/submit.astro +2 −2
@@ -18,7 +18,7 @@ const isDisabled = true; // will set this back to false if/when we have better w
1818 <p class="about-data">
1919 All data on Awesome Privacy is community maintained via Git, this keeps
2020 everything transparent, and means anyone can submit edits. You can learn
21 more about how our data is managed on our <a href="/about#our-data"
21 more about how our data is managed on our <a href="/about/#our-data"
2222 >about page</a
2323 >.
2424 <br /><br />
@@ -77,7 +77,7 @@ const isDisabled = true; // will set this back to false if/when we have better w
7777 > guidelines before proceeding
7878 </li>
7979 <li>
80 All listing must meed our <a href="/about#creteria">Criteria</a> to be considered
80 All listing must meed our <a href="/about/#creteria">Criteria</a> to be considered
8181 privacy-respecting
8282 </li>
8383 <li>Double check that your changes haven't already been proposed</li>
web/src/utils/fetch-data.ts +14 −1
@@ -2,7 +2,7 @@ import yaml from 'js-yaml';
22import { error } from './logger';
33import { safeFetch } from './safe-fetch';
44
5import type { AwesomePrivacy } from '../types/Service';
5import type { AwesomePrivacy, Category } from '../types/Service';
66
77const awesomePrivacyData =
88 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/awesome-privacy.yml';
@@ -25,6 +25,19 @@ export const fetchData = async (): Promise<AwesomePrivacy> => {
2525 }
2626};
2727
28/**
29 * Loads the dataset from the browser, ready for the islands who need it
30 */
31export const fetchCategories = async (): Promise<Category[]> => {
32 try {
33 const res = await fetch('/api/awesome-privacy.json');
34 return (await res.json())?.categories || [];
35 } catch (err) {
36 error('Data', `Failed to fetch dataset: ${err}`);
37 return [];
38 }
39};
40
2841export const slugify = (title: string) => {
2942 return (title || '')
3043 .toLowerCase()
web/src/utils/meta-tags.ts added +11
@@ -0,0 +1,11 @@
1/** Strip markdown and collapse wrapped lines, so prose is safe to use in a meta tag */
2export const plainText = (markdown?: string) =>
3 (markdown || '')
4 .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
5 .replace(/[*_`~]/g, '')
6 .replace(/\s+/g, ' ')
7 .trim();
8
9/** Cut sentance off after 155 chars rounded to nearest next word */
10export const truncate = (text: string, max = 155) =>
11 text.length <= max ? text : `${text.slice(0, text.lastIndexOf(' ', max))}…`;