diff --git a/.changeset/nice-suns-crash.md b/.changeset/nice-suns-crash.md new file mode 100644 index 000000000..ef2b47298 --- /dev/null +++ b/.changeset/nice-suns-crash.md @@ -0,0 +1,6 @@ +--- +"@myst-theme/article": patch +"@myst-theme/book": patch +--- + +Remote CDN and theme button for the article theme diff --git a/README.md b/README.md index 9a2d29f2d..f5b929b69 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,12 @@ To run on a specific port (for example, developing locally between two projects) myst start --headless --server-port 3111 CONTENT_CDN_PORT=3111 npm run theme:book ``` +To connect to a remote content server, set the `CONTENT_CDN` environment variable: + +```bash +CONTENT_CDN=https://remote.example.com npm run theme:book +CONTENT_CDN=https://remote.example.com npm run theme:article +``` ## Deployment diff --git a/themes/article/app/components/ArticlePageAndNavigation.tsx b/themes/article/app/components/ArticlePageAndNavigation.tsx index 4ad72ba37..50564027e 100644 --- a/themes/article/app/components/ArticlePageAndNavigation.tsx +++ b/themes/article/app/components/ArticlePageAndNavigation.tsx @@ -1,10 +1,14 @@ import { GridSystemProvider, TabStateProvider, UiStateProvider } from '@myst-theme/providers'; +import { ThemeButton } from '@myst-theme/site'; export function ArticlePageAndNavigation({ children }: { children: React.ReactNode }) { return ( +
+ +
{children}
diff --git a/themes/article/app/utils/loaders.server.ts b/themes/article/app/utils/loaders.server.ts index bf9ab3063..ce95a1dd3 100644 --- a/themes/article/app/utils/loaders.server.ts +++ b/themes/article/app/utils/loaders.server.ts @@ -11,7 +11,7 @@ import { import { responseNoArticle, responseNoSite, getDomainFromRequest } from '@myst-theme/site'; const CONTENT_CDN_PORT = process.env.CONTENT_CDN_PORT ?? '3100'; -const CONTENT_CDN = `http://localhost:${CONTENT_CDN_PORT}`; +const CONTENT_CDN = process.env.CONTENT_CDN ?? `http://localhost:${CONTENT_CDN_PORT}`; export async function getConfig(): Promise { const url = `${CONTENT_CDN}/config.json`; diff --git a/themes/book/app/utils/loaders.server.ts b/themes/book/app/utils/loaders.server.ts index 502827d87..dc0bdce73 100644 --- a/themes/book/app/utils/loaders.server.ts +++ b/themes/book/app/utils/loaders.server.ts @@ -11,7 +11,7 @@ import { redirect } from '@remix-run/node'; import { responseNoArticle, responseNoSite, getDomainFromRequest } from '@myst-theme/site'; const CONTENT_CDN_PORT = process.env.CONTENT_CDN_PORT ?? '3100'; -const CONTENT_CDN = `http://localhost:${CONTENT_CDN_PORT}`; +const CONTENT_CDN = process.env.CONTENT_CDN ?? `http://localhost:${CONTENT_CDN_PORT}`; export async function getConfig(): Promise { const url = `${CONTENT_CDN}/config.json`;