Skip to content

Commit

Permalink
Merge pull request #919 from MuckRock/917-note-embeds
Browse files Browse the repository at this point in the history
Redirect page and note endpoints to embed versions
  • Loading branch information
eyeseast authored Dec 3, 2024
2 parents 9a8361b + 5147167 commit 39e3318
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/routes/(app)/documents/[id]/annotations/[note_id]/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { redirect } from "@sveltejs/kit";

import { EMBED_URL } from "@/config/config.js";

// redirect to embed route
export function load({ url }) {
const u = new URL(url);

u.searchParams.set("embed", "1");
u.hostname = EMBED_URL;

return redirect(302, u);
}
13 changes: 13 additions & 0 deletions src/routes/(app)/documents/[id]/pages/[page]/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { redirect } from "@sveltejs/kit";

import { EMBED_URL } from "@/config/config.js";

// redirect to embed route
export function load({ url }) {
const u = new URL(url);

u.searchParams.set("embed", "1");
u.hostname = EMBED_URL;

return redirect(302, u);
}

0 comments on commit 39e3318

Please sign in to comment.