-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📄 Update article theme for single project, consume dataUrl
- Loading branch information
Showing
11 changed files
with
73 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@myst-theme/article': patch | ||
'@myst-theme/site': patch | ||
--- | ||
|
||
Modify article theme to only serve one project with no project slug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'myst-to-react': patch | ||
'@myst-theme/providers': patch | ||
'@myst-theme/site': patch | ||
--- | ||
|
||
Consume dataUrl directly rather than imlpicitly constructing with appened .json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { responseNoArticle, responseNoSite } from '@myst-theme/site'; | ||
import type { LoaderFunction } from '@remix-run/node'; | ||
import { redirect } from '@remix-run/node'; | ||
import { Outlet } from '@remix-run/react'; | ||
import { getConfig } from '~/utils/loaders.server'; | ||
import { ProjectPageCatchBoundary } from '@myst-theme/site'; | ||
import Page, { ArticlePageAndNavigation } from './$slug'; | ||
export { loader, links } from './$slug'; | ||
export default Page; | ||
|
||
export const loader: LoaderFunction = async (): Promise<Response | null> => { | ||
const config = await getConfig(); | ||
if (!config) throw responseNoSite(); | ||
const project = config?.projects?.[0]; | ||
if (!project) throw responseNoArticle(); | ||
return redirect(`/${project.slug}`); | ||
}; | ||
|
||
// Note this is necessary to propagate catch boundaries, even though there is a redirect | ||
export default function Index() { | ||
return <Outlet />; | ||
export function CatchBoundary() { | ||
return ( | ||
<ArticlePageAndNavigation> | ||
<main className="article-content"> | ||
<ProjectPageCatchBoundary /> | ||
</main> | ||
</ArticlePageAndNavigation> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters