Skip to content

Commit 78e87db

Browse files
authored
Merge branch 'cloudflare:production' into production
2 parents 7b0a91f + 88f3c26 commit 78e87db

File tree

81 files changed

+783
-643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+783
-643
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1,169 +1,9 @@
1-
# Contributing to Cloudflare's documentation
1+
# Contributing to Cloudflare's developer documentation
22

3-
Before contributing code to Cloudflare's documentation, please read the following guidelines carefully.
3+
Everyone, including those who are not part of the Cloudflare organization, are encouraged to contribute.
4+
- If you are not a Cloudflare employee, learn how to contribute in the [contribution page](https://developers.cloudflare.com/style-guide/contributions/) of the Cloudflare Style Guide.
5+
- If you are a Cloudflare employee, reach out via our Developer Docs space in Google chat.
46

5-
## Have feedback for our documentation? Open an issue
7+
Consult the [Cloudflare Style Guide](https://developers.cloudflare.com/style-guide/) on everything from grammar, to formatting, to frontmatter requirements. Browse our [components](/style-guide/components/) to add additional formatting such as [notes](/style-guide/documentation-content-strategy/component-attributes/notes-tips-warnings/) and [code blocks](/style-guide/components/code/).
68

7-
[Open an issue](https://github.com/cloudflare/cloudflare-docs/issues/new/choose) when something in our documentation is incorrect, out-of-date, or if the documentation doesn’t match the actual functionality.
8-
9-
## Before submitting a PR, open an issue
10-
11-
Before proposing significant changes, such as adding a new page, [open an issue](https://github.com/cloudflare/cloudflare-docs/issues/new/choose) so that we can discuss your approach first. Only members of the Cloudflare organization can open a pull request on the repository, and they should follow the same guidance on opening an issue for significant changes. If you’re not part of the Cloudflare organization but want to contribute, fork the repository and then create a pull request.
12-
13-
A member of the Product Content Experience team will review the pull request. If the changes are straightforward, the pull request is approved and can be merged. If the pull request is more technical and requires an additional review, the new reviewer will leave any additional feedback.
14-
15-
If a pull request is not approved, the “won't fix” label is applied and a comment is added to explain why the pull request was closed.
16-
17-
If we require more information to address your pull request, the `more-information-needed` label will be applied to the pull request. If more information has not been provided within fourteen days, the pull request will automatically close.
18-
19-
### Pull Request Guidelines
20-
21-
- Commits and commit messages
22-
- Use smaller commits for your work to make it easier to review. In your commit messages, be specific about what you changed in the files.
23-
- If you are proposing a new page, review our [content type guidelines](https://developers.cloudflare.com/style-guide/documentation-content-strategy/content-types/) for options and templates.
24-
- Pull request titles
25-
- Follow the title structure of [Product Name] + work you did + affected file(s)
26-
- Example: [Access] fix broken link in example_file.md
27-
- Pull request descriptions
28-
- Use bullet points to summarize the changes in the commits
29-
- Add any other information you think is helpful or needs to be addressed. If your PR fixes an open issue, indicate that your PR is addressing the issue and provide a link to the issue.
30-
31-
## Package manager
32-
33-
- [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager#introduction-to-npm) is the recommended package manager that must be used in installing dependencies.
34-
- The generated `package-lock.json` file must be committed to git.
35-
36-
## Wrangler config
37-
38-
If you are adding a code snippet to the docs that represents a Wrangler config file (`wrangler.toml`, `wrangler.json`, or `wrangler.jsonc`) make sure you wrap it with the `<WranglerConfig>` component, which ensures it is rendered as both JSON and TOML. For example:
39-
40-
````
41-
42-
import { WranglerConfig } from "~/components";
43-
44-
<WranglerConfig>
45-
46-
```toml
47-
# Top-level configuration
48-
name = "my-worker"
49-
main = "src/index.js"
50-
compatibility_date = "2022-07-12"
51-
52-
workers_dev = false
53-
route = { pattern = "example.org/*", zone_name = "example.org" }
54-
55-
kv_namespaces = [
56-
{ binding = "<MY_NAMESPACE>", id = "<KV_ID>" }
57-
]
58-
59-
[env.staging]
60-
name = "my-worker-staging"
61-
route = { pattern = "staging.example.org/*", zone_name = "example.org" }
62-
63-
kv_namespaces = [
64-
{ binding = "<MY_NAMESPACE>", id = "<STAGING_KV_ID>" }
65-
]
66-
```
67-
68-
</WranglerConfig>
69-
70-
````
71-
72-
## Workers Playground
73-
74-
If you are adding a code snippet to the docs that is:
75-
76-
1. A fully contained, valid Worker (i.e. it does not require external dependencies or specific bindings)
77-
2. Only JavaScript
78-
79-
you can add `playground: true` to the code block metadata to render a button to let users open the Worker in the [Playground](https://workers.new). For example:
80-
81-
````
82-
```js
83-
---
84-
playground: true
85-
---
86-
export default {
87-
async fetch(request) {
88-
/**
89-
* Replace `remote` with the host you wish to send requests to
90-
*/
91-
const remote = "https://example.com";
92-
93-
return await fetch(remote, request);
94-
},
95-
};
96-
```
97-
````
98-
99-
would render as
100-
101-
<img width="870" alt="Screenshot 2024-02-20 at 14 29 22" src="https://github.com/cloudflare/cloudflare-docs/assets/28503158/56aa8016-b3b6-4d64-8213-b1a26f16534a">
102-
103-
## GraphQL API Explorer
104-
105-
If you are adding a code snippet to the documentation that is an executable GraphQL query, you can add `graphql-api-explorer` right after `graphql` in the code block metadata (both must be present). This will render a button that allows users to open the query in the [GraphQL API Explorer](https://graphql.cloudflare.com/explorer). For example:
106-
107-
````
108-
```graphql graphql-api-explorer title="A GraphQL query"
109-
query GraphqlExample($zoneTag: string, $start: Time, $end: Time) {
110-
viewer {
111-
zones(filter: { zoneTag: $zoneTag }) {
112-
firewallEventsAdaptive(
113-
filter: { datetime_gt: $start, datetime_lt: $end }
114-
limit: 2
115-
orderBy: [datetime_DESC]
116-
) {
117-
action
118-
datetime
119-
host: clientRequestHTTPHost
120-
}
121-
}
122-
}
123-
}
124-
```
125-
````
126-
127-
When a user selects the `Run in GraphQL API Explorer` button, the following variables will be pre-populated in the GraphQL API Explorer along with the query.
128-
129-
:::note
130-
The user must be logged in or have an API token saved to see the query and variables pre-populated.
131-
:::
132-
133-
```
134-
{"zoneTag":"ZONE_ID", "start":"2025-05-07T14:54:36Z", "end":"2025-05-07T20:54:36Z"}
135-
```
136-
137-
### Conventions to auto populate `Variables` section in the GraphQL API Explorer
138-
139-
By default, the `Variables` section will be automatically populated based on the variables used in the GraphQL query.
140-
141-
- Any variable name that includes `start` and has a type of `Time` --> start: "2025-05-09T14:58:06Z" (6 hours from the current time)
142-
- e.g. `datetimeStart` also has `start` keyword, so it will be recognized for a start time (or date)
143-
- Any variable name that includes `end` and has a type of `Time` --> end: "2025-05-09T20:58:06Z" (current time)
144-
- Any variable name that includes `start` and has a type of `Date` --> start: "2025-05-07" (24 hours from the current date)
145-
- Any variable name that includes `end` and has a type of `Date` --> end: "2025-05-08" (current date)
146-
- `zoneTag` and has a type of `string` --> zoneTag: "ZONE_ID"
147-
- `accountTag` and has a type of `string` --> accountTag: "ACCOUNT_ID"
148-
- Any variable name that includes `id` and has a type of `string` --> id: "REPLACE_WITH_ID"
149-
- Any variable name and has a type of string --> anyString: "REPLACE_WITH_STRING"
150-
- `limit` with type `*int*` --> limit: 100
151-
152-
In addition to the variables that are automatically populated, you can add custom variables by setting their values as a JSON string in the `graphql-api-explorer` metadata.
153-
154-
````
155-
```graphql graphql-api-explorer='{"uID": "something"}' title="A GraphQL query"
156-
query GraphqlExample($zoneTag: string, $start: Time, $end: Time) {
157-
viewer {
158-
zones(filter: { zoneTag: $zoneTag }) {
159-
...
160-
}
161-
}
162-
}
163-
````
164-
165-
The variables added via the metadata value will be merged with the automatically populated variables.
166-
167-
```
168-
{"zoneTag":"ZONE_ID", "start":"2025-05-07T14:54:36Z", "end":"2025-05-07T20:54:36Z", "uId": "something"}
169-
```
9+
Thank you for helping us to maintain quality documentation.

README.md

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,8 @@
1-
# Cloudflare Docs
1+
# Cloudflare Developer Documentation
22

3-
**[View the docs →](https://developers.cloudflare.com/)**
3+
Welcome to the open-source repository for all [Cloudflare Developer Documentation](https://developers.cloudflare.com/).
44

5-
## Why Cloudflare Docs is open source
6-
7-
Our documentation is open source so that we can stay connected with our community and quickly implement feedback. Whether you have opened an issue to provide feedback or contributed your own content, we thank you for helping us maintain quality documentation.
8-
9-
If you have any feedback for our documentation or are interested in contributing, please refer to our [contribution guidelines.](https://github.com/cloudflare/cloudflare-docs/blob/production/CONTRIBUTING.md)
10-
11-
## Setup
12-
13-
You must have a recent version of Node.js (22+) installed. You may use [Volta](https://github.com/volta-cli/volta), a Node version manager, to install the latest version of Node and `npm`, which is a package manager that is included with `node`'s installation.
14-
15-
```sh
16-
$ curl https://get.volta.sh | bash
17-
$ volta install node@22
18-
```
19-
20-
Install the Node.js dependencies for this project using npm or another package manager:
21-
22-
```sh
23-
$ npm install
24-
```
25-
26-
## Development
27-
28-
When making changes to the site, including any content changes, you may run a local development server by running the following command:
29-
30-
```sh
31-
$ npm run dev
32-
```
33-
34-
This spawns a server that will be accessible via `http://localhost:1111` in your browser. Additionally, any changes made within the project – including `content/**` changes – will automatically reload your browser tab(s), allowing you to instantly preview your changes.
35-
36-
## Deployment
37-
38-
Our docs are deployed using [Cloudflare Pages](https://pages.cloudflare.com). Every commit pushed to production will automatically deploy to [developers.cloudflare.com](https://developers.cloudflare.com), and any pull requests opened will have a corresponding staging URL available in the pull request comments.
39-
40-
## For Cloudflare employees
41-
42-
To get write access to this repo, please reach out to the **Developer Docs** room in chat.
5+
To learn how to contribute, visit the [contribution page](https://developers.cloudflare.com/style-guide/contributions/) of the Cloudflare Style Guide.
436

447
## License and Legal Notices
458

@@ -49,19 +12,3 @@ Cloudflare products and services referenced in the documentation may be either t
4912
Cloudflare and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel, or otherwise.
5013

5114
Please note that we may use AI tools to help us review technical documentation, pull requests and other issues submitted to our public GitHub page in order to identify and correct mistakes and other inconsistencies in our developer documentation. Please refrain from sharing any personal information in your submissions.
52-
53-
54-
## 🧞 Commands
55-
56-
All commands are run from the root of the project, from a terminal:
57-
58-
| Command | Action |
59-
|:--------------------------|:--------------------------------------------|
60-
| `npm install` | Installs dependencies |
61-
| `npm run dev` | Starts local dev server at `localhost:1111` |
62-
| `npx astro build` | Build your production site to `./dist/` |
63-
| `npm run astro -- --help` | Get help using the Astro CLI |
64-
65-
## 👀 Want to learn more?
66-
67-
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

public/__redirects

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@
153153
/ai-audit/features/enforce-robots-txt/ /ai-crawl-control/features/analyze-ai-crawlers/ 301
154154
/ai-audit/features/analyze-ai-crawlers/ /ai-crawl-control/features/analyze-ai-traffic/ 301
155155

156+
# ai crawl control
157+
/ai-crawl-control/reference/faq/ /ai-crawl-control/features/pay-per-crawl/faq/ 301
158+
/ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/set-up-cloudflare-account/ /ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/enable-in-account-settings/ 301
159+
/ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/connect-to-stripe/ /ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/manage-payouts/ 301
160+
/ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/monitor-metrics/ /ai-crawl-control/features/pay-per-crawl/use-pay-per-crawl-as-site-owner/monitor-activity/ 301
161+
156162
# AI Gateway
157163
/ai-gateway/get-started/configuring-settings/ /ai-gateway/get-started/ 301
158164
/ai-gateway/get-started/connecting-applications/ /ai-gateway/get-started/ 301
@@ -209,7 +215,7 @@
209215
/analytics/analytics-integrations/google-cloud/ /analytics/analytics-integrations/ 301
210216
/analytics/dashboards/ /log-explorer/custom-dashboards/ 301
211217
/analytics/analytics-integrations/looker/ /analytics/analytics-integrations/ 301
212-
/analytics/network-analytics/reference/network-analytics-v1/ /analytics/graphql-api/migration-guides/network-analytics-v2/ 301
218+
/analytics/network-analytics/reference/network-analytics-v1/ /analytics/graphql-api/migration-guides/network-analytics-v2/ 301
213219

214220
# email-security
215221
/email-security/reporting/search/detection-search/ /email-security/reporting/search/ 301
352 KB
Loading
83.1 KB
Loading
72.3 KB
Loading
110 KB
Loading
90 KB
Loading

src/components/changelog/ProductSelect.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ export default function ProductSelect({ products, groups }: Props) {
6565
select.value = option.value;
6666
select.dispatchEvent(event);
6767
}
68+
69+
const search = document.querySelector<HTMLAnchorElement>(
70+
"#changelog-search-button",
71+
);
72+
73+
if (search) {
74+
if (
75+
options
76+
.find((opt) => opt.label === "Products")
77+
?.options?.includes(option)
78+
) {
79+
search.href = `/search/?contentType=Changelog+entry&product=${encodeURIComponent(option.label)}`;
80+
} else {
81+
search.href = `/search/?contentType=Changelog+entry`;
82+
}
83+
}
6884
};
6985

7086
return (

src/components/search/InstantSearch.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
FloatingPortal,
2222
} from "@floating-ui/react";
2323
import { PiCaretDownBold } from "react-icons/pi";
24+
import { subDays } from "date-fns";
2425
import { setSearchParams } from "~/util/url";
2526
import he from "he";
2627

@@ -73,6 +74,13 @@ function InfiniteHits(props: UseInfiniteHitsProps) {
7374
.map(([, value]) => value);
7475

7576
const title = hierarchy ? hierarchy.join(" > ") : "Documentation";
77+
const today = new Date();
78+
const futureDate = subDays(today, item.lastModified);
79+
const options: Intl.DateTimeFormatOptions = {
80+
year: "numeric",
81+
month: "long",
82+
day: "numeric",
83+
};
7684

7785
return (
7886
<a
@@ -84,6 +92,11 @@ function InfiniteHits(props: UseInfiniteHitsProps) {
8492
<p className="line-clamp-2">
8593
<Highlight attribute="content" hit={item} />
8694
</p>
95+
{item.lastModified && (
96+
<span className="text-cl1-gray-4! dark:text-cl1-gray-7! mt-2 text-sm">
97+
{futureDate.toLocaleDateString("en-US", options)}
98+
</span>
99+
)}
87100
</a>
88101
);
89102
})}

0 commit comments

Comments
 (0)