|
2 | 2 | import Default from "@astrojs/starlight/components/Footer.astro"; |
3 | 3 | import OneTrust from "../OneTrust.astro"; |
4 | 4 | import FeedbackPrompt from "../FeedbackPrompt.tsx"; |
5 | | -import { getEntry } from "astro:content"; |
6 | 5 |
|
7 | | -let links = { |
8 | | - "Cloudflare Dashboard": "https://dash.cloudflare.com", |
9 | | - Discord: "https://discord.cloudflare.com", |
10 | | - Community: "https://community.cloudflare.com", |
11 | | - "Learning Center": "https://www.cloudflare.com/learning/", |
12 | | - "Support Portal": "/support/contacting-cloudflare-support/", |
13 | | -}; |
14 | | -
|
15 | | -const currentSection = Astro.params.slug?.split("/")[0]; |
16 | | -
|
17 | | -if (currentSection) { |
18 | | - const product = await getEntry("products", currentSection); |
19 | | -
|
20 | | - if (product) { |
21 | | - if (product.data.resources?.dashboard_link) { |
22 | | - links["Cloudflare Dashboard"] = product.data.resources.dashboard_link; |
23 | | - } |
24 | | - } |
25 | | -} |
26 | | -
|
27 | | -const homepageLinks = Object.entries({ |
| 6 | +const groups = Object.entries({ |
28 | 7 | Resources: [ |
29 | 8 | { text: "API", href: "/api/" }, |
30 | 9 | { |
@@ -61,14 +40,15 @@ const homepageLinks = Object.entries({ |
61 | 40 | ], |
62 | 41 | }); |
63 | 42 |
|
64 | | -const homepageLegalLinks = Object.entries({ |
| 43 | +const links = Object.entries({ |
65 | 44 | "Privacy Policy": "https://www.cloudflare.com/privacypolicy/", |
66 | 45 | "Terms of Use": "https://www.cloudflare.com/website-terms/", |
67 | 46 | "Report Security Issues": "https://www.cloudflare.com/disclosure/", |
68 | 47 | Trademark: "https://www.cloudflare.com/trademark/", |
69 | 48 | }); |
70 | 49 |
|
71 | | -const isHomepage = Astro.locals.starlightRoute.id === ""; |
| 50 | +const homepage = Astro.locals.starlightRoute.entry.id === ""; |
| 51 | +const splash = Astro.locals.starlightRoute.entry.data.template === "splash"; |
72 | 52 |
|
73 | 53 | let isProduction = false; |
74 | 54 |
|
|
81 | 61 | --- |
82 | 62 |
|
83 | 63 | { |
84 | | - isHomepage ? ( |
85 | | - <> |
86 | | - <div class="bleed !mt-0"> |
87 | | - <div class="flex flex-wrap justify-between bg-[#001C43] py-6"> |
88 | | - {homepageLinks.map(([header, links]) => ( |
89 | | - <div class="basis-1/2 md:basis-auto"> |
90 | | - <strong class="text-gray-400">{header}</strong> |
91 | | - <ul class="list-none pl-0"> |
92 | | - {links.map((link) => ( |
93 | | - <li> |
94 | | - <a href={link.href} class="text-white no-underline"> |
95 | | - {link.text} |
96 | | - </a> |
97 | | - </li> |
98 | | - ))} |
99 | | - </ul> |
100 | | - </div> |
101 | | - ))} |
102 | | - </div> |
103 | | - </div> |
104 | | - <div> |
105 | | - <ul class="flex list-outside justify-center gap-x-4 pl-0 text-xs text-gray-600 dark:!text-gray-400"> |
106 | | - <li class="list-none text-gray-600 dark:text-gray-400"> |
107 | | - 2024 Cloudflare, Inc. |
| 64 | + !homepage && ( |
| 65 | + <div class="feedback-prompt"> |
| 66 | + <FeedbackPrompt client:idle /> |
| 67 | + </div> |
| 68 | + ) |
| 69 | +} |
| 70 | +{!splash && <Default />} |
| 71 | +<div class="w-full"> |
| 72 | + <div class="grid grid-cols-2 gap-8 pb-10 pt-6 md:grid-cols-4"> |
| 73 | + { |
| 74 | + groups.map(([title, items]) => ( |
| 75 | + <ul class="flex w-full list-none flex-col gap-3 pl-0"> |
| 76 | + <li class="text-xs leading-5"> |
| 77 | + <strong>{title}</strong> |
108 | 78 | </li> |
109 | | - {homepageLegalLinks.map(([text, href]) => ( |
110 | | - <li> |
111 | | - <a |
112 | | - href={href} |
113 | | - class="text-gray-600 no-underline dark:!text-gray-400" |
114 | | - > |
115 | | - {text} |
| 79 | + {items.map((link) => ( |
| 80 | + <li class="text-sm"> |
| 81 | + <a href={link.href} class="!text-black no-underline"> |
| 82 | + {link.text} |
116 | 83 | </a> |
117 | 84 | </li> |
118 | 85 | ))} |
119 | | - <li class="text-gray-600 dark:!text-gray-400"> |
120 | | - {isProduction && <OneTrust />} |
121 | | - </li> |
122 | 86 | </ul> |
123 | | - </div> |
124 | | - </> |
125 | | - ) : ( |
126 | | - <div> |
127 | | - <div class="feedback-prompt"> |
128 | | - <FeedbackPrompt client:idle /> |
129 | | - </div> |
130 | | - <Default /> |
131 | | - <div id="footer-links" class="mt-6 flex flex-wrap items-center space-x-4"> |
132 | | - {Object.entries(links).map(([text, href]) => ( |
133 | | - <a href={href} class="text-xs text-black decoration-accent"> |
134 | | - <span>{text}</span> |
135 | | - </a> |
136 | | - ))} |
137 | | - {isProduction && ( |
138 | | - <div class="text-xs text-black [&>button]:underline [&>button]:decoration-accent"> |
| 87 | + )) |
| 88 | + } |
| 89 | + </div> |
| 90 | + <div> |
| 91 | + <ul |
| 92 | + class="flex list-inside flex-wrap items-center justify-center gap-3 gap-y-4 pl-0 text-xs !text-cl1-gray-4 dark:!text-cl1-gray-7" |
| 93 | + > |
| 94 | + <li class="list-none">2025 Cloudflare, Inc.</li> |
| 95 | + { |
| 96 | + links.map(([text, href]) => ( |
| 97 | + <li> |
| 98 | + <a |
| 99 | + href={href} |
| 100 | + class="!text-cl1-gray-4 no-underline dark:!text-cl1-gray-7" |
| 101 | + > |
| 102 | + {text} |
| 103 | + </a> |
| 104 | + </li> |
| 105 | + )) |
| 106 | + } |
| 107 | + { |
| 108 | + isProduction && ( |
| 109 | + <li> |
139 | 110 | <OneTrust /> |
140 | | - </div> |
141 | | - )} |
142 | | - </div> |
143 | | - </div> |
144 | | - ) |
145 | | -} |
| 111 | + </li> |
| 112 | + ) |
| 113 | + } |
| 114 | + </ul> |
| 115 | + </div> |
| 116 | +</div> |
146 | 117 |
|
147 | 118 | <style> |
148 | 119 | :global(footer) { |
149 | 120 | flex-direction: column-reverse !important; |
150 | | - } |
151 | 121 |
|
152 | | - :global(.meta) { |
153 | | - margin-top: 0 !important; |
| 122 | + .meta { |
| 123 | + margin-top: 0 !important; |
| 124 | + } |
154 | 125 | } |
155 | 126 |
|
156 | 127 | .feedback-prompt { |
|
170 | 141 | } |
171 | 142 | } |
172 | 143 | } |
173 | | - |
174 | | - .bleed { |
175 | | - box-shadow: 0 0 0 100vmax #001c43 !important; |
176 | | - clip-path: inset(0 -100vmax); |
177 | | - } |
178 | 144 | </style> |
0 commit comments