Commit ff531f2549
ff531f2549baeb689d1d9a11a23af9c04a6886d3
parent: e1bf34dab0
Unsigned
Alicia Sykes <alicia@omg.lol> · 2026-08-08 22:15 UTC
Sets right meta tags on subpages
Layout: unified · split
web/src/components/things/ListingHero.astro
+6 −6
| @@ -156,7 +156,7 @@ const highlights = [ |
| 156 | /> |
156 | /> |
| 157 | </div> |
157 | </div> |
| 158 | <div class="intro"> |
158 | <div class="intro"> |
| 159 | <ServiceIcon name={name} url={url} icon={icon} size={60} /> |
159 | <ServiceIcon name={name} url={url} icon={icon} size={60} eager /> |
| 160 | <div> |
160 | <div> |
| 161 | <p class="description" set:html={parseMarkdown(description)} /> |
161 | <p class="description" set:html={parseMarkdown(description)} /> |
| 162 | <ul> |
162 | <ul> |
| @@ -175,9 +175,9 @@ const highlights = [ |
| 175 | { |
175 | { |
| 176 | (parentSection.alternativeTo || []).length > 0 && ( |
176 | (parentSection.alternativeTo || []).length > 0 && ( |
| 177 | <div class="related-group"> |
177 | <div class="related-group"> |
| 178 | <h4 class="avoid"> |
178 | <h2 class="avoid"> |
| 179 | <FontAwesome iconName="faceBad" /> Avoid |
179 | <FontAwesome iconName="faceBad" /> Avoid |
| 180 | </h4> |
180 | </h2> |
| 181 | <ul> |
181 | <ul> |
| 182 | {(parentSection.alternativeTo || []).map((alt: string) => ( |
182 | {(parentSection.alternativeTo || []).map((alt: string) => ( |
| 183 | <li> |
183 | <li> |
| @@ -191,9 +191,9 @@ const highlights = [ |
| 191 | { |
191 | { |
| 192 | otherServices.length > 0 && ( |
192 | otherServices.length > 0 && ( |
| 193 | <div class="related-group"> |
193 | <div class="related-group"> |
| 194 | <h4 class="consider"> |
194 | <h2 class="consider"> |
| 195 | <FontAwesome iconName="faceGood" /> Also Consider |
195 | <FontAwesome iconName="faceGood" /> Also Consider |
| 196 | </h4> |
196 | </h2> |
| 197 | <ul> |
197 | <ul> |
| 198 | {otherServices.map((s: Service) => ( |
198 | {otherServices.map((s: Service) => ( |
| 199 | <li> |
199 | <li> |
| @@ -303,7 +303,7 @@ const highlights = [ |
| 303 | flex-wrap: wrap; |
303 | flex-wrap: wrap; |
| 304 | margin: var(--space-md) 0; |
304 | margin: var(--space-md) 0; |
| 305 | .related-group { |
305 | .related-group { |
| 306 | h4 { |
306 | h2 { |
| 307 | font-size: var(--text-sm); |
307 | font-size: var(--text-sm); |
| 308 | font-family: var(--font-subtitle); |
308 | font-family: var(--font-subtitle); |
| 309 | text-transform: uppercase; |
309 | text-transform: uppercase; |
web/src/components/things/ServiceIcon.astro
+3 −2
| @@ -6,9 +6,10 @@ interface Props { |
| 6 | url: string; |
6 | url: string; |
| 7 | icon?: string; |
7 | icon?: string; |
| 8 | size?: number; |
8 | size?: number; |
| |
9 | eager?: boolean; // Set on above-the-fold icons, so they aren't deferred |
| 9 | } |
10 | } |
| 10 | |
11 | |
| 11 | const { name, url, icon, size = 40 } = Astro.props; |
12 | const { name, url, icon, size = 40, eager = false } = Astro.props; |
| 12 | const src = icon || `https://icon.horse/icon/${formatLink(url)}`; |
13 | const src = icon || `https://icon.horse/icon/${formatLink(url)}`; |
| 13 | const horseSrc = `https://icon.horse/icon/${formatLink(url)}`; |
14 | const horseSrc = `https://icon.horse/icon/${formatLink(url)}`; |
| 14 | const iconSize = Math.round(size * 0.45); |
15 | const iconSize = Math.round(size * 0.45); |
| @@ -39,7 +40,7 @@ const iconSize = Math.round(size * 0.45); |
| 39 | <img |
40 | <img |
| 40 | width={size} |
41 | width={size} |
| 41 | height={size} |
42 | height={size} |
| 42 | loading="lazy" |
43 | loading={eager ? 'eager' : 'lazy'} |
| 43 | decoding="async" |
44 | decoding="async" |
| 44 | class="service-icon" |
45 | class="service-icon" |
| 45 | alt={name} |
46 | alt={name} |
web/src/layouts/Layout.astro
+2 −1
| @@ -54,6 +54,7 @@ const makeSearchLd = () => { |
| 54 | return { |
54 | return { |
| 55 | '@context': 'https://schema.org', |
55 | '@context': 'https://schema.org', |
| 56 | '@type': 'WebSite', |
56 | '@type': 'WebSite', |
| |
57 | name: 'Awesome Privacy', |
| 57 | url: 'https://awesome-privacy.xyz/', |
58 | url: 'https://awesome-privacy.xyz/', |
| 58 | potentialAction: [ |
59 | potentialAction: [ |
| 59 | { |
60 | { |
| @@ -141,7 +142,7 @@ const makeSearchLd = () => { |
| 141 | content="https://awesome-privacy.xyz/banner.png" |
142 | content="https://awesome-privacy.xyz/banner.png" |
| 142 | /> |
143 | /> |
| 143 | <meta name="twitter:card" content="summary_large_image" /> |
144 | <meta name="twitter:card" content="summary_large_image" /> |
| 144 | <meta name="twitter:url" content="https://awesome-privacy.xyz" /> |
145 | <meta name="twitter:url" content={canonical} /> |
| 145 | <meta name="twitter:title" content={title} /> |
146 | <meta name="twitter:title" content={title} /> |
| 146 | <meta name="twitter:description" content={description} /> |
147 | <meta name="twitter:description" content={description} /> |
| 147 | <meta |
148 | <meta |
web/src/pages/[...section].astro
+1
| @@ -80,6 +80,7 @@ const makeDescriptionTag = () => { |
| 80 | }; |
80 | }; |
| 81 | |
81 | |
| 82 | const makeCarasolData = () => { |
82 | const makeCarasolData = () => { |
| |
83 | if (!services.length) return undefined; |
| 83 | return { |
84 | return { |
| 84 | "@context": "https://schema.org", |
85 | "@context": "https://schema.org", |
| 85 | "@type": "ItemList", |
86 | "@type": "ItemList", |
web/src/pages/[category].astro
+10 −5
| @@ -4,6 +4,7 @@ import SectionList from '@components/things/SectionList.astro'; |
| 4 | import Main from '@components/scafold/MainCard.astro'; |
4 | import Main from '@components/scafold/MainCard.astro'; |
| 5 | |
5 | |
| 6 | import { fetchData, slugify } from '@utils/fetch-data'; |
6 | import { fetchData, slugify } from '@utils/fetch-data'; |
| |
7 | import { truncate } from '@utils/meta-tags'; |
| 7 | |
8 | |
| 8 | import type { Section } from '../types/Service'; |
9 | import type { Section } from '../types/Service'; |
| 9 | import Button from '@components/form/Button.astro'; |
10 | import Button from '@components/form/Button.astro'; |
| @@ -43,12 +44,8 @@ const makeCarasolData = () => { |
| 43 | itemListElement: sections.map((section, index) => ({ |
44 | itemListElement: sections.map((section, index) => ({ |
| 44 | '@type': 'ListItem', |
45 | '@type': 'ListItem', |
| 45 | position: index + 1, |
46 | position: index + 1, |
| |
47 | name: section.name, |
| 46 | url: `https://awesome-privacy.xyz/${slugify(title)}/${slugify(section.name)}/`, |
48 | 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 | })), |
49 | })), |
| 53 | }; |
50 | }; |
| 54 | }; |
51 | }; |
| @@ -60,6 +57,13 @@ const makeBreadcrumbs = () => { |
| 60 | ]; |
57 | ]; |
| 61 | }; |
58 | }; |
| 62 | |
59 | |
| |
60 | const makeDescriptionTag = () => |
| |
61 | truncate( |
| |
62 | `Privacy-respecting ${title.toLowerCase()}: ` + |
| |
63 | `${sections.map((section) => section.name).join(', ')}. ` + |
| |
64 | `Compare free, open source and secure alternatives.`, |
| |
65 | ); |
| |
66 | |
| 63 | const makePaginationLinks = () => { |
67 | const makePaginationLinks = () => { |
| 64 | const index = categories.findIndex((category) => category.name === title); |
68 | const index = categories.findIndex((category) => category.name === title); |
| 65 | const previousCategory = index > 0 ? categories[index - 1].name : null; |
69 | const previousCategory = index > 0 ? categories[index - 1].name : null; |
| @@ -73,6 +77,7 @@ const { previous, next } = makePaginationLinks(); |
| 73 | |
77 | |
| 74 | <Layout |
78 | <Layout |
| 75 | title={`${title} | Awesome Privacy`} |
79 | title={`${title} | Awesome Privacy`} |
| |
80 | description={makeDescriptionTag()} |
| 76 | breadcrumbs={makeBreadcrumbs()} |
81 | breadcrumbs={makeBreadcrumbs()} |
| 77 | customSchemaJson={makeCarasolData()} |
82 | customSchemaJson={makeCarasolData()} |
| 78 | > |
83 | > |
web/src/pages/browse.astro
+4 −1
| @@ -8,7 +8,10 @@ import type { Category } from '../types/Service'; |
| 8 | const categories: Category[] = (await fetchData())?.categories; |
8 | const categories: Category[] = (await fetchData())?.categories; |
| 9 | --- |
9 | --- |
| 10 | |
10 | |
| 11 | <Layout title="Browse"> |
11 | <Layout |
| |
12 | title="Browse Categories | Awesome Privacy" |
| |
13 | description="Browse every category of privacy-respecting software, from browsers and VPNs to encrypted messaging, cloud storage and password managers." |
| |
14 | > |
| 12 | <div class="head-wrap"> |
15 | <div class="head-wrap"> |
| 13 | <h1>Browse</h1> |
16 | <h1>Browse</h1> |
| 14 | <span> |
17 | <span> |
web/src/pages/inventory/[...inventoryId].astro
+1 −1
| @@ -26,7 +26,7 @@ if (serviceList.error) { |
| 26 | } |
26 | } |
| 27 | --- |
27 | --- |
| 28 | |
28 | |
| 29 | <Layout title="Saved Services"> |
29 | <Layout title={`${makeTitle(inventoryId)} | Awesome Privacy`}> |
| 30 | <main> |
30 | <main> |
| 31 | <h2>{makeTitle(inventoryId)}</h2> |
31 | <h2>{makeTitle(inventoryId)}</h2> |
| 32 | { |
32 | { |
web/src/pages/inventory/index.astro
+4 −1
| @@ -7,7 +7,10 @@ import Button from '@components/form/Button.astro'; |
| 7 | import EditableTitle from '@components/form/EditableTitle.svelte'; |
7 | import EditableTitle from '@components/form/EditableTitle.svelte'; |
| 8 | --- |
8 | --- |
| 9 | |
9 | |
| 10 | <Layout title="Saved Services"> |
10 | <Layout |
| |
11 | title="Saved Services | Awesome Privacy" |
| |
12 | description="Your personal shortlist of privacy-respecting apps and services, saved in your browser and sharable with a link." |
| |
13 | > |
| 11 | <main> |
14 | <main> |
| 12 | <h1 class="sr-only">Saved Services</h1> |
15 | <h1 class="sr-only">Saved Services</h1> |
| 13 | <div class="top-row"> |
16 | <div class="top-row"> |
web/src/pages/search/[...searchTerm].astro
+1 −1
| @@ -64,7 +64,7 @@ const putResultsIntoGroups = () => { |
| 64 | const beer = putResultsIntoGroups(); |
64 | const beer = putResultsIntoGroups(); |
| 65 | --- |
65 | --- |
| 66 | |
66 | |
| 67 | <Layout title="Search | Awesome Privacy"> |
67 | <Layout title={`Search: ${searchTerm} | Awesome Privacy`}> |
| 68 | <section> |
68 | <section> |
| 69 | <h1>Search</h1> |
69 | <h1>Search</h1> |
| 70 | <Search client:visible previousSearch={searchTerm} /> |
70 | <Search client:visible previousSearch={searchTerm} /> |
web/src/pages/search/index.astro
+4 −1
| @@ -4,7 +4,10 @@ import Layout from '@layouts/Layout.astro'; |
| 4 | import Search from '@components/things/Search.svelte'; |
4 | import Search from '@components/things/Search.svelte'; |
| 5 | --- |
5 | --- |
| 6 | |
6 | |
| 7 | <Layout title="Search | Awesome Privacy"> |
7 | <Layout |
| |
8 | title="Search | Awesome Privacy" |
| |
9 | description="Search hundreds of privacy-respecting apps and services by name, category or the mainstream product you want to replace." |
| |
10 | > |
| 8 | <section> |
11 | <section> |
| 9 | <h1>Search</h1> |
12 | <h1>Search</h1> |
| 10 | <Search client:visible /> |
13 | <Search client:visible /> |
web/src/pages/sitemap.astro
+4 −1
| @@ -6,7 +6,10 @@ import { fetchData, slugify } from '@utils/fetch-data'; |
| 6 | const categories = ((await fetchData()) as AwesomePrivacy)?.categories || []; |
6 | const categories = ((await fetchData()) as AwesomePrivacy)?.categories || []; |
| 7 | --- |
7 | --- |
| 8 | |
8 | |
| 9 | <Layout title="All Links | Awesome Privacy"> |
9 | <Layout |
| |
10 | title="All Links | Awesome Privacy" |
| |
11 | description="A full index of every page on Awesome Privacy, covering all categories, sections and individual service listings." |
| |
12 | > |
| 10 | <main> |
13 | <main> |
| 11 | <h1>Sitemap</h1> |
14 | <h1>Sitemap</h1> |
| 12 | <p> |
15 | <p> |
web/src/pages/submit.astro
+4 −1
| @@ -11,7 +11,10 @@ const commits = ((await fetchGitHubStats('lissy93/awesome-privacy')) || {}) |
| 11 | const isDisabled = true; // will set this back to false if/when we have better way to manage the AI spam |
11 | const isDisabled = true; // will set this back to false if/when we have better way to manage the AI spam |
| 12 | --- |
12 | --- |
| 13 | |
13 | |
| 14 | <Layout title="Submit a Change | Awesome Privacy"> |
14 | <Layout |
| |
15 | title="Submit a Change | Awesome Privacy" |
| |
16 | description="Suggest a new service, correct an existing entry or propose a new category. All data is community maintained, openly, via Git." |
| |
17 | > |
| 15 | <section> |
18 | <section> |
| 16 | <h1 class="page-title">Submit a Change</h1> |
19 | <h1 class="page-title">Submit a Change</h1> |
| 17 | <h2>About our Data</h2> |
20 | <h2>About our Data</h2> |