Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs Site] changelog-next #18894

Open
wants to merge 5 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
/** @type {import("prettier").Config} */
export default {
plugins: ["prettier-plugin-astro"],
plugins: ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
useTabs: true,
overrides: [
{
Expand Down
80 changes: 80 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"playwright": "^1.49.1",
"prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.9",
"puppeteer": "^23.11.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
111 changes: 111 additions & 0 deletions src/assets/images/changelog-next/hero.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/components/changelog-next/Header.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
import { Image } from "astro:assets";
import { z } from "astro:schema";
import { getEntry, type CollectionEntry } from "astro:content";

import { StarlightIcon } from "..";
import HeroImage from "~/assets/images/changelog-next/hero.svg";

type Props = z.infer<typeof props>;

const props = z.object({
entries: z.array(z.any()).optional(),
});

const { entries } = props.parse(Astro.props);

async function uniqueProducts(
entries?: Array<CollectionEntry<"changelogs-next">>,
) {
const products = entries?.flatMap((entry) => entry.data.products ?? []);

const unique = [...new Set(products)];

return Promise.all(
unique.map(async (product) => {
return getEntry(product);
}),
);
}

const products = await uniqueProducts(entries);
---

<div
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]"
>
<div class="flex justify-between self-center py-4 sm:py-0 md:w-[64rem]">
<div class="w-full self-center max-sm:text-center sm:items-start">
<div class="!mt-0 justify-items-center sm:hidden">
<Image src={HeroImage} alt="hero image" height="240" />
</div>
<h1 class="sm:!mt-0">Changelog</h1>
<p>
New updates and improvements at Cloudflare.
<span>
<a
href="/changelog-next/rss.xml"
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]"
>
Subscribe to RSS
<StarlightIcon
name="rss"
size="18px"
class="!inline align-text-top"
/>
</a>
</span>
</p>
{
entries && (
<div>
<select id="changelogs-next-filter" class="mt-2 h-8 w-52">
<option value="all">All products</option>
{products
.sort((a, b) => a.id.localeCompare(b.id))
.map(async (product) => {
return (
<option value={product.id}>
{product.data.product.title}
</option>
);
})}
</select>
</div>
)
}
</div>
<div class="!mt-0 hidden sm:block">
<Image src={HeroImage} alt="hero image" height="240" />
</div>
</div>
</div>
27 changes: 27 additions & 0 deletions src/components/changelog-next/ProductPills.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
import { getEntries } from "astro:content";
import { reference } from "astro:content";
import { z } from "astro:schema";

type Props = z.infer<typeof props>;

const props = z.object({
products: z.array(reference("products")),
});

const { products } = Astro.props;

const data = await getEntries(products);
---

<div class="flex flex-row gap-2">
{
data.map((product) => (
<a href={product.data.product.url} class="no-underline">
<span class="ml-1 rounded-full bg-orange-200 px-2 py-0.5 text-xs text-orange-900">
{product.data.product.title}
</span>
</a>
))
}
</div>
12 changes: 6 additions & 6 deletions src/components/overrides/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if (
<ul class="list-none pl-0">
{links.map((link) => (
<li>
<a href={link.href} class="no-underline text-white">
<a href={link.href} class="text-white no-underline">
{link.text}
</a>
</li>
Expand All @@ -103,15 +103,15 @@ if (
</div>
</div>
<div>
<ul class="flex gap-x-4 text-xs list-outside pl-0 justify-center text-gray-600 dark:!text-gray-400">
<ul class="flex list-outside justify-center gap-x-4 pl-0 text-xs text-gray-600 dark:!text-gray-400">
<li class="list-none text-gray-600 dark:text-gray-400">
2024 Cloudflare, Inc.
</li>
{homepageLegalLinks.map(([text, href]) => (
<li>
<a
href={href}
class="no-underline text-gray-600 dark:!text-gray-400"
class="text-gray-600 no-underline dark:!text-gray-400"
>
{text}
</a>
Expand All @@ -126,17 +126,17 @@ if (
) : (
<>
<Default {...Astro.props} />
<div class="items-center flex flex-wrap">
<div id="footer-links" class="flex flex-wrap items-center">
{Object.entries(links).map(([text, href]) => (
<a
href={href}
class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200"
class="mx-2 my-2 text-xs text-black decoration-accent-600 dark:text-white dark:decoration-accent-200"
>
<span>{text}</span>
</a>
))}
{isProduction && (
<div class="mx-2 my-2 text-xs text-black dark:text-white underline decoration-accent-600 dark:decoration-accent-200">
<div class="mx-2 my-2 text-xs text-black underline decoration-accent-600 dark:text-white dark:decoration-accent-200">
<OneTrust />
</div>
)}
Expand Down
15 changes: 12 additions & 3 deletions src/components/overrides/PageTitle.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const summary = Astro.props.entry.data.summary;

const slug = Astro.props.entry.slug;

const showBreadcrumbs = !["products"].includes(slug);

const breadcrumbProps: Record<string, any> = {
crumbs: [
{
Expand Down Expand Up @@ -73,10 +71,11 @@ for (let i = 0; i < segments.length; i++) {
// Currently the officially sanctioned way to alter behaviour on specific routes
// https://starlight.astro.build/guides/overriding-components/#only-override-on-specific-pages
const hideTitle = Astro.props.hideTitle;
const hideBreadcrumbs = Astro.props.hideBreadcrumbs;
---

{
showBreadcrumbs && (
!hideBreadcrumbs && (
<Breadcrumbs {...breadcrumbProps}>
<svg
slot="separator"
Expand Down Expand Up @@ -119,3 +118,13 @@ const hideTitle = Astro.props.hideTitle;
--color-link-breadcrumbs: var(--sl-color-text-accent);
}
</style>

{ hideTitle && hideBreadcrumbs &&
<style>
main {
.content-panel:first-of-type {
display: none;
}
}
</style>
}
4 changes: 2 additions & 2 deletions src/components/overrides/Sidebar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ const lookupProductTitle = async (slug: string) => {

<a
href={"/" + currentSection + "/"}
class="items-center flex hover:opacity-80 decoration-[color:var(--orange-accent-200)]"
class="flex items-center decoration-[color:var(--orange-accent-200)] hover:opacity-80"
>
<AstroIcon
name={currentSection}
class="text-[color:var(--orange-accent-200)] text-4xl mr-2"
class="mr-2 text-4xl text-[color:var(--orange-accent-200)]"
/>
<span class="text-black dark:text-white">
<strong>
Expand Down
4 changes: 3 additions & 1 deletion src/components/overrides/SocialIcons.astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const links = Object.entries({

<style>
:root {
--sl-icon-color: var(--sl-color-text);
.social-icons {
--sl-icon-color: var(--sl-color-text);
}
}
</style>
28 changes: 28 additions & 0 deletions src/content/changelogs-next/workflows-beta.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Workflows is now in open beta
description: Build long-running, reliable and durable applications on Cloudflare Workers
products:
- workers
- workflows
date: 2024-10-24T14:00:00Z
---

import { Render, PackageManagers } from "~/components"

Workflows is now in open beta, and available to any developer a free or paid Workers plan.

Workflows allow you to build multi-step applications that can automatically retry, persist state and run for minutes, hours, days, or weeks. Workflows introduces a programming model that makes it easier to build reliable, long-running tasks, observe as they progress, and programatically trigger instances based on events across your services.

### Get started

You can get started with Workflows by [following our get started guide](/workflows/get-started/guide/) and/or using `npm create cloudflare` to pull down the starter project:

```sh
npm create cloudflare@latest workflows-starter -- --template "cloudflare/workflows-starter"
```

You can open the `src/index.ts` file, extend it, and use `wrangler deploy` to deploy your first Workflow. From there, you can:

* Learn the [Workflows API](/workflows/build/workers-api/)
* [Trigger Workflows](/workflows/build/trigger-workflows/) via your Workers apps.
* Understand the [Rules of Workflows](/workflows/build/rules-of-workflows/) and how to adopt best practices
4 changes: 4 additions & 0 deletions src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
learningPathsSchema,
videosSchema,
workersAiSchema,
changelogsNextSchema,
} from "~/schemas";

const partialSchema = z.object({
Expand Down Expand Up @@ -74,4 +75,7 @@ export const collections = {
schema: appsSchema,
type: "data",
}),
"changelogs-next": defineCollection({
schema: changelogsNextSchema,
}),
};
1 change: 1 addition & 0 deletions src/icons/release-notes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading