Commit 5a0550066c

5a0550066c0bc674865d15928701bd378e9c6363

parent: c724a8393c

Unsigned

Alicia Sykes <alicia@omg.lol> · 2024-03-09 15:28 UTC

Improved user experience, and updates SEO tags

Layout: unified · split

web/src/components/form/FontAwesome.svelte +15
@@ -55,6 +55,21 @@
5555 social: solidIcons.faShareNodes,
5656 media: solidIcons.faPhotoFilmMusic,
5757 creativity: solidIcons.faPaintbrushPencil,
58
59 // Social Media Share Icons
60 mastodon: brands.faMastodon,
61 twitter: brands.faXTwitter,
62 reddit: brands.faReddit,
63 linkedin: brands.faLinkedin,
64 pinterest: brands.faPinterest,
65 telegram: brands.faTelegram,
66 whatsapp: brands.faWhatsapp,
67 signal: brands.faSignalMessenger,
68 pocket: brands.faGetPocket,
69
70 email: solidIcons.faEnvelope,
71 copy: solidIcons.faCopy,
72 print: solidIcons.faPrint,
5873 };
5974
6075 export let iconName: string;
web/src/components/things/DataActions.svelte +1 −1
@@ -54,7 +54,7 @@
5454 title="awesome-privacy.yml"
5555 src={getIframeSrc()}></iframe>
5656
57<h4>Edit/Delete Request</h4>
57<h4>Modify Data</h4>
5858<div class="button-wrap">
5959 <a class="button-link" target="_blank"
6060 href={makeRemovalRequest(categoryName, sectionName, serviceName, yamlContent)}>
web/src/pages/[...listing].astro +38 −12
@@ -7,6 +7,7 @@ import GitHubDetailedInfo from '@components/things/GitHubDetailedInfo.astro';
77import PrivacyPolicyDetails from '@components/things/PrivacyPolicyDetails.astro';
88import WebsiteDetailedInfo from '@components/things/WebsiteDetailedInfo.astro';
99import DockerDetailedInfo from '@components/things/DockerDetailedInfo.astro';
10import SocialShare from '@components/form/Social.astro';
1011import DataActions from '@components/things/DataActions.svelte';
1112import type { AwesomePrivacy, Section, Service } from '../types/Service';
1213import { fetchData, slugify } from '@utils/fetch-data';
@@ -15,6 +16,7 @@ import { fetchTosdrPrivacy } from '@utils/fetch-privacy-policy';
1516import { fetchWebsiteInfo } from '@utils/fetch-website-info';
1617import { fetchDockerData } from '@utils/fetch-docker-instructions';
1718import { parseMarkdown, formatLink } from '@utils/parse-markdown';
19import { site } from '@utils/config';
1820import FontAwesome from '@components/form/FontAwesome.svelte';
1921import Button from '@components/form/Button.astro';
2022
@@ -45,18 +47,20 @@ const {
4547 */
4648const makeKeyWordTag = () => {
4749 const keywords: string[] = [];
48 keywords.push(`free and open source ${parentSection.name} software`);
49 keywords.push(`private ${parentSection.name} comparison`);
50 keywords.push(`open source ${parentSection.name}`);
51 keywords.push(`${parentSection.name} comparison`);
5052 (parentSection.alternativeTo || []).forEach((alt: string) => {
51 keywords.push(`privacy-respecting ${alt} alternative`);
52 keywords.push(`free open source ${alt} alternative`);
53 keywords.push(`${alt} alternative`);
5354 });
5455 (parentSection.services || []).forEach((serv: Service) => {
55 keywords.push(serv.name);
56 keywords.push(`${serv.name} vs`);
5657 });
58 keywords.push('private');
5759 keywords.push('ad free');
60 keywords.push('encrypted');
5861 keywords.push('open source software');
5962 keywords.push('privacy respecting apps');
63 keywords.push('free tools');
6064 return keywords.join(', ');
6165};
6266
@@ -71,10 +75,16 @@ const makePageTitle = () => {
7175 * Make a string page intro, for the description tag
7276 */
7377const makeDescriptionTag = () => {
74 return `Compare ${name} and other ${parentSection.name} at Awesome Privacy\n`
75 + description
76 + '\nAll this, and much more at Awesome Privacy, '
77 + 'the free and open source list of private software alternatives.';
78 let description = `Analysis of ${name}, and other privacy-respecting ${parentSection.name} `;
79 if (parentSection.services) {
80 const serviceList = parentSection.services.map((serv: Service) => serv.name);
81 description += `Compare ${serviceList.join(' vs ')} more apps. `
82 }
83 if (parentSection.alternativeTo && parentSection.alternativeTo.length > 0) {
84 description += `The best secure encrypted alternatives to ${parentSection.alternativeTo.join(', ')} in 2024. `;
85 }
86 description += 'All this, and many more free and awesome tools and software.'
87 return description;
7888};
7989
8090// Return a list of Services, except for the currtent one
@@ -127,8 +137,6 @@ const privacyData = tosdrId ? await fetchTosdrPrivacy(tosdrId) : null;
127137const dockerData = await fetchDockerData(name);
128138const websiteData = (url && !ignoredSites.some(ignoredSite => url.includes(ignoredSite))) ? await fetchWebsiteInfo(url) : null;
129139
130console.log(dockerData);
131
132140const getApiEndpoint = () => {
133141 return `https://api.awesome-privacy.xyz/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)}`;
134142}
@@ -276,7 +284,7 @@ const getApiEndpoint = () => {
276284 <pre><a href={getApiEndpoint()}><code>{getApiEndpoint()}</code></a></pre>
277285 <p>
278286 The REST API is free, no-auth and CORS-enabled.
279 To learn more, view the <a href="/api/docs">Swagger Docs</a> or read the <a href="/about#our-api">API Usage Guide</a>.
287 To learn more, view the <a href="/api">Swagger Docs</a> or read the <a href="/about#api">API Usage Guide</a>.
280288 </p>
281289
282290 <h4>About the Data</h4>
@@ -289,6 +297,24 @@ const getApiEndpoint = () => {
289297 </p>
290298 </section>
291299
300 <section>
301 <h3>Share {name}</h3>
302 <p>
303 Help your friends compare {parentSection.name}, and pick privacy-respecting software and services.<br />
304 Share {name} and Awesome Privacy with your network!
305 <div>
306 <SocialShare
307 url={`${site}/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(name)} `}
308 title={`Checkout ${name}! \n`}
309 description={
310 `Compare #${name} and other privacy-respecting ${parentSection.name} at `
311 + `Awesome-Privacy.xyz, the free and open source list of private software alternatives. `
312 + `#privacy #opensource #awesomeprivacy by @Lissy_Sykes`}
313 />
314 </div>
315 </p>
316 </section>
317
292318 <div class="pagination-navigation">
293319 { previous ? (
294320 <Button url={`/${slugify(categoryName)}/${slugify(parentSection.name)}/${slugify(previous)}`}>
web/src/pages/[...section].astro +34 −5
@@ -58,15 +58,17 @@ const makePageTitle = () => {
5858 * Make a string page intro, for the description tag
5959 */
6060const makeDescriptionTag = () => {
61 let description = `A list of privacy respecting ${title}. `;
61 let description = `Privacy respecting ${title}. `;
6262 if (services && services.length > 0) {
6363 const serviceList = services.map((serv: Service) => serv.name);
64 description += `Compare ${serviceList.join(', ')} and more private apps and services. `
64 description += `Compare ${serviceList.join(' vs ')} and more private, open source apps and services now. `
6565 } else {
6666 description += `Find private apps and services. This section is still a work in progress. `;
6767 }
68 description += 'All this, and much more at Awesome Privacy, '
69 description += 'the free and open source list of private software alternatives.';
68 if (alternativeTo && alternativeTo.length > 0) {
69 description += `The best secure encrypted alternatives to ${alternativeTo.join(', ')} in 2024. `;
70 }
71 description += 'All this, and many more free and awesome tools and software.'
7072 return description;
7173};
7274
@@ -118,9 +120,28 @@ const { previous, next } = makePaginationLinks();
118120 <p set:html={parseMarkdown(intro)}></p>
119121 </section>
120122 )}
121
123
122124 <ServiceList services={services} sectionName={title} categoryName={categoryName} />
123125
126 <details class="about-this-page">
127 <summary>Objective of this page</summary>
128 <p>
129 Find the best free, open source, E2E encrypted and private alternative to
130 {(alternativeTo || []).map((alt) => (<span>{alt}, </span>))} now.
131 </p>
132 <p>
133 Compare {(services || []).map((serv) => (<span>{serv.name} vs </span>))}
134 </p>
135 <p>
136 Discover the best {title} tools for Android, iPhone, Linux, PC and Chrome to download now.
137 And choose secure, self-hosted, peer-to-peer and independant alternatives in 2024
138 </p>
139 <p>
140 <b>Stop the invasion of privacy from big tech, improve data security stay safe.</b>
141 </p>
142 </details>
143
144
124145 {notableMentions && (
125146 <section class="notable-mentions">
126147 <h3>Notable Mentions</h3>
@@ -273,5 +294,13 @@ h2 {
273294 }
274295 }
275296}
297.about-this-page {
298 summary {
299 display: none;
300 }
301 font-size: 0.9rem;
302 opacity: 0.7;
303}
304
276305
277306</style>
web/src/pages/about.astro +33 −5
@@ -3,6 +3,7 @@
33import Layout from '@layouts/Layout.astro';
44import Main from '@components/scafold/MainCard.astro';
55import Icon from '@components/form/Icon.astro';
6import SocialShare from '@components/form/Social.astro';
67import { parseMarkdown } from '@utils/parse-markdown';
78
89const contributorsResource = async () => {
@@ -62,9 +63,9 @@ We also have a free, no-auth, CORS-enabled RESR API,
6263which you can use to access Awesome Privacy's data programmatically,
6364or to build your own apps on top of it.
6465
65The [Swagger Spec](#) outlines all endpoints, usage and examples.
66The [Swagger Spec](api) outlines all endpoints, usage and examples.
6667
67The host is: \`https://api.awesome-privacy.xyz\`
68Use our public instance, at: \`https://api.awesome-privacy.xyz\` or [self-host your own](https://github.com/Lissy93/awesome-privacy/tree/main/api)
6869`;
6970
7071const projectRequrements = `
@@ -160,26 +161,31 @@ export const socials = [
160161 title: 'GitHub',
161162 icon: 'hub',
162163 link: 'https://github.com/lissy93',
164 color: '#EA4AAA',
163165 },
164166 {
165167 title: 'Twitter',
166168 icon: 'twitter',
167169 link: 'https://x.com/lissy_sykes',
170 color: '#1D9BF0',
168171 },
169172 {
170173 title: 'Mastodon',
171174 icon: 'mastodon',
172175 link: 'https://mastodon.social/@lissy93',
176 color: '#6364FF',
173177 },
174178 {
175179 title: 'Dev',
176180 icon: 'dev',
177181 link: 'https://dev.to/lissy93',
182 color: '#cece04',
178183 },
179184 {
180185 title: 'LinkedIn',
181186 icon: 'linkedin',
182187 link: 'https://linkedin.com/in/aliciasykes',
188 color: '#0A66C2',
183189 },
184190];
185191
@@ -228,7 +234,7 @@ const description = 'Privacy is a fundamental human right; '
228234 <br /><br />
229235 To get started, head over to our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a>.
230236 From here, you'll be able to edit <a href="#"><code>awesome-privacy.yml</code></a>
231 where all data is stored, and then submit your changes as a pull request.<br />
237 where all data is stored, and then submit your changes as a pull request.
232238 <br /><br />
233239 If you're new to open source, you can find some resources to get you started
234240 at <a href="https://git-in.to">git-in.to</a>, but feel free to reach out if you need any help 😊
@@ -267,6 +273,22 @@ const description = 'Privacy is a fundamental human right; '
267273
268274 <hr />
269275
276 <h2 id="support-us">Help us out</h2>
277 <p>
278 Awesome Privacy is a free, open source and community-maintained resource.<br />
279 There's a few ways you can support us:
280 <ul class="help-list">
281 <li>Visiting, forking, or starring or our <a href="https://github.com/lissy93/awesome-privacy">GitHub repository</a></li>
282 <li>Help us keep our info up-to-date, but submitting an addition, removal or ammendment</li>
283 <li>Leave feedback on services that you've used, to help others make a more informed decission</li>
284 <li>Consider <a href="https://github.com/sponsors/Lissy93">sponsoring us on GitHub</a>, if you're able 💖</li>
285 <li>Share Awesome Privacy with your network</li>
286 </ul>
287 <SocialShare />
288 </p>
289
290 <hr />
291
270292 <h2 id="author">Author</h2>
271293 <article class="author">
272294 <p>
@@ -287,7 +309,7 @@ const description = 'Privacy is a fundamental human right; '
287309 <div class="socials">
288310 {
289311 socials.map((social) => (
290 <a href={social.link}>
312 <a href={social.link} style={`--color: ${social.color}`} target="_blank">
291313 <Icon icon={social.icon} width={24} height={24} />
292314 </a>
293315 ))
@@ -437,6 +459,12 @@ h3 {
437459 white-space: pre-line;
438460}
439461
462.help-list {
463 padding-left: 1rem;
464 list-style: circle;
465 font-size: 1.1rem;
466}
467
440468.author {
441469 p {
442470 margin: 1rem 0 0 0;
@@ -479,7 +507,7 @@ h3 {
479507 color: var(--foreground);
480508 transition: color 0.2s ease-in-out;
481509 &:hover {
482 color: var(--accent);
510 color: var(--color);
483511 }
484512 }
485513 }
web/src/pages/browse.astro +10 −1
@@ -19,6 +19,7 @@ const categories: Category[] = (await fetchData())?.categories;
1919 <p id="press-enter-msg" class="press-enter">Press enter for deep search</p>
2020 </span>
2121</div>
22<p class="sitemap-link">Or, <a href="/sitemap">view all pages</a></p>
2223
2324<ul class="categories">
2425 {categories.map((category) => (
@@ -110,7 +111,7 @@ if (typeof window !== 'undefined') {
110111<style lang="scss">
111112
112113.head-wrap {
113 margin: 1rem auto;
114 margin: 1rem auto 0 auto;
114115 width: 85vw;
115116 display: flex;
116117 align-items: center;
@@ -142,6 +143,14 @@ if (typeof window !== 'undefined') {
142143 }
143144}
144145
146.sitemap-link {
147 margin: 0 auto;
148 width: 85vw;
149 a {
150 color: var(--accent-3);
151 }
152}
153
145154.no-results {
146155 text-align: center;
147156 width: 85vw;
web/src/pages/sitemap.astro +89 −7
@@ -16,10 +16,20 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
1616 Below is a full listing of all pages on this site.<br>
1717 <small>As reflected in our <a href="/sitemap-index.xml">sitemap.xml</a></small>
1818 </p>
19 <span class="search-controlls">
20 <input id="searchInput" type="search" placeholder="Start typing to filter..." />
21 <p id="press-enter-msg" class="press-enter">Press enter for deep search</p>
22 </span>
1923 <ul>
2024 <li>
2125 <a href="/">Home</a>
2226 </li>
27 <li>
28 <a href="/edit">Edit</a>
29 </li>
30 <li>
31 <a href="/api">API</a>
32 </li>
2333 <li>
2434 <a href="/search">Search</a>
2535 </li>
@@ -73,11 +83,48 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
7383 <a href="/map">Sitemap</a>
7484 </li>
7585 </ul>
76
7786 </main>
7887
7988</Layout>
8089
90<script>
91 document.addEventListener('DOMContentLoaded', () => {
92 // Select elements for events (search field, each result, and message str)
93 const filterInput = document.querySelector<HTMLInputElement>('input');
94 const pages = document.querySelectorAll<HTMLElement>('li');
95 const pressEnterMsg = document.getElementById('press-enter-msg');
96 if (!pressEnterMsg) throw new Error('pressEnterMsg element not found');
97
98 // Instant search/filter functionality
99 filterInput?.addEventListener('input', (e: Event) => {
100 const filter = (e.target as HTMLInputElement).value.toLowerCase();
101 pressEnterMsg.style.visibility = filter.length > 0 ? 'visible' : 'hidden';
102 Array.from(pages).reduce((count, page) => {
103 const match = page.textContent?.toLowerCase().includes(filter) || false;
104 page.style.display = match ? 'block' : 'none';
105 return count + (match ? 1 : 0);
106 }, 0);
107 });
108 // Handle keypress events, so Esc clears search, and Entr runs deep search
109 document.addEventListener('keydown', (event: KeyboardEvent) => {
110 if (!filterInput) return;
111 switch (event.key) {
112 case 'Enter':
113 event.preventDefault();
114 const searchTerm = encodeURIComponent(filterInput.value);
115 window.location.href = `/search/${searchTerm}`;
116 break;
117 case 'Escape':
118 filterInput.value = '';
119 filterInput.blur();
120 pressEnterMsg.style.visibility = 'hidden';
121 pages.forEach(page => page.style.display = 'block');
122 break;
123 }
124 });
125 });
126</script>
127
81128<style lang="scss">
82129
83130main {
@@ -89,6 +136,7 @@ main {
89136 border: 2px solid var(--foreground);
90137 box-shadow: 6px 6px 0 var(--foreground);
91138 background: var(--accent-fg);
139 position: relative;
92140 p {
93141 font-size: 1.3rem;
94142 margin: 0;
@@ -135,12 +183,46 @@ h2 {
135183 margin: 0;
136184 gap: 1rem;
137185 font-size: 2rem;
138 margin: -2rem 0 2rem -4rem;
139 box-shadow: 6px 6px 0 var(--foreground);
140 background: var(--accent);
141 color: var(--accent-fg);
142 width: fit-content;
143 padding: 0.25rem 0.5rem;
186 margin: -2rem 0 2rem -4rem;
187 box-shadow: 6px 6px 0 var(--foreground);
188 background: var(--accent);
189 color: var(--accent-fg);
190 width: fit-content;
191 padding: 0.25rem 0.5rem;
192 @media (max-width: 768px) {
193 margin: -2rem auto 1rem auto;
194 }
195}
196
197.search-controlls {
198 float: right;
199 top: 1rem;
200 right: 1rem;
201 position: absolute;
202 @media (max-width: 768px) {
203 position: relative;
204 float: none;
205 top: 0;
206 right: 0;
207 }
208 .press-enter {
209 margin: 0.5rem 0 0 0;
210 opacity: 0.5;
211 visibility: hidden;
212 font-size: 1rem;
213 }
214 input {
215 padding: 0.25rem;
216 border: 2px solid var(--foreground);
217 border-radius: var(--curve-sm);
218 font-size: 1rem;
219 box-shadow: 3px 3px 0 var(--foreground);
220 color: var(--accent-3);
221 &:focus {
222 outline: none;
223 box-shadow: 4px 4px 0 var(--foreground);
224 }
225 }
144226}
145227
146228
web/src/utils/config.ts added +11
@@ -0,0 +1,11 @@
1
2function cleanUrl(inputString: string) {
3 return inputString.replace(/['";]+/g, '').trim();
4}
5
6
7export const site = cleanUrl(import.meta.env.SITE_URL || 'https://awesome-privacy.xyz');
8
9export const title = 'Awesome Privacy | Compare privacy-respecting alternatives to popular software & services';
10
11export const description = 'Your guide to escaping big tech, protecting your privacy, and reclaiming your digital life.';