Skip to content

Commit 1cf14cc

Browse files
committed
Merging HEAD back into the branch.
Merge commit '0f09c28c413323635a155d4a443d8551bb2218be' into do-migrations
2 parents 46e363c + 0f09c28 commit 1cf14cc

File tree

792 files changed

+12064
-7565
lines changed

Some content is hidden

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

792 files changed

+12064
-7565
lines changed

.github/styles/config/vocabularies/cloudflare/accept.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cloudflared
77
Datadog
88
GitHub
99
GitLab
10+
HashiCorp
1011
Hono
1112
HTTP
1213
HTTPS

.github/workflows/api-links-crawl.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/image-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: find-files
2222
run: |
2323
# Find all .png and .svg files, but only look in the ./src/assets/images directory
24-
FILES=$(find . -type f \( -name "*.png" -o -name "*.svg" \) -path "./src/assets/images/*")
24+
FILES=$(find . -type f \( -name "*.png" -o -name "*.svg" \) -path "./src/assets/images/*" -not -path "./src/assets/images/workers-ai/*.svg" -not -path "./src/assets/images/workers/ai/*.png" -not -path "./src/assets/images/changelog-next/*")
2525
2626
# Check if files are referenced in any markdown file
2727
UNUSED_FILES=""

astro.config.ts

Lines changed: 40 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@ import tailwind from "@astrojs/tailwind";
44
import starlightDocSearch from "@astrojs/starlight-docsearch";
55
import starlightImageZoom from "starlight-image-zoom";
66
import liveCode from "astro-live-code";
7-
import rehypeMermaid from "rehype-mermaid";
8-
import rehypeAutolinkHeadings, {
9-
type Options as rehypeAutolinkHeadingsOptions,
10-
} from "rehype-autolink-headings";
11-
import rehypeExternalLinks from "rehype-external-links";
127
import starlightLinksValidator from "starlight-links-validator";
13-
import { h } from "hastscript";
14-
import { readdir } from "fs/promises";
158
import icon from "astro-icon";
169
import sitemap from "@astrojs/sitemap";
1710
import react from "@astrojs/react";
18-
import rehypeTitleFigure from "rehype-title-figure";
19-
import rehypeHeadingSlugs from "./plugins/rehype/heading-slugs";
11+
import { readdir } from "fs/promises";
2012

21-
const runLinkCheck = process.env.RUN_LINK_CHECK || false;
13+
import rehypeTitleFigure from "rehype-title-figure";
14+
import rehypeMermaid from "./src/plugins/rehype/mermaid.ts";
15+
import rehypeAutolinkHeadings from "./src/plugins/rehype/autolink-headings.ts";
16+
import rehypeExternalLinks from "./src/plugins/rehype/external-links.ts";
17+
import rehypeHeadingSlugs from "./src/plugins/rehype/heading-slugs.ts";
18+
import { fileURLToPath } from "url";
2219

2320
async function autogenSections() {
2421
const sections = (
@@ -38,73 +35,27 @@ async function autogenSections() {
3835
};
3936
});
4037
}
41-
const AnchorLinkIcon = h(
42-
"span",
43-
{
44-
ariaHidden: "true",
45-
class: "anchor-icon",
46-
},
47-
h(
48-
"svg",
49-
{
50-
width: 16,
51-
height: 16,
52-
viewBox: "0 0 24 24",
53-
},
54-
h("path", {
55-
fill: "currentcolor",
56-
d: "m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z",
57-
}),
58-
),
59-
);
60-
const autolinkConfig: rehypeAutolinkHeadingsOptions = {
61-
properties: {
62-
class: "anchor-link",
63-
},
64-
behavior: "after",
65-
group: ({ tagName }) =>
66-
h("div", {
67-
tabIndex: -1,
68-
class: `heading-wrapper level-${tagName}`,
69-
}),
70-
content: () => [AnchorLinkIcon],
71-
};
38+
39+
const sidebar = await autogenSections();
40+
41+
const runLinkCheck = process.env.RUN_LINK_CHECK || false;
7242

7343
// https://astro.build/config
7444
export default defineConfig({
7545
site: "https://developers.cloudflare.com",
7646
markdown: {
7747
smartypants: false,
7848
rehypePlugins: [
79-
[
80-
rehypeMermaid,
81-
{
82-
strategy: "pre-mermaid",
83-
},
84-
],
85-
[
86-
rehypeExternalLinks,
87-
{
88-
content: {
89-
type: "text",
90-
value: " ↗",
91-
},
92-
properties: {
93-
target: "_blank",
94-
},
95-
rel: ["noopener"],
96-
},
97-
],
49+
rehypeMermaid,
50+
rehypeExternalLinks,
9851
rehypeHeadingSlugs,
99-
[rehypeAutolinkHeadings, autolinkConfig],
100-
// @ts-expect-error TODO: fix types
52+
rehypeAutolinkHeadings,
53+
// @ts-expect-error plugins types are outdated but functional
10154
rehypeTitleFigure,
10255
],
10356
},
10457
experimental: {
10558
contentIntellisense: true,
106-
contentLayer: true,
107-
directRenderScript: true,
10859
},
10960
server: {
11061
port: 1111,
@@ -116,29 +67,15 @@ export default defineConfig({
11667
src: "./src/assets/logo.svg",
11768
},
11869
favicon: "/favicon.png",
119-
head: [
120-
{
121-
tag: "meta",
122-
attrs: {
123-
name: "image",
124-
content: "https://developers.cloudflare.com/cf-twitter-card.png",
125-
},
126-
},
127-
{
70+
head: ["image", "og:image", "twitter:image"].map((name) => {
71+
return {
12872
tag: "meta",
12973
attrs: {
130-
name: "og:image",
74+
name,
13175
content: "https://developers.cloudflare.com/cf-twitter-card.png",
13276
},
133-
},
134-
{
135-
tag: "meta",
136-
attrs: {
137-
name: "twitter:image",
138-
content: "https://developers.cloudflare.com/cf-twitter-card.png",
139-
},
140-
},
141-
],
77+
};
78+
}),
14279
social: {
14380
github: "https://github.com/cloudflare/cloudflare-docs",
14481
"x.com": "https://x.com/cloudflare",
@@ -152,27 +89,24 @@ export default defineConfig({
15289
Footer: "./src/components/overrides/Footer.astro",
15390
Head: "./src/components/overrides/Head.astro",
15491
Hero: "./src/components/overrides/Hero.astro",
155-
LastUpdated: "./src/components/overrides/LastUpdated.astro",
15692
MarkdownContent: "./src/components/overrides/MarkdownContent.astro",
15793
Sidebar: "./src/components/overrides/Sidebar.astro",
158-
PageSidebar: "./src/components/overrides/PageSidebar.astro",
15994
PageTitle: "./src/components/overrides/PageTitle.astro",
16095
SocialIcons: "./src/components/overrides/SocialIcons.astro",
161-
SkipLink: "./src/components/overrides/SkipLink.astro",
16296
TableOfContents: "./src/components/overrides/TableOfContents.astro",
16397
},
164-
sidebar: await autogenSections(),
98+
sidebar,
16599
customCss: [
166100
"./src/asides.css",
101+
"./src/badges.css",
167102
"./src/code.css",
103+
"./src/footnotes.css",
168104
"./src/headings.css",
169105
"./src/input.css",
170-
"./src/littlefoot.css",
171106
"./src/mermaid.css",
172107
"./src/table.css",
173108
"./src/tailwind.css",
174109
"./src/title.css",
175-
"./src/tooltips.css",
176110
],
177111
pagination: false,
178112
plugins: [
@@ -219,11 +153,28 @@ export default defineConfig({
219153
}),
220154
icon(),
221155
sitemap({
156+
filter(page) {
157+
return !page.startsWith(
158+
"https://developers.cloudflare.com/style-guide/",
159+
);
160+
},
222161
serialize(item) {
223162
item.lastmod = new Date().toISOString();
224163
return item;
225164
},
226165
}),
227166
react(),
228167
],
168+
vite: {
169+
resolve: {
170+
alias: {
171+
"./Page.astro": fileURLToPath(
172+
new URL("./src/components/overrides/Page.astro", import.meta.url),
173+
),
174+
"../components/Page.astro": fileURLToPath(
175+
new URL("./src/components/overrides/Page.astro", import.meta.url),
176+
),
177+
},
178+
},
179+
},
229180
});

bin/crawl-api-links.js

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)