Skip to content

Commit 1dd8b2d

Browse files
authored
Merge branch 'main' into feat/view-markdown-button
2 parents d8ef553 + 40715ab commit 1dd8b2d

File tree

15 files changed

+814
-275
lines changed

15 files changed

+814
-275
lines changed

_components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function (
1010
) {
1111
const hrefIsInCurrentSection = (href: string, currentSection: string) => {
1212
return href.includes(currentSection) ||
13-
href === "/services/" &&
13+
href === "/deploy/" &&
1414
["deploy", "subhosting", "services", "sandbox"].includes(
1515
currentSection,
1616
);

_config.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import title from "https://deno.land/x/lume_markdown_plugins@v0.7.0/title.ts";
1616
import toc from "https://deno.land/x/lume_markdown_plugins@v0.7.0/toc.ts";
1717
// See note below about GFM CSS
1818
// import { CSS as GFM_CSS } from "https://jsr.io/@deno/gfm/0.11.0/style.ts";
19+
import { walk } from "@std/fs";
20+
import { dirname } from "@std/path";
1921
import { log } from "lume/core/utils/log.ts";
2022
import anchor from "npm:markdown-it-anchor@9";
2123
import admonitionPlugin from "./markdown-it/admonition.ts";
@@ -28,6 +30,7 @@ import createRoutingMiddleware from "./middleware/functionRoutes.ts";
2830
import createGAMiddleware from "./middleware/googleAnalytics.ts";
2931
import redirectsMiddleware from "./middleware/redirects.ts";
3032
import createLlmsFilesMiddleware from "./middleware/llmsFiles.ts";
33+
import createMarkdownSourceMiddleware from "./middleware/markdownSource.ts";
3134
import { toFileAndInMemory } from "./utils/redirects.ts";
3235
import { cliNow } from "./timeUtils.ts";
3336

@@ -73,6 +76,7 @@ const site = lume(
7376
server: {
7477
middlewares: [
7578
redirectsMiddleware,
79+
createMarkdownSourceMiddleware({ root: "_site" }),
7680
createRoutingMiddleware(),
7781
createGAMiddleware({
7882
addr: { transport: "tcp", hostname: "localhost", port: 3000 },
@@ -230,6 +234,49 @@ site.addEventListener("afterBuild", async () => {
230234
log.error("Error generating LLMs files:" + error);
231235
}
232236
}
237+
238+
// Copy source .md files to _site so AI agents can request them directly.
239+
// Excludes "reference/" (dynamically generated, no static .md source files).
240+
const contentDirs = [
241+
"runtime",
242+
"deploy",
243+
"sandbox",
244+
"subhosting",
245+
"examples",
246+
];
247+
let mdCopied = 0;
248+
let mdErrors = false;
249+
for (const dir of contentDirs) {
250+
// Skip directories that don't exist in this build
251+
try {
252+
await Deno.stat(dir);
253+
} catch (error) {
254+
if (!(error instanceof Deno.errors.NotFound)) {
255+
log.error(`Error accessing content directory ${dir}: ${error}`);
256+
}
257+
continue;
258+
}
259+
try {
260+
for await (
261+
const entry of walk(dir, { exts: [".md"], includeDirs: false })
262+
) {
263+
const destPath = site.dest(entry.path);
264+
await Deno.mkdir(dirname(destPath), { recursive: true });
265+
await Deno.copyFile(entry.path, destPath);
266+
mdCopied++;
267+
}
268+
} catch (error) {
269+
log.error(`Error copying markdown files from ${dir}: ${error}`);
270+
mdErrors = true;
271+
}
272+
}
273+
if (mdErrors) {
274+
log.warn(
275+
`Copied ${mdCopied} source markdown files to _site (some directories had errors, see above)`,
276+
);
277+
} else {
278+
log.info(`Copied ${mdCopied} source markdown files to _site`);
279+
}
233280
});
234281

235282
site.copy("reference_gen/gen/deno/page.css", "/api/deno/page.css");

_data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"href": "/examples/"
1414
},
1515
{
16-
"name": "Services",
17-
"href": "/services/",
16+
"name": "Deno Deploy",
17+
"href": "/deploy/",
1818
"style": "services"
1919
}
2020
],

_includes/layout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ export default function Layout(data: Lume.Data) {
5151
type="font/woff2"
5252
crossOrigin="anonymous"
5353
/>
54+
{data.page?.sourcePath?.endsWith(".md") && data.url !== "/" && (
55+
<link
56+
rel="alternate"
57+
type="text/markdown"
58+
href={data.page.sourcePath.endsWith("/index.md")
59+
? `/${data.page.sourcePath}`
60+
: `${data.url.replace(/\/$/, "")}.md`}
61+
/>
62+
)}
5463
<link rel="me" href="https://fosstodon.org/@deno_land" />
5564
<data.comp.OpenGraph
5665
title={data.title}

deploy/early-access/reference/builds.md

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

deploy/index.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ title: "About Deno Deploy"
33
description: "Guide to Deno Deploy features, comparison with Deploy Classic, and getting started instructions for deployment."
44
---
55

6-
<a href="https://console.deno.com" class="docs-cta deploy-cta">Go to the Deno
7-
Deploy dashboard</a>
6+
<div class="lg:flex lg:flex-row lg:gap-8">
7+
<img src="/deno-deploy.svg" alt="Deno Deploy logo" style="max-width: 120px" />
8+
<p class="text-lg text-foreground-secondary mt-6">Deno's cloud services provide robust platforms for deploying and running JavaScript and TypeScript applications at global scale.<a href="https://console.deno.com" class="docs-cta deploy-cta mt-2">Go to the Deno
9+
Deploy dashboard</a></p>
810

9-
Deno Deploy comes with an easy to use dashboard at
10-
[console.deno.com](https://console.deno.com). In this dashboard, you can create
11-
new Deno Deploy organizations that contain Deno Deploy apps.
12-
13-
Within a single organization, you cannot mix Deno Deploy apps with Deploy
14-
Classic projects. You can switch between different organizations using the
15-
organization picker in the top left of the dashboard.
11+
</div>
1612

1713
## What is Deno Deploy?
1814

@@ -21,6 +17,11 @@ applications in the cloud (or self-hosted on your own infrastructure). It
2117
provides a management plane for deploying and running applications with the
2218
built-in CI or through integrations such as GitHub actions.
2319

20+
Deno Deploy comes with an easy to use dashboard at
21+
[console.deno.com](https://console.deno.com). Here, you can create and host new
22+
apps, create and manage Deno Deploy organizations and manage and view your
23+
databases and app telemetry.
24+
2425
## Comparison to Deploy Classic
2526

2627
Deno Deploy is a complete rework of Deploy Classic. It has a new dashboard, and

deploy/reference/builds.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ Environment variables configured for the "Build" context are available during
251251
builds, but variables from "Production" or "Development" contexts are not.
252252
[Learn more about environment variables](/deploy/reference/env_vars_and_contexts/).
253253

254+
The following environment variables are additionally always available during
255+
builds:
256+
257+
- `CI`: `true`
258+
- `DENO_DEPLOY`: `true` - Indicates that the code is running in Deno Deploy.
259+
- `DENO_DEPLOY_ORGANIZATION_ID`: The ID of the organization that owns the
260+
application. This is a UUID.
261+
- `DENO_DEPLOY_ORGANIZATION_SLUG`: The slug of the organization that owns the
262+
application. This is the human-readable identifier used in URLs that was set
263+
when creating the organization.
264+
- `DENO_DEPLOY_APPLICATION_ID`: The ID of the application. This is a UUID.
265+
- `DENO_DEPLOY_APPLICATION_SLUG`: The slug of the application. This is the
266+
human-readable identifier used in URLs that was set when creating the
267+
application, or changed later in the application settings.
268+
- `DENO_DEPLOY_BUILD_ID`: The ID of the currently running build.
269+
254270
Builders have the following resources available during the build process:
255271

256272
- 2 vCPUs

0 commit comments

Comments
 (0)