Commit fae3013515

fae3013515af437a77c94ca4ec3d92353f8941a1

parent: 9624234b8b

Unsigned

Alicia Sykes <alicia@omg.lol> · 2024-02-29 21:51 UTC

Adds a page which lists all pages

Layout: unified · split

web/src/pages/sitemap.astro added +148
@@ -0,0 +1,148 @@
1---
2
3
4import Layout from '@layouts/Layout.astro';
5import type { AwesomePrivacy } from '../types/Service';
6import { fetchData, slugify } from '@utils/fetch-data';
7
8const categories = (await fetchData() as AwesomePrivacy)?.categories || [];
9
10---
11
12<Layout title="All Links | Awesome Privacy">
13 <main>
14 <h2>Sitemap</h2>
15 <p>
16 Below is a full listing of all pages on this site.<br>
17 <small>As reflected in our <a href="/sitemap-index.xml">sitemap.xml</a></small>
18 </p>
19 <ul>
20 <li>
21 <a href="/">Home</a>
22 </li>
23 <li>
24 <a href="/search">Search</a>
25 </li>
26 <li>
27 <a href="/browse">Categories</a>
28 <ul>
29 {categories.map((category) => (
30 <li>
31 <a href={`/${slugify(category.name)}`}>{category.name}</a>
32 <ul>
33 {category.sections.map((section) => (
34 <li>
35 <a href={`/${slugify(category.name)}/${slugify(section.name)}`}>{section.name}</a>
36 <ul>
37 {(section.services || []).map((service) => (
38 <li title={service.description || ''}>
39 <a href={`/${slugify(category.name)}/${slugify(section.name)}/${slugify(service.name)}`}>
40 {service.name}
41 </a>
42 </li>
43 ))}
44 </ul>
45 </li>
46 ))}
47 </ul>
48 </li>
49 ))}
50 </ul>
51 </li>
52 <li>
53 <a href="/all">View Summary of All</a>
54 </li>
55 <li>
56 <a href="/about">About</a>
57 <ul>
58 <li><a href="/about#objective">Objective</a></li>
59 <li><a href="/about#criteria">Listing Criteria</a></li>
60 <li><a href="/about#contributing">Contributing</a></li>
61 <li>
62 <a href="/about#acknowledgements">Acknowledgements</a>
63 <ul>
64 <li><a href="/about#contributors">Contributors</a></li>
65 <li><a href="/about#sponsors">Sponsors</a></li>
66 </ul>
67 </li>
68 <li><a href="/about#author">Author</a></li>
69 <li><a href="/about#license">License</a></li>
70 </ul>
71 </li>
72 <li>
73 <a href="/map">Sitemap</a>
74 </li>
75 </ul>
76
77 </main>
78
79</Layout>
80
81<style lang="scss">
82
83main {
84 padding: 1rem;
85 width: 1000px;
86 max-width: calc(100% - 5rem);
87 margin: 4rem auto 5rem auto;
88 padding: 0 2rem;
89 border: 2px solid var(--foreground);
90 box-shadow: 6px 6px 0 var(--foreground);
91 background: var(--accent-fg);
92 p {
93 font-size: 1.3rem;
94 margin: 0;
95 small {
96 font-size: 0.8rem;
97 opacity: 0.5;
98 transition: all 0.2s ease-in-out;
99 &:hover { opacity: 0.8; }
100 }
101 }
102 ul {
103 padding-left: 1.2rem;
104 list-style: none;
105 border-left: 3px solid #5f53f482;
106 border-radius: 4px;;
107 li {
108 font-weight: 600;
109 ul li {
110 font-weight: 500;
111 ul li {
112 font-weight: 400;
113 ul li {
114 font-weight: 300;
115 }
116 }
117 }
118 &::before {
119 content: "━ ";
120 color: #5f53f482;
121 margin-left: -1.2rem;
122 }
123 a {
124 transition: all ease-in-out 0.2s;
125 text-decoration: none;
126 &:hover {
127 text-decoration: underline;
128 }
129 }
130 }
131 }
132}
133
134h2 {
135 margin: 0;
136 gap: 1rem;
137 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;
144}
145
146
147
148</style>