diff --git a/next.config.mjs b/next.config.mjs index 0bb51153..409f16cb 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -53,6 +53,14 @@ const nextConfig = { source: "/assets/pdfjs/:path*", // Match any URL starting with /workspace/content/assets/ destination: `${process.env.WORKSPACE_BASE_URL}/assets/pdfjs/:path*`, // Serve the assets from the public folder }, + { + source: "/play/content/assets/pdfjs/:path*", // Match any URL starting with /workspace/content/assets/ + destination: `${process.env.WORKSPACE_BASE_URL}/assets/pdfjs/:path*`, // Serve the assets from the public folder + }, + { + source: "/play/content/assets/:path*", // Match any URL starting with /workspace/content/assets/ + destination: `${process.env.WORKSPACE_BASE_URL}/assets/:path*`, // Serve the assets from the public folder + }, { source: "/action/content/v3/upload/url/:identifier*", // Match content upload with 'url' in the path destination: `${process.env.WORKSPACE_BASE_URL}/api/proxy?path=/action/content/v3/upload/url/:identifier*`, // Forward to proxy route with path as query param diff --git a/src/components/ResourceCard.tsx b/src/components/ResourceCard.tsx index 5147544f..20ad23d3 100644 --- a/src/components/ResourceCard.tsx +++ b/src/components/ResourceCard.tsx @@ -18,12 +18,7 @@ const ResourceCard: React.FC = ({ identifier, }) => { const openPlayers = () => { - console.log("open players"); - console.log("identifier", identifier); - router.push({ - pathname: "/players", - query: { identifier: identifier }, - }); + router.push(`/play/content/${identifier}`); }; return ( diff --git a/src/pages/players.tsx b/src/pages/play/content/[identifier].tsx similarity index 93% rename from src/pages/players.tsx rename to src/pages/play/content/[identifier].tsx index b83239f4..6265dfef 100644 --- a/src/pages/players.tsx +++ b/src/pages/play/content/[identifier].tsx @@ -109,10 +109,20 @@ const players: React.FC = () => { return !loading ? : null; }; -export async function getStaticProps({ locale }: any) { +export async function getStaticPaths() { + return { + paths: [], + fallback: "blocking", + }; +} + +export async function getStaticProps({ locale, params }: any) { + const { identifier } = params; + return { props: { noLayout: true, + identifier, ...(await serverSideTranslations(locale, ["common"])), }, };