Skip to content

Commit

Permalink
fix: drop V2_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jun 20, 2024
1 parent e723153 commit 9003a00
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions packages/site/src/seo/meta.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { V2_MetaDescriptor } from '@remix-run/react';
import type { MetaDescriptor } from '@remix-run/react';

type SocialSite = {
title: string;
Expand All @@ -17,15 +17,15 @@ type SocialArticle = {
keywords?: string[];
};

function allDefined(meta: Record<string, string | null | undefined>): V2_MetaDescriptor {
return Object.fromEntries(Object.entries(meta).filter(([, v]) => v)) as V2_MetaDescriptor;
function allDefined(meta: Record<string, string | null | undefined>): MetaDescriptor {
return Object.fromEntries(Object.entries(meta).filter(([, v]) => v)) as MetaDescriptor;
}

export function getMetaTagsForSite_V1({
title,
description,
twitter,
}: SocialSite): V2_MetaDescriptor {
}: SocialSite): MetaDescriptor {
const meta = {
title,
description,
Expand All @@ -38,8 +38,8 @@ export function getMetaTagsForSite({
title,
description,
twitter,
}: SocialSite): V2_MetaDescriptor[] {
const meta: V2_MetaDescriptor[] = [
}: SocialSite): MetaDescriptor[] {
const meta: MetaDescriptor[] = [
{ title },
{ property: 'og:title', content: title },
{ name: 'generator', content: 'mystmd' },
Expand All @@ -60,7 +60,7 @@ export function getMetaTagsForArticle_V1({
image,
twitter,
keywords,
}: SocialArticle): V2_MetaDescriptor {
}: SocialArticle): MetaDescriptor {
const meta = {
title,
description,
Expand Down Expand Up @@ -88,8 +88,8 @@ export function getMetaTagsForArticle({
image,
twitter,
keywords,
}: SocialArticle): V2_MetaDescriptor[] {
const meta: V2_MetaDescriptor[] = [
}: SocialArticle): MetaDescriptor[] {
const meta: MetaDescriptor[] = [
{ title },
{ property: 'og:title', content: title },
{ name: 'generator', content: 'mystmd' },
Expand Down
4 changes: 2 additions & 2 deletions themes/article/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LinksFunction, LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { LinksFunction, LoaderFunction, MetaFunction } from '@remix-run/node';
import tailwind from '~/styles/app.css';
import thebeCoreCss from 'thebe-core/dist/lib/thebe-core.css';
import { getConfig } from '~/utils/loaders.server';
Expand All @@ -14,7 +14,7 @@ import {
export { AppErrorBoundary as ErrorBoundary } from '@myst-theme/site';
import { Outlet, useLoaderData } from '@remix-run/react';

export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
export const meta: MetaFunction<typeof loader> = ({ data }) => {
return getMetaTagsForSite({
title: data?.config?.title,
description: data?.config?.description,
Expand Down
4 changes: 2 additions & 2 deletions themes/article/app/routes/$.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
json,
type LinksFunction,
type LoaderFunction,
type V2_MetaFunction,
type MetaFunction,
} from '@remix-run/node';
import {
getMetaTagsForArticle,
Expand All @@ -23,7 +23,7 @@ import { useRouteError, isRouteErrorResponse } from '@remix-run/react';

type ManifestProject = Required<SiteManifest>['projects'][0];

export const meta: V2_MetaFunction<typeof loader> = ({ data, matches, location }) => {
export const meta: MetaFunction<typeof loader> = ({ data, matches, location }) => {
if (!data) return [];

const config: SiteManifest = data.config;
Expand Down
4 changes: 2 additions & 2 deletions themes/article/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import Page from './$';
import { ArticlePageAndNavigation } from '../components/ArticlePageAndNavigation';
import { getConfig, getPage } from '../utils/loaders.server';
import type { LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { LoaderFunction, MetaFunction } from '@remix-run/node';
import { redirect } from '@remix-run/node';
import { SiteManifest } from 'myst-config';
import { getProject } from '@myst-theme/common';
Expand All @@ -17,7 +17,7 @@ import { useRouteError, isRouteErrorResponse } from '@remix-run/react';

type ManifestProject = Required<SiteManifest>['projects'][0];

export const meta: V2_MetaFunction<typeof loader> = ({ data, location }) => {
export const meta: MetaFunction<typeof loader> = ({ data, location }) => {
if (!data) return [];

const config: SiteManifest = data.config;
Expand Down
4 changes: 2 additions & 2 deletions themes/book/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LinksFunction, V2_MetaFunction, LoaderFunction } from '@remix-run/node';
import type { LinksFunction, MetaFunction, LoaderFunction } from '@remix-run/node';
import tailwind from '~/styles/app.css';
import thebeCoreCss from 'thebe-core/dist/lib/thebe-core.css';
import { getConfig } from '~/utils/loaders.server';
Expand All @@ -14,7 +14,7 @@ import {
export { AppErrorBoundary as ErrorBoundary } from '@myst-theme/site';
import { Outlet, useLoaderData } from '@remix-run/react';

export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
export const meta: MetaFunction<typeof loader> = ({ data }) => {
return getMetaTagsForSite({
title: data?.config?.title,
description: data?.config?.description,
Expand Down
4 changes: 2 additions & 2 deletions themes/book/app/routes/$.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
json,
type V2_MetaFunction,
type MetaFunction,
type LinksFunction,
type LoaderFunction,
} from '@remix-run/node';
Expand Down Expand Up @@ -33,7 +33,7 @@ import type { TemplateOptions } from '../types.js';
import { useRouteError, isRouteErrorResponse } from '@remix-run/react';
type ManifestProject = Required<SiteManifest>['projects'][0];

export const meta: V2_MetaFunction<typeof loader> = ({ data, matches, location }) => {
export const meta: MetaFunction<typeof loader> = ({ data, matches, location }) => {
if (!data) return [];

const config: SiteManifest = data.config;
Expand Down
4 changes: 2 additions & 2 deletions themes/book/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
responseNoArticle,
responseNoSite,
} from '@myst-theme/site';
import type { LinksFunction, LoaderFunction, V2_MetaFunction } from '@remix-run/node';
import type { LinksFunction, LoaderFunction, MetaFunction } from '@remix-run/node';
import { json, redirect } from '@remix-run/node';
import { getConfig, getPage } from '~/utils/loaders.server';
import Page from './$';
Expand All @@ -13,7 +13,7 @@ import { getProject } from '@myst-theme/common';

type ManifestProject = Required<SiteManifest>['projects'][0];

export const meta: V2_MetaFunction<typeof loader> = ({ data, location }) => {
export const meta: MetaFunction<typeof loader> = ({ data, location }) => {
if (!data) return [];

const config: SiteManifest = data.config;
Expand Down

0 comments on commit 9003a00

Please sign in to comment.