Skip to content

Commit

Permalink
📦 Upgrade to v0.9.0 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Apr 20, 2024
1 parent 21987a9 commit 8615840
Show file tree
Hide file tree
Showing 7 changed files with 1,079 additions and 980 deletions.
4 changes: 2 additions & 2 deletions theme/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LinksFunction, MetaFunction, LoaderFunction } from '@remix-run/node';
import type { LinksFunction, V2_MetaFunction, LoaderFunction } from '@remix-run/node';
import tailwind from '~/styles/app.css';
import { getConfig } from '~/utils/loaders.server';
import type { SiteLoader } from '@myst-theme/common';
Expand All @@ -11,7 +11,7 @@ import {
} from '@myst-theme/site';
export { AppCatchBoundary as CatchBoundary } from '@myst-theme/site';

export const meta: MetaFunction = ({ data }) => {
export const meta: V2_MetaFunction = ({ data }) => {
return getMetaTagsForSite({
title: data?.config?.title,
twitter: data?.config?.twitter,
Expand Down
22 changes: 11 additions & 11 deletions theme/app/routes/$project.($slug).tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoaderFunction, MetaFunction } from '@remix-run/node';
import type { LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { PageLoader } from '@myst-theme/common';
import {
useOutlineHeight,
Expand All @@ -11,23 +11,23 @@ import {
import { FrontmatterBlock } from '@myst-theme/frontmatter';
import { ComputeOptionsProvider, ThebeLoaderAndServer } from '@myst-theme/jupyter';
import { useLoaderData } from '@remix-run/react';
import type { SiteManifest } from 'myst-config';
import { ProjectProvider, ReferencesProvider, useThemeTop } from '@myst-theme/providers';
import { getPage } from '~/utils/loaders.server';
import { ArticleWithProviders } from '../components/Page';
import type { GenericParent } from 'myst-common';

export const meta: MetaFunction = (args) => {
const config = (args.parentsData?.['routes/$project']?.config ??
args.parentsData?.root?.config) as SiteManifest | undefined;
const data = args.data as PageLoader | undefined;
if (!config || !data || !data.frontmatter) return {};
export const meta: V2_MetaFunction = ({ data, location }) => {
if (!data) return [];
const siteTitle = 'MyST Markdown';
const page = data.frontmatter;
return getMetaTagsForArticle({
origin: '',
url: args.location.pathname,
title: `${data.frontmatter.title} - ${config?.title}`,
description: data.frontmatter.description,
image: (data.frontmatter.thumbnailOptimized || data.frontmatter.thumbnail) ?? undefined,
url: location.pathname,
title: page?.title ? `${page.title}${siteTitle ? ` - ${siteTitle}` : ''}` : siteTitle,
description: page?.description ?? undefined,
image: page?.thumbnailOptimized || page?.thumbnail,
twitter: 'mystmarkdown',
keywords: page?.keywords ?? [],
});
};

Expand Down
21 changes: 11 additions & 10 deletions theme/app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import type { LinksFunction, LoaderFunction, MetaFunction } from '@remix-run/node';
import type { LinksFunction, LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { PageLoader } from '@myst-theme/common';
import { getMetaTagsForArticle, KatexCSS, ArticlePage } from '@myst-theme/site';
import { ComputeOptionsProvider, ThebeLoaderAndServer } from '@myst-theme/jupyter';
import { getPage } from '~/utils/loaders.server';
import { useLoaderData } from '@remix-run/react';
import type { SiteManifest } from 'myst-config';
import { ArticleAndNavigation, HeaderSection, NavigationAndFooter } from '../components/Page';
import { Error404 } from '../components/Error404';
import { ProjectProvider } from '@myst-theme/providers';

export const meta: MetaFunction = (args) => {
const config = args.parentsData?.root?.config as SiteManifest | undefined;
const data = args.data as PageLoader | undefined;
if (!config || !data || !data.frontmatter) return {};
export const meta: V2_MetaFunction = ({ data, location }) => {
if (!data) return [];
const siteTitle = 'MyST Markdown';
const page = data.frontmatter;
return getMetaTagsForArticle({
origin: '',
url: args.location.pathname,
title: `${data.frontmatter.title} - ${config?.title}`,
description: data.frontmatter.description,
image: (data.frontmatter.thumbnailOptimized || data.frontmatter.thumbnail) ?? undefined,
url: location.pathname,
title: page?.title ? `${page.title}${siteTitle ? ` - ${siteTitle}` : ''}` : siteTitle,
description: page?.description ?? undefined,
image: page?.thumbnailOptimized || page?.thumbnail,
twitter: 'mystmarkdown',
keywords: page?.keywords ?? [],
});
};

Expand Down
19 changes: 17 additions & 2 deletions theme/app/routes/overview.($slug).tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LoaderFunction } from '@remix-run/node';
import type { LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { PageLoader } from '@myst-theme/common';
import { ArticlePage } from '@myst-theme/site';
import { ArticlePage, getMetaTagsForArticle } from '@myst-theme/site';
import { ComputeOptionsProvider, ThebeLoaderAndServer } from '@myst-theme/jupyter';
import { getPage } from '../utils/loaders.server';
import { NavLink, useLoaderData } from '@remix-run/react';
Expand All @@ -11,6 +11,21 @@ import { Error404 } from '../components/Error404';

const baseurl = 'overview';

export const meta: V2_MetaFunction = ({ data, location }) => {
if (!data) return [];
const siteTitle = 'MyST Markdown';
const page = data.frontmatter;
return getMetaTagsForArticle({
origin: '',
url: location.pathname,
title: page?.title ? `${page.title}${siteTitle ? ` - ${siteTitle}` : ''}` : siteTitle,
description: page?.description ?? undefined,
image: page?.thumbnailOptimized || page?.thumbnail,
twitter: 'mystmarkdown',
keywords: page?.keywords ?? [],
});
};

export const loader: LoaderFunction = async ({ params, request }) => {
const { slug } = params;
const page = await getPage({ name: 'overview', slug });
Expand Down
Loading

0 comments on commit 8615840

Please sign in to comment.