Commit 3a7427b00f

3a7427b00febd63e420bcdd3712beb549a8cb624

parent: 5181632fde

Unsigned

Alicia Sykes <alicia@omg.lol> · 2024-02-22 10:53 UTC

Loads of updates

Layout: unified · split

web/src/components/form/FontAwesome.svelte +3
@@ -6,6 +6,9 @@
66
77
88 export const iconMap: Record<string, IconDefinition> = {
9 // Branding
10 logo: solidIcons.faEyeSlash,
11
912 // GitHub Stat Icons
1013 github: brands.faGithubAlt,
1114 stars: solidIcons.faStar,
web/src/components/scafold/NavBar.astro +22 −2
@@ -1,8 +1,13 @@
11---
2import FontAwesome from "@components/form/FontAwesome.svelte"
3
24---
35
46<div class="nav">
5 <a href="/"><h1>Awesome Privacy</h1></a>
7 <a href="/" class="homepage">
8 <FontAwesome iconName="logo" />
9 <h1>Awesome Privacy</h1>
10 </a>
611 <nav>
712 <a href="/browse">Browse</a>
813 <a href="/search">Search</a>
@@ -20,8 +25,11 @@
2025 gap: 1rem;
2126 border-bottom: 2px solid var(--foreground);
2227
23 a {
28 .homepage {
2429 text-decoration: none;
30 display: flex;
31 align-items: center;
32 padding: 0 0.5rem;
2533 h1 {
2634 margin: 0;
2735 font-size: 2.4rem;
@@ -29,6 +37,18 @@
2937 color: var(--foreground);
3038 font-family: "Lekton", sans-serif;
3139 }
40 :global(svg) {
41 width: 2.5rem;
42 height: 2.5rem;
43 color: var(--accent-3);
44 transition: all 0.2s ease-in-out;
45 }
46 &:hover {
47 :global(svg) {
48 color: var(--accent);
49 transform: scale(1.05);
50 }
51 }
3252 }
3353
3454 nav {
web/src/layouts/Layout.astro +44 −6
@@ -4,23 +4,61 @@ import NavBar from '@components/scafold/NavBar.astro';
44import Footer from '@components/scafold/Footer.astro';
55
66interface Props {
7 title: string;
8 hideNav?: boolean;
7 title?: string; // Page title
8 description?: string; // Overide description tag
9 keywords?: string; // Overide keywords tag
10 hideNav?: boolean; // Don't show the navbar (just homepage)
11 author?: string; // Author of the content
912}
1013
11const { title, hideNav } = Astro.props;
14const {
15 title='Awesome Privacy | The Ultimate List of Private Apps',
16 description='Your guide to finding privacy-respecting alternatives to popular software and services.',
17 keywords='security, privacy, awesome privacy, data collection, free software, open source, privacy tools, privacy respecting software',
18 hideNav=false,
19 author='Alicia Sykes'
20} = Astro.props;
1221
1322---
1423
1524<!doctype html>
1625<html lang="en">
1726 <head>
27 <!-- Core info -->
28 <title>{title}</title>
29 <meta name="description" content={description}>
30 <meta name="keywords" content={keywords}>
31 <meta name="author" content={author}>
32
33 <!-- Page info, viewport, Astro credit -->
1834 <meta charset="UTF-8" />
19 <meta name="description" content="Astro description" />
35 <meta name="viewport" content="width=device-width, initial-scale=1.0">
2036 <meta name="viewport" content="width=device-width" />
21 <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
2237 <meta name="generator" content={Astro.generator} />
23 <title>{title}</title>
38
39 <!-- Icons and colors -->
40 <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
41 <link rel="icon" type="image/png" sizes="64x64" href="/favicon.png">
42 <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
43
44 <!-- Social media meta tags (Open Graphh + Twitter) -->
45 <meta property="og:type" content="website">
46 <meta property="og:url" content="https://awesome-privacy.xyz">
47 <meta property="og:title" content={title}>
48 <meta property="og:description" content={description}>
49 <meta property="og:image" content="/banner.png">
50 <meta name="twitter:card" content="summary_large_image">
51 <meta name="twitter:url" content="https://awesome-privacy.xyz">
52 <meta name="twitter:title" content={title}>
53 <meta name="twitter:description" content={description}>
54 <meta name="twitter:image" content="/banner.png">
55
56 <!-- Non-tracking hit counter -->
57 <script defer
58 type="text/partytown"
59 data-domain="awesome-privacy.xyz"
60 src="https://no-track.as93.net/js/script.js">
61 </script>
2462 </head>
2563 <body>
2664 {!hideNav && <NavBar /> }
web/src/pages/[...section].astro +52 −7
@@ -17,11 +17,58 @@ interface Props {
1717 notableMentions?: ShortService[] | string,
1818 furtherInfo?: string,
1919 wordOfWarning?: string,
20 alternativeTo?: string[];
2021 categoryName: string,
2122 otherSections: Section[],
2223}
2324
24const { slug, title, otherSections, services, notableMentions, furtherInfo, wordOfWarning, categoryName, intro } = Astro.props;
25const {
26 title, otherSections, services, notableMentions, furtherInfo, wordOfWarning,
27 alternativeTo, categoryName, intro,
28} = Astro.props;
29
30/**
31 * Make a list of keywords, for the <meta keywords> tag
32 */
33const makeKeyWordTag = () => {
34 const keywords = [];
35 keywords.push(`free and open source ${title} software`);
36 keywords.push(`private ${title} comparison`);
37 alternativeTo?.forEach((alt: string) => {
38 keywords.push(`privacy-respecting ${alt} alternative`);
39 keywords.push(`free open source ${alt} alternative`);
40 });
41 services.forEach((serv: Service) => {
42 keywords.push(serv.name);
43 });
44 keywords.push('ad free');
45 keywords.push('open source software');
46 keywords.push('privacy respecting apps');
47 return keywords.join(', ');
48};
49
50/**
51 * Make a page title
52 */
53const makePageTitle = () => {
54 return `${title} | Awesome Privacy`;
55};
56
57/**
58 * Make a string page intro, for the description tag
59 */
60const makeDescriptionTag = () => {
61 let description = `A list of privacy respecting ${title}. `;
62 if (services.length > 0) {
63 const serviceList = services.map((serv: Service) => serv.name);
64 description += `Compare ${serviceList.join(', ')} and more private apps and services. `
65 } else {
66 description += `Find private apps and services. This section is still a work in progress. `;
67 }
68 description += 'All this, and much more at Awesome Privacy, '
69 description += 'the free and open source list of private software alternatives.';
70 return description;
71};
2572
2673export async function getStaticPaths() {
2774
@@ -37,6 +84,7 @@ const pages = await fetchData().then((data) => {
3784 notableMentions: section.notableMentions,
3885 furtherInfo: section.furtherInfo,
3986 wordOfWarning: section.wordOfWarning,
87 alternativeTo: section.alternativeTo,
4088 categoryName: category.name,
4189 otherSections: category.sections,
4290 }));
@@ -45,11 +93,8 @@ const pages = await fetchData().then((data) => {
4593 return results;
4694});
4795
48return pages.map(({ slug, title, otherSections, services, notableMentions, furtherInfo, wordOfWarning, categoryName, intro }) => {
49 return {
50 params: { section: slug },
51 props: { title, otherSections, services, notableMentions, furtherInfo, wordOfWarning, categoryName, intro },
52 };
96return pages.map((props: Props) => {
97 return {params: { section: props.slug }, props };
5398});
5499}
55100
@@ -64,7 +109,7 @@ const { previous, next } = makePaginationLinks();
64109
65110---
66111
67<Layout title="Awesome Privacy">
112<Layout title={makePageTitle()} keywords={makeKeyWordTag()} description={makeDescriptionTag()} >
68113 <Main>
69114
70115 <h2>{title}</h2>
web/src/pages/[category].astro +1 −1
@@ -37,7 +37,7 @@ export async function getStaticPaths() {
3737
3838---
3939
40<Layout title="Awesome Privacy">
40<Layout title={`${title} | Awesome Privacy`}>
4141 <Main>
4242 <SectionList title={title} sections={sections} bigTitle={true} />
4343 </Main>
web/src/pages/about.astro +7 −2
@@ -101,10 +101,15 @@ export const socials = [
101101 },
102102];
103103
104const description = 'Privacy is a fundamental human right; '
105 + 'without it, we\'re just open books in a world where everyone\'s '
106 + 'watching. Let\'s take control back.\n'
107 + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.'
108 + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
104109
105110---
106111
107<Layout title="Awesome Privacy">
112<Layout title="About | Awesome Privacy" description={description}>
108113 <div class="about-page">
109114 <Main>
110115 <h2>Objective</h2>
@@ -307,7 +312,7 @@ h3 {
307312 font-weight: 300;
308313 color: var(--accent-3);
309314 text-align: center;
310 max-width: 500px;
315 max-width: 550px;
311316 margin: 0 auto;
312317 }
313318 small {
web/src/pages/browse.astro +1
@@ -6,6 +6,7 @@ import SectionList from '@components/things/SectionList.astro';
66import { fetchData } from '@utils/fetch-data';
77
88const categories = (await fetchData())?.categories;
9
910---
1011
1112<Layout title="Browse">
web/src/pages/category/index.astro deleted −67
@@ -1,67 +0,0 @@
1---
2
3import yaml from 'js-yaml';
4
5import Layout from '@layouts/Layout.astro';
6import Card from '@components/Card.astro';
7import Hero from '@components/Hero.astro';
8import { AwesomePrivacy, Section, Service } from '../../types/Service';
9
10
11export async function getStaticPaths() {
12
13const fetchData = async (): Promise<AwesomePrivacy> => {
14 return await fetch('http://localhost:4321/awesome-privacy.yml')
15 .then((res) => res.text())
16 .then((data) => yaml.load(data))
17 .catch((err) => console.error(err));
18};
19
20
21const slugify = (title: string) => {
22 return title.toLowerCase().replace(/\s/g, '-');
23};
24
25
26const pages = await fetchData().then((data) => {
27
28 const results: { slug: string, title: string, otherSections: Section[], services: Service[] }[] = [];
29 data.categories.forEach((service) => {
30 const sections = service.sections.map((section) => ({
31 slug: `${slugify(service.name)}/${slugify(section.name)}`,
32 title: section.name,
33 services: section.services,
34 otherSections: service.sections,
35 }));
36 results.push(...sections);
37 });
38 return results;
39});
40
41return pages.map(({ slug, title, otherSections, services }) => {
42 return {
43 params: { slug },
44 props: { title, otherSections, services },
45 };
46});
47
48}
49
50---
51
52<Layout title="Awesome Privacy">
53
54
55</Layout>
56
57<style lang="scss">
58 main {
59 margin: auto;
60 padding: 1rem;
61 width: 1000px;
62 max-width: calc(100% - 2rem);
63 color: white;
64 font-size: 20px;
65 line-height: 1.6;
66 }
67</style>
web/src/pages/index.astro +12 −1
@@ -11,9 +11,16 @@ import Button from '@components/form/Button.astro';
1111
1212const categories = (await fetchData())?.categories || [];
1313
14const description = 'Privacy is a fundamental human right; '
15 + 'without it, we\'re just open books in a world where everyone\'s '
16 + 'watching. Let\'s take control back.\n'
17 + 'Migrating open-source applications which do not collect, sell or log your data is a great first step.'
18 + 'Awesome Privacy is a directory of alternative privacy-respecting software and services.';
19
20
1421---
1522
16<Layout title="Awesome Privacy" hideNav={true}>
23<Layout title="Home | Awesome Privacy" hideNav={true} description={description}>
1724 <Hero />
1825 <main>
1926 <h2>
@@ -40,6 +47,10 @@ const categories = (await fetchData())?.categories || [];
4047 Awesome Privacy is a collection of privacy-respecting services and tools.
4148 The aim is to help you escape big tech, and choose software that respects your privacy.
4249 </p>
50 <p>
51 Why? Because privacy is a fundamental human right; without it, we're just open books
52 in a world where everyone's watching. Let's take control back.
53 </p>
4354 <p>
4455 Noticed something that should be added / removed / ammended?
4556 We're a community-driven resource, so welcome contributions of any nature.
web/src/styles/typography.css +56 −1
@@ -1,4 +1,59 @@
1@import url('https://fonts.googleapis.com/css2?family=Lekton:ital,wght@0,400;0,700;1,400&family=Libre+Franklin:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
1/* Fallback to Google Fonts for specific weights and styles */
2@import url('https://fonts.googleapis.com/css2?family=Lekton:wght@700&family=Libre+Franklin:wght@800&family=Rubik:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&display=swap');
3
4/* Rubik Font Faces */
5@font-face {
6 font-family: 'Rubik';
7 font-style: normal;
8 font-weight: 400;
9 src: local('Rubik'), url('/fonts/Rubik/Rubik-Regular.ttf') format('truetype');
10}
11@font-face {
12 font-family: 'Rubik';
13 font-style: italic;
14 font-weight: 400;
15 src: local('Rubik Italic'), url('/fonts/Rubik/Rubik-Italic.ttf') format('truetype');
16}
17@font-face {
18 font-family: 'Rubik';
19 font-style: normal;
20 font-weight: 500;
21 src: local('Rubik Medium'), url('/fonts/Rubik/Rubik-Medium.ttf') format('truetype');
22}
23@font-face {
24 font-family: 'Rubik';
25 font-style: italic;
26 font-weight: 500;
27 src: local('Rubik Medium Italic'), url('/fonts/Rubik/Rubik-MediumItalic.ttf') format('truetype');
28}
29@font-face {
30 font-family: 'Rubik';
31 font-style: normal;
32 font-weight: 600;
33 src: local('Rubik SemiBold'), url('/fonts/Rubik/Rubik-SemiBold.ttf') format('truetype');
34}
35@font-face {
36 font-family: 'Rubik';
37 font-style: italic;
38 font-weight: 600;
39 src: local('Rubik SemiBold Italic'), url('/fonts/Rubik/Rubik-SemiBoldItalic.ttf') format('truetype');
40}
41
42/* Libre Franklin Font Faces */
43@font-face {
44 font-family: 'Libre Franklin';
45 font-style: normal;
46 font-weight: 500;
47 src: local('Libre Franklin Bold'), url('/fonts/Libre_Franklin/LibreFranklin-Bold.ttf') format('truetype');
48}
49
50/* Lekton Font Faces */
51@font-face {
52 font-family: 'Lekton';
53 font-style: normal;
54 font-weight: 700;
55 src: local('Lekton Bold'), url('/fonts/Lekton/Lekton-Bold.ttf') format('truetype');
56}
257
358html {
459 font-family: system-ui, sans-serif;
web/src/types/Service.ts +1
@@ -25,6 +25,7 @@ export interface Section {
2525 notableMentions?: ShortService[] | string;
2626 furtherInfo?: string;
2727 wordOfWarning?: string;
28 alternativeTo?: string[];
2829}
2930
3031export interface ServiceStats {