Commit 3a7427b00f
Unsigned
Layout: unified · split
web/src/components/form/FontAwesome.svelte +3
| @@ -6,6 +6,9 @@ | ||
| 6 | 6 | |
| 7 | 7 | |
| 8 | 8 | export const iconMap: Record<string, IconDefinition> = { |
| 9 | // Branding | |
| 10 | logo: solidIcons.faEyeSlash, | |
| 11 | ||
| 9 | 12 | // GitHub Stat Icons |
| 10 | 13 | github: brands.faGithubAlt, |
| 11 | 14 | stars: solidIcons.faStar, |
web/src/components/scafold/NavBar.astro +22 −2
| @@ -1,8 +1,13 @@ | ||
| 1 | 1 | --- |
| 2 | import FontAwesome from "@components/form/FontAwesome.svelte" | |
| 3 | ||
| 2 | 4 | --- |
| 3 | 5 | |
| 4 | 6 | <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> | |
| 6 | 11 | <nav> |
| 7 | 12 | <a href="/browse">Browse</a> |
| 8 | 13 | <a href="/search">Search</a> |
| @@ -20,8 +25,11 @@ | ||
| 20 | 25 | gap: 1rem; |
| 21 | 26 | border-bottom: 2px solid var(--foreground); |
| 22 | 27 | |
| 23 | a { | |
| 28 | .homepage { | |
| 24 | 29 | text-decoration: none; |
| 30 | display: flex; | |
| 31 | align-items: center; | |
| 32 | padding: 0 0.5rem; | |
| 25 | 33 | h1 { |
| 26 | 34 | margin: 0; |
| 27 | 35 | font-size: 2.4rem; |
| @@ -29,6 +37,18 @@ | ||
| 29 | 37 | color: var(--foreground); |
| 30 | 38 | font-family: "Lekton", sans-serif; |
| 31 | 39 | } |
| 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 | } | |
| 32 | 52 | } |
| 33 | 53 | |
| 34 | 54 | nav { |
web/src/layouts/Layout.astro +44 −6
| @@ -4,23 +4,61 @@ import NavBar from '@components/scafold/NavBar.astro'; | ||
| 4 | 4 | import Footer from '@components/scafold/Footer.astro'; |
| 5 | 5 | |
| 6 | 6 | interface 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 | |
| 9 | 12 | } |
| 10 | 13 | |
| 11 | const { title, hideNav } = Astro.props; | |
| 14 | const { | |
| 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; | |
| 12 | 21 | |
| 13 | 22 | --- |
| 14 | 23 | |
| 15 | 24 | <!doctype html> |
| 16 | 25 | <html lang="en"> |
| 17 | 26 | <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 --> | |
| 18 | 34 | <meta charset="UTF-8" /> |
| 19 | <meta name="description" content="Astro description" /> | |
| 35 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| 20 | 36 | <meta name="viewport" content="width=device-width" /> |
| 21 | <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | |
| 22 | 37 | <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> | |
| 24 | 62 | </head> |
| 25 | 63 | <body> |
| 26 | 64 | {!hideNav && <NavBar /> } |
web/src/pages/[...section].astro +52 −7
| @@ -17,11 +17,58 @@ interface Props { | ||
| 17 | 17 | notableMentions?: ShortService[] | string, |
| 18 | 18 | furtherInfo?: string, |
| 19 | 19 | wordOfWarning?: string, |
| 20 | alternativeTo?: string[]; | |
| 20 | 21 | categoryName: string, |
| 21 | 22 | otherSections: Section[], |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | const { slug, title, otherSections, services, notableMentions, furtherInfo, wordOfWarning, categoryName, intro } = Astro.props; | |
| 25 | const { | |
| 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 | */ | |
| 33 | const 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 | */ | |
| 53 | const makePageTitle = () => { | |
| 54 | return `${title} | Awesome Privacy`; | |
| 55 | }; | |
| 56 | ||
| 57 | /** | |
| 58 | * Make a string page intro, for the description tag | |
| 59 | */ | |
| 60 | const 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 | }; | |
| 25 | 72 | |
| 26 | 73 | export async function getStaticPaths() { |
| 27 | 74 | |
| @@ -37,6 +84,7 @@ const pages = await fetchData().then((data) => { | ||
| 37 | 84 | notableMentions: section.notableMentions, |
| 38 | 85 | furtherInfo: section.furtherInfo, |
| 39 | 86 | wordOfWarning: section.wordOfWarning, |
| 87 | alternativeTo: section.alternativeTo, | |
| 40 | 88 | categoryName: category.name, |
| 41 | 89 | otherSections: category.sections, |
| 42 | 90 | })); |
| @@ -45,11 +93,8 @@ const pages = await fetchData().then((data) => { | ||
| 45 | 93 | return results; |
| 46 | 94 | }); |
| 47 | 95 | |
| 48 | return 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 | }; | |
| 96 | return pages.map((props: Props) => { | |
| 97 | return {params: { section: props.slug }, props }; | |
| 53 | 98 | }); |
| 54 | 99 | } |
| 55 | 100 | |
| @@ -64,7 +109,7 @@ const { previous, next } = makePaginationLinks(); | ||
| 64 | 109 | |
| 65 | 110 | --- |
| 66 | 111 | |
| 67 | <Layout title="Awesome Privacy"> | |
| 112 | <Layout title={makePageTitle()} keywords={makeKeyWordTag()} description={makeDescriptionTag()} > | |
| 68 | 113 | <Main> |
| 69 | 114 | |
| 70 | 115 | <h2>{title}</h2> |
web/src/pages/[category].astro +1 −1
| @@ -37,7 +37,7 @@ export async function getStaticPaths() { | ||
| 37 | 37 | |
| 38 | 38 | --- |
| 39 | 39 | |
| 40 | <Layout title="Awesome Privacy"> | |
| 40 | <Layout title={`${title} | Awesome Privacy`}> | |
| 41 | 41 | <Main> |
| 42 | 42 | <SectionList title={title} sections={sections} bigTitle={true} /> |
| 43 | 43 | </Main> |
web/src/pages/about.astro +7 −2
| @@ -101,10 +101,15 @@ export const socials = [ | ||
| 101 | 101 | }, |
| 102 | 102 | ]; |
| 103 | 103 | |
| 104 | const 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.'; | |
| 104 | 109 | |
| 105 | 110 | --- |
| 106 | 111 | |
| 107 | <Layout title="Awesome Privacy"> | |
| 112 | <Layout title="About | Awesome Privacy" description={description}> | |
| 108 | 113 | <div class="about-page"> |
| 109 | 114 | <Main> |
| 110 | 115 | <h2>Objective</h2> |
| @@ -307,7 +312,7 @@ h3 { | ||
| 307 | 312 | font-weight: 300; |
| 308 | 313 | color: var(--accent-3); |
| 309 | 314 | text-align: center; |
| 310 | max-width: 500px; | |
| 315 | max-width: 550px; | |
| 311 | 316 | margin: 0 auto; |
| 312 | 317 | } |
| 313 | 318 | small { |
web/src/pages/browse.astro +1
| @@ -6,6 +6,7 @@ import SectionList from '@components/things/SectionList.astro'; | ||
| 6 | 6 | import { fetchData } from '@utils/fetch-data'; |
| 7 | 7 | |
| 8 | 8 | const categories = (await fetchData())?.categories; |
| 9 | ||
| 9 | 10 | --- |
| 10 | 11 | |
| 11 | 12 | <Layout title="Browse"> |
web/src/pages/category/index.astro deleted −67
| @@ -1,67 +0,0 @@ | ||
| 1 | --- | |
| 2 | ||
| 3 | import yaml from 'js-yaml'; | |
| 4 | ||
| 5 | import Layout from '@layouts/Layout.astro'; | |
| 6 | import Card from '@components/Card.astro'; | |
| 7 | import Hero from '@components/Hero.astro'; | |
| 8 | import { AwesomePrivacy, Section, Service } from '../../types/Service'; | |
| 9 | ||
| 10 | ||
| 11 | export async function getStaticPaths() { | |
| 12 | ||
| 13 | const 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 | ||
| 21 | const slugify = (title: string) => { | |
| 22 | return title.toLowerCase().replace(/\s/g, '-'); | |
| 23 | }; | |
| 24 | ||
| 25 | ||
| 26 | const 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 | ||
| 41 | return 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'; | ||
| 11 | 11 | |
| 12 | 12 | const categories = (await fetchData())?.categories || []; |
| 13 | 13 | |
| 14 | const 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 | ||
| 14 | 21 | --- |
| 15 | 22 | |
| 16 | <Layout title="Awesome Privacy" hideNav={true}> | |
| 23 | <Layout title="Home | Awesome Privacy" hideNav={true} description={description}> | |
| 17 | 24 | <Hero /> |
| 18 | 25 | <main> |
| 19 | 26 | <h2> |
| @@ -40,6 +47,10 @@ const categories = (await fetchData())?.categories || []; | ||
| 40 | 47 | Awesome Privacy is a collection of privacy-respecting services and tools. |
| 41 | 48 | The aim is to help you escape big tech, and choose software that respects your privacy. |
| 42 | 49 | </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> | |
| 43 | 54 | <p> |
| 44 | 55 | Noticed something that should be added / removed / ammended? |
| 45 | 56 | 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 | } | |
| 2 | 57 | |
| 3 | 58 | html { |
| 4 | 59 | font-family: system-ui, sans-serif; |
web/src/types/Service.ts +1
| @@ -25,6 +25,7 @@ export interface Section { | ||
| 25 | 25 | notableMentions?: ShortService[] | string; |
| 26 | 26 | furtherInfo?: string; |
| 27 | 27 | wordOfWarning?: string; |
| 28 | alternativeTo?: string[]; | |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | export interface ServiceStats { |