Skip to content

Commit 9e8ebdc

Browse files
KianNHelithraraninibreadhyperlint-ai[bot]irvinebroque
authored
[Docs Site] changelog-next (#18894)
* [Docs Site] changelog-next * fix type errors, only add padding to direct steps list items * changelog: workflows beta * Update workflows-beta.mdx * Anni/add build changelog next (#18920) * adding a changelog * added changelog and assets * Update src/content/changelogs-next/12-22-2024-builds.mdx Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> * add link for monorepos * mb and line-spacing fix * Update src/content/changelogs-next/12-22-2024-builds.mdx Co-authored-by: Brendan Irvine-Broque <[email protected]> * Update src/content/changelogs-next/12-22-2024-builds.mdx Co-authored-by: Brendan Irvine-Broque <[email protected]> * Update src/content/changelogs-next/12-22-2024-builds.mdx Co-authored-by: Brendan Irvine-Broque <[email protected]> * Update src/content/changelogs-next/12-22-2024-builds.mdx Co-authored-by: Brendan Irvine-Broque <[email protected]> * small fixes --------- Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <[email protected]> * added overflow-auto (#18976) * Fixed issue that produced duplicate products in the changelog-next header (#18972) * Ranamed workflows post to fit date-title format --------- Co-authored-by: Matt Silverlock <[email protected]> Co-authored-by: Anni Wang <[email protected]> Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> Co-authored-by: Brendan Irvine-Broque <[email protected]> Co-authored-by: Phillip Jones <[email protected]>
1 parent a845405 commit 9e8ebdc

File tree

22 files changed

+676
-13
lines changed

22 files changed

+676
-13
lines changed

.prettierrc.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22
/** @type {import("prettier").Config} */
33
export default {
4-
plugins: ["prettier-plugin-astro"],
4+
plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
55
useTabs: true,
66
overrides: [
77
{

package-lock.json

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"playwright": "^1.49.1",
7272
"prettier": "^3.4.2",
7373
"prettier-plugin-astro": "^0.14.1",
74+
"prettier-plugin-tailwindcss": "^0.6.9",
7475
"puppeteer": "^23.11.0",
7576
"react": "^18.3.1",
7677
"react-dom": "^18.3.1",

src/assets/images/changelog-next/hero.svg

Lines changed: 111 additions & 0 deletions
Loading
22 KB
Loading
25.7 KB
Loading
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
import { Image } from "astro:assets";
3+
import { z } from "astro:schema";
4+
import { getEntry, type CollectionEntry } from "astro:content";
5+
6+
import { StarlightIcon } from "..";
7+
import HeroImage from "~/assets/images/changelog-next/hero.svg";
8+
9+
type Props = z.infer<typeof props>;
10+
11+
const props = z.object({
12+
entries: z.array(z.any()).optional(),
13+
});
14+
15+
const { entries } = props.parse(Astro.props);
16+
17+
async function uniqueProducts(
18+
entries?: Array<CollectionEntry<"changelogs-next">>,
19+
) {
20+
const products = entries?.flatMap((entry) => entry.data.products ?? []);
21+
22+
const unique = [
23+
...new Map(products?.map((product) => [product.id, product])).values(),
24+
];
25+
26+
return Promise.all(
27+
unique.map(async (product) => {
28+
return getEntry(product);
29+
}),
30+
);
31+
}
32+
33+
const products = await uniqueProducts(entries);
34+
---
35+
36+
<div
37+
class="mb-16 flex w-full justify-center border-b-2 border-b-[#EAEAEA] bg-gradient-to-r from-[#FFE9CB99] to-[#FFFFFF99] dark:border-b-[#2C2C2C] dark:from-[#FBAD411F] dark:to-[#2C2C2C00] sm:h-[300px]"
38+
>
39+
<div class="flex justify-between self-center py-4 sm:py-0 md:w-[64rem]">
40+
<div class="w-full self-center max-sm:text-center sm:items-start">
41+
<div class="!mt-0 justify-items-center sm:hidden">
42+
<Image src={HeroImage} alt="hero image" height="240" />
43+
</div>
44+
<h1 class="sm:!mt-0">Changelog</h1>
45+
<p>
46+
New updates and improvements at Cloudflare.
47+
<span>
48+
<a
49+
href="/changelog-next/rss.xml"
50+
class="px-2 text-[#056DFF] no-underline hover:rounded-[4px] hover:bg-[#DCEBFF] hover:!text-[#056DFF] dark:text-[#79B1FF] dark:hover:bg-[#002B66] dark:hover:!text-[#79B1FF]"
51+
>
52+
Subscribe to RSS
53+
<StarlightIcon
54+
name="rss"
55+
size="18px"
56+
class="!inline align-text-top"
57+
/>
58+
</a>
59+
</span>
60+
</p>
61+
{
62+
entries && (
63+
<div>
64+
<select id="changelogs-next-filter" class="mt-2 h-8 w-52">
65+
<option value="all">All products</option>
66+
{products
67+
.sort((a, b) => a.id.localeCompare(b.id))
68+
.map(async (product) => {
69+
return (
70+
<option value={product.id}>
71+
{product.data.product.title}
72+
</option>
73+
);
74+
})}
75+
</select>
76+
</div>
77+
)
78+
}
79+
</div>
80+
<div class="!mt-0 hidden sm:block">
81+
<Image src={HeroImage} alt="hero image" height="240" />
82+
</div>
83+
</div>
84+
</div>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
import { getEntries } from "astro:content";
3+
import { reference } from "astro:content";
4+
import { z } from "astro:schema";
5+
6+
type Props = z.infer<typeof props>;
7+
8+
const props = z.object({
9+
products: z.array(reference("products")),
10+
});
11+
12+
const { products } = Astro.props;
13+
14+
const data = await getEntries(products);
15+
---
16+
17+
<div class="flex flex-row gap-2">
18+
{
19+
data.map((product) => (
20+
<a href={product.data.product.url} class="no-underline">
21+
<span class="ml-1 rounded-full bg-orange-200 px-2 py-0.5 text-xs text-orange-900">
22+
{product.data.product.title}
23+
</span>
24+
</a>
25+
))
26+
}
27+
</div>

src/components/overrides/Footer.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ if (
9292
<ul class="list-none pl-0">
9393
{links.map((link) => (
9494
<li>
95-
<a href={link.href} class="no-underline text-white">
95+
<a href={link.href} class="text-white no-underline">
9696
{link.text}
9797
</a>
9898
</li>
@@ -103,15 +103,15 @@ if (
103103
</div>
104104
</div>
105105
<div>
106-
<ul class="flex gap-x-4 text-xs list-outside pl-0 justify-center text-gray-600 dark:!text-gray-400">
106+
<ul class="flex list-outside justify-center gap-x-4 pl-0 text-xs text-gray-600 dark:!text-gray-400">
107107
<li class="list-none text-gray-600 dark:text-gray-400">
108108
2024 Cloudflare, Inc.
109109
</li>
110110
{homepageLegalLinks.map(([text, href]) => (
111111
<li>
112112
<a
113113
href={href}
114-
class="no-underline text-gray-600 dark:!text-gray-400"
114+
class="text-gray-600 no-underline dark:!text-gray-400"
115115
>
116116
{text}
117117
</a>
@@ -126,17 +126,17 @@ if (
126126
) : (
127127
<>
128128
<Default {...Astro.props} />
129-
<div class="items-center flex flex-wrap">
129+
<div id="footer-links" class="flex flex-wrap items-center">
130130
{Object.entries(links).map(([text, href]) => (
131131
<a
132132
href={href}
133-
class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200"
133+
class="mx-2 my-2 text-xs text-black decoration-accent-600 dark:text-white dark:decoration-accent-200"
134134
>
135135
<span>{text}</span>
136136
</a>
137137
))}
138138
{isProduction && (
139-
<div class="mx-2 my-2 text-xs text-black dark:text-white underline decoration-accent-600 dark:decoration-accent-200">
139+
<div class="mx-2 my-2 text-xs text-black underline decoration-accent-600 dark:text-white dark:decoration-accent-200">
140140
<OneTrust />
141141
</div>
142142
)}

src/components/overrides/PageTitle.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const summary = Astro.props.entry.data.summary;
2121
2222
const slug = Astro.props.entry.slug;
2323
24-
const showBreadcrumbs = !["products"].includes(slug);
25-
2624
const breadcrumbProps: Record<string, any> = {
2725
crumbs: [
2826
{
@@ -73,10 +71,11 @@ for (let i = 0; i < segments.length; i++) {
7371
// Currently the officially sanctioned way to alter behaviour on specific routes
7472
// https://starlight.astro.build/guides/overriding-components/#only-override-on-specific-pages
7573
const hideTitle = Astro.props.hideTitle;
74+
const hideBreadcrumbs = Astro.props.hideBreadcrumbs;
7675
---
7776

7877
{
79-
showBreadcrumbs && (
78+
!hideBreadcrumbs && (
8079
<Breadcrumbs {...breadcrumbProps}>
8180
<svg
8281
slot="separator"
@@ -119,3 +118,13 @@ const hideTitle = Astro.props.hideTitle;
119118
--color-link-breadcrumbs: var(--sl-color-text-accent);
120119
}
121120
</style>
121+
122+
{ hideTitle && hideBreadcrumbs &&
123+
<style>
124+
main {
125+
.content-panel:first-of-type {
126+
display: none;
127+
}
128+
}
129+
</style>
130+
}

0 commit comments

Comments
 (0)