Commit 3df23e0046

3df23e00460a38b02aa2b6ca8542f943689a117b

parent: 6d9a75963c

Unsigned

Alicia Sykes <alicia@omg.lol> · 2026-04-16 15:17 UTC

Small UI improvments for the pages

Layout: unified · split

web/src/components/scafold/NavBar.astro +1 −1
@@ -6,7 +6,7 @@ const navLinks = [
66 { label: 'View All', href: '/all' },
77 { label: 'Search', href: '/search' },
88 { label: 'Changelog', href: '/changelog' },
9 { label: 'API', href: '/api' },
9 // { label: 'API', href: '/api' }, // TODO: restore once API is built out
1010 { label: 'Saved', href: '/inventory', id: 'saved-nav-link', hidden: true },
1111 { label: 'About', href: '/about' },
1212 {
web/src/components/things/ChangelogTimeline.svelte +6 −3
@@ -112,7 +112,11 @@
112112 { name: m.name, category: m.to.category, section: m.to.section },
113113 ]),
114114 ...s.renamed.flatMap((m) => [
115 { name: m.previousName, category: m.from.category, section: m.from.section },
115 {
116 name: m.previousName,
117 category: m.from.category,
118 section: m.from.section,
119 },
116120 { name: m.name, category: m.to.category, section: m.to.section },
117121 ]),
118122 ];
@@ -197,8 +201,7 @@
197201 })),
198202 ...s.renamed.map((v) => {
199203 const sameLoc =
200 v.from.category === v.to.category &&
201 v.from.section === v.to.section;
204 v.from.category === v.to.category && v.from.section === v.to.section;
202205 return {
203206 badge: 'Renamed',
204207 cls: 'mod',
web/src/components/things/LatestUpdates.astro added +176
@@ -0,0 +1,176 @@
1---
2import { fetchChangelog } from '@utils/fetch-changelog';
3import { fetchData, slugify } from '@utils/fetch-data';
4import ServiceIcon from './ServiceIcon.astro';
5import type { Category, Service } from '../../types/Service';
6
7interface Props {
8 limit?: number;
9 categories?: Category[];
10}
11
12const { limit = 12, categories: categoriesProp } = Astro.props;
13
14const categories = categoriesProp ?? ((await fetchData())?.categories || []);
15const { entries } = await fetchChangelog();
16
17const findService = (
18 categoryName: string,
19 sectionName: string,
20 serviceName: string,
21): Service | undefined => {
22 const c = categories.find((cat) => cat.name === categoryName);
23 const s = c?.sections.find((sec) => sec.name === sectionName);
24 return s?.services?.find((sv) => sv.name === serviceName);
25};
26
27const additions = entries
28 .slice()
29 .sort((a, b) => (a.date < b.date ? 1 : -1))
30 .flatMap((e) =>
31 (e.changes?.services?.added || []).map((s) => ({
32 ...s,
33 date: e.date,
34 author: e.pr?.author,
35 authorUrl: e.pr?.author ? `https://github.com/${e.pr.author}` : null,
36 service: findService(s.category, s.section, s.name),
37 })),
38 )
39 .slice(0, limit);
40
41const formatDate = (iso: string) =>
42 new Date(iso).toLocaleDateString('en-GB', {
43 day: 'numeric',
44 month: 'short',
45 year: 'numeric',
46 });
47---
48
49<div class="latest-updates">
50 {
51 additions.length > 0 ? (
52 <>
53 <p class="intro">
54 Newest privacy-respecting software and services added to the
55 directory.
56 </p>
57 <ul>
58 {additions.map((a) => (
59 <li>
60 <a
61 class="service-link"
62 href={`/${slugify(a.category)}/${slugify(a.section)}/${slugify(a.name)}`}
63 >
64 {a.service && (
65 <ServiceIcon
66 name={a.name}
67 url={a.service.url}
68 icon={a.service.icon}
69 size={32}
70 />
71 )}
72 <span class="name">{a.name}</span>
73 </a>
74 <p
75 class="meta"
76 title={`In ${a.category}${a.author ? ` submitted by @${a.author}` : ''} on ${formatDate(a.date)}`}
77 >
78 In{' '}
79 <a class="inline" href={`/${slugify(a.category)}`}>
80 {a.category}
81 </a>
82 {a.author && (
83 <>
84 {' '}
85 submitted by{' '}
86 <a
87 class="inline"
88 href={a.authorUrl!}
89 target="_blank"
90 rel="noopener noreferrer"
91 >
92 @{a.author}
93 </a>
94 </>
95 )}{' '}
96 on <time datetime={a.date}>{formatDate(a.date)}</time>
97 </p>
98 </li>
99 ))}
100 </ul>
101 <div class="footer">
102 <a class="small-button" href="/changelog">
103 View full changelog &rarr;
104 </a>
105 </div>
106 </>
107 ) : (
108 <p class="intro">No recent updates to show.</p>
109 )
110 }
111</div>
112
113<style lang="scss">
114 .latest-updates {
115 background: var(--accent-fg);
116 border: var(--border-heavy);
117 border-radius: var(--curve-sm);
118 box-shadow: var(--shadow-md);
119 padding: var(--space-md);
120 width: 100%;
121 box-sizing: border-box;
122 margin: 0 auto;
123 .intro {
124 margin: 0 0 var(--space-sm) 0;
125 }
126 ul {
127 list-style: none;
128 padding: 0;
129 margin: 0;
130 display: grid;
131 grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
132 gap: var(--space-sm) var(--space-md);
133 li {
134 display: flex;
135 flex-direction: column;
136 min-width: 0;
137 padding: var(--space-xs) 0;
138 .service-link {
139 display: flex;
140 align-items: center;
141 gap: var(--space-sm);
142 text-decoration: none;
143 color: var(--foreground);
144 min-width: 0;
145 &:hover .name {
146 color: var(--accent);
147 }
148 .name {
149 font-weight: bold;
150 overflow: hidden;
151 text-overflow: ellipsis;
152 white-space: nowrap;
153 }
154 }
155 .meta {
156 font-size: var(--text-sm);
157 opacity: var(--opacity-muted);
158 margin: 2px 0 0 0;
159 max-width: 100%;
160 overflow: hidden;
161 text-overflow: ellipsis;
162 white-space: nowrap;
163 a.inline {
164 color: inherit;
165 text-decoration: underline;
166 }
167 }
168 }
169 }
170 .footer {
171 display: flex;
172 justify-content: flex-end;
173 margin-top: var(--space-md);
174 }
175 }
176</style>
web/src/components/things/ListingHero.astro +2 −2
@@ -120,7 +120,7 @@ const highlights = [
120120
121121<section class="hero-section">
122122 <div class="service-head">
123 <h2>{name}</h2>
123 <h1>{name}</h1>
124124 <span class="url-wrap">
125125 <a class="service-url" href={url}>{formatLink(url)}</a>
126126 <span class="follow-with">{followWith}</span>
@@ -220,7 +220,7 @@ const highlights = [
220220 }
221221
222222 .service-head {
223 h2 {
223 h1 {
224224 font-size: var(--text-4xl);
225225 margin: 0;
226226 @media (max-width: 768px) {
web/src/components/things/SavedServices.svelte +20 −4
@@ -59,14 +59,17 @@
5959 {:else if !serviceList}
6060 <div class="nothing-yet">
6161 <p>
62 Here you'll find a list of all the software and services you've
63 bookmarked.
62 Save software and services, to curate your own privacy-respecting
63 software collection.
6464 </p>
6565 <small>
6666 All data is stored on-device, in your browser's local storage, and not
6767 sent anywhere unless you choose to share it
6868 </small>
6969 <p class="nope">Nothing saved yet!</p>
70 <div class="footer">
71 <a class="small-button" href="/all">Browse all entries &rarr;</a>
72 </div>
7073 </div>
7174 {/if}
7275</div>
@@ -80,6 +83,14 @@
8083 }
8184
8285 .nothing-yet {
86 background: var(--accent-fg);
87 border: var(--border-heavy);
88 border-radius: var(--curve-sm);
89 box-shadow: var(--shadow-md);
90 padding: var(--space-md);
91 width: 100%;
92 box-sizing: border-box;
93 margin: 0 auto;
8394 text-align: center;
8495 p {
8596 margin: 0;
@@ -90,9 +101,14 @@
90101 }
91102 .nope {
92103 font-weight: bold;
93 margin: var(--space-lg) 0;
94 opacity: 0.2;
104 margin: var(--space-lg) 0 var(--space-sm);
95105 font-size: var(--text-xl);
106 opacity: var(--opacity-muted);
107 }
108 .footer {
109 display: flex;
110 justify-content: flex-end;
111 margin-top: var(--space-md);
96112 }
97113 }
98114</style>
web/src/layouts/Layout.astro +17
@@ -253,6 +253,23 @@ const makeSearchLd = () => {
253253 }
254254 }
255255
256 .small-button {
257 display: inline-block;
258 font-family: var(--font-subtitle);
259 font-size: var(--text-sm);
260 font-weight: bold;
261 text-decoration: none;
262 color: var(--accent-fg);
263 background: var(--accent);
264 border: var(--border-light);
265 box-shadow: var(--shadow-sm);
266 padding: var(--space-xs) var(--space-md);
267 transition: var(--transition-normal);
268 &:hover {
269 box-shadow: var(--shadow-sm-hover);
270 }
271 }
272
256273 .accent-heading {
257274 font-size: var(--text-3xl);
258275 margin: calc(var(--space-lg) * -1) 0 var(--space-md)
web/src/pages/[...listing].astro +44 −15
@@ -35,6 +35,7 @@ interface Props extends Service {
3535
3636const {
3737 name,
38 description,
3839 url,
3940 github,
4041 tosdrId,
@@ -156,7 +157,10 @@ const serviceHistory = await fetchChangelog().then(({ entries }) => {
156157 c.name === name &&
157158 c.category === categoryName &&
158159 c.section === parentSection.name;
159 const isHere = (m: { name: string; to: { category: string; section: string } }) =>
160 const isHere = (m: {
161 name: string;
162 to: { category: string; section: string };
163 }) =>
160164 m.name === name &&
161165 m.to.category === categoryName &&
162166 m.to.section === parentSection.name;
@@ -218,6 +222,30 @@ const secSlug = slugify(parentSection.name);
218222const getApiEndpoint = () => {
219223 return `https://api.awesome-privacy.xyz/${catSlug}/${secSlug}/${slugify(name)}`;
220224};
225
226const makeSoftwareSchema = () => {
227 const operatingSystem = [
228 iosApp && 'iOS',
229 androidApp && 'Android',
230 url && 'Web',
231 ].filter(Boolean);
232 const plainDescription = (description || '')
233 .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
234 .replace(/[*_`~]/g, '')
235 .trim();
236 return {
237 '@context': 'https://schema.org',
238 '@type': 'SoftwareApplication',
239 name,
240 description: plainDescription || makeDescriptionTag(),
241 url,
242 applicationCategory: parentSection.name,
243 ...(operatingSystem.length && {
244 operatingSystem: operatingSystem.join(', '),
245 }),
246 ...(github && { codeRepository: `https://github.com/${github}` }),
247 };
248};
221249---
222250
223251<Layout
@@ -225,6 +253,7 @@ const getApiEndpoint = () => {
225253 keywords={makeKeyWordTag()}
226254 description={makeDescriptionTag()}
227255 breadcrumbs={makeBreadcrumbs()}
256 customSchemaJson={makeSoftwareSchema()}
228257>
229258 <main>
230259 <ListingHero
@@ -236,7 +265,7 @@ const getApiEndpoint = () => {
236265 {
237266 privacyData && privacyData.parameters.points.length > 0 && (
238267 <section>
239 <h3>{name} Privacy Policy</h3>
268 <h2>{name} Privacy Policy</h2>
240269 <PrivacyPolicyDetails privacyData={privacyData} />
241270 </section>
242271 )
@@ -244,7 +273,7 @@ const getApiEndpoint = () => {
244273 {
245274 github && githubData && (
246275 <section class="github-wrap">
247 <h3>{name} Source Code</h3>
276 <h2>{name} Source Code</h2>
248277 <GitHubDetailedInfo gitHubData={githubData} repo={github} />
249278 </section>
250279 )
@@ -252,7 +281,7 @@ const getApiEndpoint = () => {
252281 {
253282 websiteData && (
254283 <section>
255 <h3>{name} Website</h3>
284 <h2>{name} Website</h2>
256285 <WebsiteDetailedInfo url={url} websiteInfo={websiteData} />
257286 </section>
258287 )
@@ -260,7 +289,7 @@ const getApiEndpoint = () => {
260289 {
261290 androidData && !androidData.error && (
262291 <section>
263 <h3>{name} Android App</h3>
292 <h2>{name} Android App</h2>
264293 <AndroidAppDetailedInfo androidData={androidData} />
265294 </section>
266295 )
@@ -270,7 +299,7 @@ const getApiEndpoint = () => {
270299 typeof iosData === 'object' &&
271300 Object.keys(iosData).length > 0 && (
272301 <section>
273 <h3>{name} iOS App</h3>
302 <h2>{name} iOS App</h2>
274303 <IosAppDetailedInfo url={url} iosData={iosData} />
275304 </section>
276305 )
@@ -278,7 +307,7 @@ const getApiEndpoint = () => {
278307 {
279308 dockerData && dockerData.found && (
280309 <section>
281 <h3>{name} Docker</h3>
310 <h2>{name} Docker</h2>
282311 <DockerDetailedInfo docker={dockerData} />
283312 </section>
284313 )
@@ -286,7 +315,7 @@ const getApiEndpoint = () => {
286315 {
287316 (discordData || redditData) && (
288317 <section>
289 <h3>{name} Socials</h3>
318 <h2>{name} Socials</h2>
290319 <div class="social-wrap">
291320 {discordData && <DiscordDetailedInfo discordData={discordData} />}
292321 {redditData && <RedditDetailedInfo redditData={redditData} />}
@@ -296,12 +325,12 @@ const getApiEndpoint = () => {
296325 }
297326
298327 <section>
299 <h3>{name} Reviews</h3>
328 <h2>{name} Reviews</h2>
300329 <Comments client:visible />
301330 </section>
302331
303332 <section>
304 <h3>More {parentSection.name}</h3>
333 <h2>More {parentSection.name}</h2>
305334 <ServiceList
306335 services={filterServices()}
307336 subHeading={true}
@@ -312,7 +341,7 @@ const getApiEndpoint = () => {
312341 />
313342 </section>
314343 <section>
315 <h3>About the Data: {name}</h3>
344 <h2>About the Data: {name}</h2>
316345 <DataActions
317346 client:load
318347 categoryName={categoryName}
@@ -320,7 +349,7 @@ const getApiEndpoint = () => {
320349 serviceName={name}
321350 history={serviceHistory}
322351 />
323 <h4>API</h4>
352 <h3>API</h3>
324353 <p>
325354 You can access {name}'s data programmatically via our API. Simply make a <code
326355 >GET</code
@@ -335,7 +364,7 @@ const getApiEndpoint = () => {
335364 </section>
336365
337366 <section>
338 <h3>Share {name}</h3>
367 <h2>Share {name}</h2>
339368 <p>
340369 Help your friends compare {parentSection.name}, and pick
341370 privacy-respecting software and services.<br />
@@ -406,7 +435,7 @@ const getApiEndpoint = () => {
406435 margin: var(--space-xs) 0 var(--space-sm) 0;
407436 }
408437
409 h3 {
438 h2 {
410439 font-size: var(--text-3xl);
411440 margin: -2rem 0 var(--space-md) -2rem;
412441 box-shadow: var(--shadow-lg);
@@ -419,7 +448,7 @@ const getApiEndpoint = () => {
419448 }
420449 }
421450
422 h4 {
451 h3 {
423452 font-size: var(--text-lg);
424453 margin-bottom: 0;
425454 }
web/src/pages/about.astro +14 −4
@@ -101,12 +101,22 @@ const licenseContent = async () => {
101101 We welcome suggestions, additions, edits and removals to the list.<br />
102102 It's thanks to contributors like you that this project is possible 💜
103103 <br /><br />
104 To get started, head over to our <a
105 href="https://github.com/lissy93/awesome-privacy">GitHub repository</a
106 >. From here, you'll be able to edit <a href="#"
107 ><code>awesome-privacy.yml</code></a
104 To get started, head over to our
105 <a href="https://github.com/lissy93/awesome-privacy"
106 >GitHub repository</a
107 >. From here, you'll be able to edit
108 <a
109 href="https://github.com/Lissy93/awesome-privacy/blob/main/awesome-privacy.yml"
108110 >
111 <code>awesome-privacy.yml</code>
112 </a>
109113 where all data is stored, and then submit your changes as a pull request.
114 Just be sure to read and follow the
115 <a
116 href="https://github.com/Lissy93/awesome-privacy?tab=contributing-ov-file"
117 >
118 Contributing Guidelines
119 </a> before submitting your pull request.
110120 <br /><br />
111121 If you're new to open source, you can find some resources to get you started
112122 at <a href="https://git-in.to">git-in.to</a>, but feel free to reach out
web/src/pages/index.astro +18 −16
@@ -4,9 +4,9 @@ import Hero from '@components/Hero.astro';
44import Search from '@components/things/Search.svelte';
55import SectionList from '@components/things/SectionList.astro';
66import SavedServices from '@components/things/SavedServices.svelte';
7import LatestUpdates from '@components/things/LatestUpdates.astro';
78
89import { fetchData } from '@utils/fetch-data';
9import Button from '@components/form/Button.astro';
1010import type { Category } from 'src/types/Service';
1111
1212const categories = (await fetchData())?.categories || ([] as Category[]);
@@ -37,11 +37,13 @@ const description =
3737 ))
3838 }
3939 </ul>
40 <div class="view-all">
41 <span>Or, just</span>
42 <Button url="/all" text="View Everything" />
40 <div class="categories-footer">
41 <a class="small-button" href="/all">View everything &rarr;</a>
4342 </div>
4443
44 <h2><a href="/changelog">Latest Updates</a></h2>
45 <LatestUpdates categories={categories} />
46
4547 <h2><a href="/inventory">Saved Items</a></h2>
4648 <SavedServices allData={categories} client:load />
4749
@@ -72,10 +74,9 @@ const description =
7274 href="https://github.com/sponsors/lissy93">sponsoring me</a
7375 > on GitHub.
7476 </p>
75 </div>
76 <div class="view-all">
77 <span>Want to learn more?</span>
78 <Button url="/about" text="Keep Reading..." />
77 <div class="about-footer">
78 <a class="small-button" href="/about">Keep reading &rarr;</a>
79 </div>
7980 </div>
8081 </main>
8182</Layout>
@@ -92,14 +93,10 @@ const description =
9293 @media (max-width: 768px) {
9394 padding: 0;
9495 }
95 .view-all {
96 text-align: center;
97 width: 16rem;
98 margin: 0 auto;
99 span {
100 opacity: var(--opacity-dim);
101 font-size: var(--text-base);
102 }
96 .categories-footer {
97 display: flex;
98 justify-content: flex-end;
99 margin: var(--space-md) 0;
103100 }
104101 }
105102 .action-card {
@@ -177,6 +174,11 @@ const description =
177174 width: 100%;
178175 box-sizing: border-box;
179176 margin: 0 auto;
177 .about-footer {
178 display: flex;
179 justify-content: flex-end;
180 margin-top: var(--space-md);
181 }
180182 }
181183
182184 .categories {
web/src/pages/search/[...searchTerm].astro +1 −2
@@ -130,8 +130,7 @@ const beer = putResultsIntoGroups();
130130
131131 .result-count {
132132 padding: 0;
133 width: 80vw;
134 max-width: 900px;
133 width: calc(100% - 2rem);
135134 margin: var(--space-md) auto 0 auto;
136135 h3 {
137136 margin: 0;
web/src/styles/values.css +3 −3
@@ -105,8 +105,8 @@ html {
105105 --background-hr-color: #ececec;
106106
107107 --changelog-rem: #b59207;
108 --changelog-rej: #d71e41;
109 --changelog-mod: #2e89b5;
110 --changelog-add: #509762;
108 --changelog-rej: #d71e41;
109 --changelog-mod: #2e89b5;
110 --changelog-add: #509762;
111111 }
112112}
web/src/utils/fetch-changelog.ts +1 −1
@@ -2,7 +2,7 @@ import { error } from './logger';
22
33const changelogUrl =
44 // 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/.github/changelog.json';
5'https://gist.githubusercontent.com/Lissy93/ddae176f3f21a0d3c0251f5f6cbd3b09/raw/5fb0fe42a54a9395a988f7875e88a484769ea6dd/changelog.json';
5 'https://gist.githubusercontent.com/Lissy93/ddae176f3f21a0d3c0251f5f6cbd3b09/raw/9e62d21ea8866709520331dd2ec6a67494460707/changelog.json';
66
77export interface ChangelogPr {
88 number: number;