Skip to content

Commit

Permalink
Add /go/... links to link to from CLI (denoland#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato authored Jul 26, 2024
1 parent 3114421 commit 7bd99a8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ site.copy("deploy/kv/tutorials/images");
site.copy("runtime/manual/images");
site.copy("deploy/manual/images");
site.copy("deno.json");
site.copy("go.json");
site.copy("server.ts");
site.copy("middleware.ts");

Expand Down
5 changes: 5 additions & 0 deletions go.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"permissions": "/runtime/manual/basics/permissions/",
"config": "/runtime/manual/getting_started/configuration_file/",
"ide": "/runtime/manual/getting_started/setup_your_environment/#using-an-editor%2Fide"
}
5 changes: 5 additions & 0 deletions server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Server from "lume/core/server.ts";
import REDIRECTS from "./_redirects.json" with { type: "json" };
import GO_LINKS from "./go.json" with { type: "json" };
import {
type Event,
formatStatus,
Expand All @@ -17,6 +18,10 @@ const server = new Server({

REDIRECTS["/api/"] = "/api/deno/";

for (const [name, url] of Object.entries(GO_LINKS)) {
REDIRECTS[`/go/${name}/`] = url;
}

const GA4_MEASUREMENT_ID = Deno.env.get("GA4_MEASUREMENT_ID");
function ga4(
request: Request,
Expand Down

0 comments on commit 7bd99a8

Please sign in to comment.