diff --git a/components/Hooks/UseWorkshopsCard.js b/components/Hooks/UseWorkshopsCard.js index 62fd2b8..391cf6e 100644 --- a/components/Hooks/UseWorkshopsCard.js +++ b/components/Hooks/UseWorkshopsCard.js @@ -77,7 +77,7 @@ export default function UseWorkshopCard({ workshop, gitUser, gitRepo, instUser, } }, [coverimage]) - const workshopLink = '../dynamic/?user=' + gitUser + '&repo=' + gitRepo + '&file=' + workshop.name.split('.')[0] + '&instUser=' + instUser + '&instRepo=' + instRepo; + const workshopLink = '../dynamic?user=' + gitUser + '&repo=' + gitRepo + '&file=' + workshop.name.split('.')[0] + '&instUser=' + instUser + '&instRepo=' + instRepo; if(parsedWorkshop?.data?.published === false){ console.log('not published', parsedWorkshop.data.title) diff --git a/next.config.js b/next.config.js index 8df7c80..35696c3 100644 --- a/next.config.js +++ b/next.config.js @@ -1,28 +1,19 @@ -const withYAML = require('next-yaml') -const withPlugins = require('next-compose-plugins') + +const { default: next } = require('next'); const withMDX = require('@next/mdx')({ extension: /\.(md|mdx)$/, }) const isGitHub = process.env.GITHUB_ACTIONS === "true"; console.log(`Running in ${isGitHub ? "GitHub Actions" : "local"} mode`); -var repoName; -if (isGitHub) { - repoName = process.env.GITHUB_REPOSITORY.split('/')[1]; -}else{ - repoName = 'dhrift'; -} -const build = process.env.NODE_ENV === "production"; -console.log(`Running in ${process.env.NODE_ENV} mode`); -process.env.NEXT_PUBLIC_REPO_NAME = repoName + process.env.NEXT_PUBLIC_GITHUB_ACTIONS = process.env.GITHUB_ACTIONS || false; process.env.NEXT_PUBLIC_GITHUBSECRET = process.env.GITHUBSECRET || false; const nextConfig = { output: "export", - trailingSlash: true, - // basePath: isGitHub ? '/' + repoName : '', - // assetPrefix: isGitHub ? '/' + repoName : '', + // trailingSlash: true, + // basePath: process.env.PAGES_PATH || '', images: { unoptimized: true, }, @@ -33,7 +24,5 @@ const nextConfig = { console.log(nextConfig); -module.exports = withPlugins([ - [withYAML], - // [withMDX], -], nextConfig); \ No newline at end of file + +module.exports = nextConfig; \ No newline at end of file diff --git a/pages/index.js b/pages/index.js index 9a3d775..c025222 100644 --- a/pages/index.js +++ b/pages/index.js @@ -5,7 +5,8 @@ import { useEffect } from 'react' export default function Home() { useEffect(() => { - window.location = '/inst?instUser=dhri-curriculum&instRepo=dhrift-site-template' + const urlBase = window.location.href.split('?')[0] + window.location = urlBase + '/inst?instUser=dhri-curriculum&instRepo=dhrift-site-template' }) return (