-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Expand file tree
/
Copy pathHeader.astro
More file actions
88 lines (77 loc) · 2.16 KB
/
Header.astro
File metadata and controls
88 lines (77 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
import { Image } from "astro:assets";
import { directory, directoryByGroup, groups } from "~/util/directory";
import { changelogProductIds } from "~/util/changelog";
import RSSButton from "~/components/RSSButton.astro";
import ProductSelect from "~/components/changelog/ProductSelect";
import HeroImage from "~/assets/images/changelog/hero.svg";
interface Props {
showProductSelect?: boolean;
}
const { showProductSelect = true } = Astro.props;
// Only show products and groups that have at least one visible changelog entry.
const products = directory.filter(
(entry) => entry.data.entry.url && changelogProductIds.includes(entry.id),
);
const filteredGroups = groups.filter((group) => {
const groupProducts =
directoryByGroup.find(([name]) => name === group)?.[1] ?? [];
return groupProducts.some((p) => changelogProductIds.includes(p.id));
});
const currentPath = Astro.url.pathname;
---
<div
id="changelogHeader"
class="mt-0! mb-8 ml-[calc(50%-50vw)] flex w-screen items-center justify-evenly border-b-2 border-b-(--sl-color-hairline) bg-linear-to-r from-[#FFE9CB99] to-[#FFFFFF99] p-4 max-sm:flex-col-reverse sm:mb-16 sm:h-[18.75rem] dark:from-[#FBAD411F] dark:to-[#2C2C2C00]"
>
<div class="text-center sm:text-left">
<h1>Changelog</h1>
<p>New updates and improvements at Cloudflare.</p>
<div
class="flex flex-row flex-wrap items-center justify-center gap-x-3 sm:flex-col sm:items-start"
>
<RSSButton changelog="index" />
<RSSButton
href="/fundamentals/new-features/available-rss-feeds/"
text="View RSS feeds"
icon="right-caret"
/>
</div>
{
showProductSelect && (
<div class="not-content">
<ProductSelect
client:load
products={products}
groups={filteredGroups}
currentPath={currentPath}
/>
</div>
)
}
</div>
<Image
src={HeroImage}
alt="hero image"
height="240"
class="mt-0!"
id="changelogHero"
/>
</div>
<style is:global>
.sl-markdown-content {
margin-top: 0px !important;
}
.content-panel {
padding-top: 0 !important;
overflow-x: hidden;
}
@media (max-width: 640px) {
#changelogHeader h1 {
font-size: 1.75rem;
}
#changelogHero {
display: none;
}
}
</style>