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

Add /go/... links to link to from CLI #620

Merged
merged 1 commit into from
Jul 26, 2024
Merged
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
1 change: 1 addition & 0 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ site.copy("deploy/kv/manual/images");
site.copy("deploy/kv/tutorials/images");
site.copy("runtime/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