Files
sign/apps/remix/app/routes/_unauthenticated+/share.$slug.tsx

60 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-01-02 15:33:37 +11:00
import { redirect } from 'react-router';
2025-02-19 16:45:54 +11:00
import { NEXT_PUBLIC_WEBAPP_URL } from '@documenso/lib/constants/app';
2025-01-02 15:33:37 +11:00
import type { Route } from './+types/share.$slug';
export function meta({ params: { slug } }: Route.MetaArgs) {
return [
2025-03-24 15:55:08 +01:00
{ title: 'BLS sign - Share' },
{ description: 'I just signed a document in style with BLS sign!' },
2025-01-02 15:33:37 +11:00
{
property: 'og:title',
2025-03-24 15:55:08 +01:00
content: 'BLS sign - Join the open source signing revolution',
2025-01-02 15:33:37 +11:00
},
{
property: 'og:description',
2025-03-24 15:55:08 +01:00
content: 'I just signed with BLS sign!',
2025-01-02 15:33:37 +11:00
},
{
property: 'og:type',
2025-02-25 16:37:36 +11:00
content: 'website',
2025-01-02 15:33:37 +11:00
},
{
2025-02-25 16:37:36 +11:00
property: 'og:image',
content: `${NEXT_PUBLIC_WEBAPP_URL()}/share/${slug}/opengraph`,
2025-01-02 15:33:37 +11:00
},
{
name: 'twitter:site',
2025-02-25 16:37:36 +11:00
content: '@documenso',
2025-01-02 15:33:37 +11:00
},
{
name: 'twitter:card',
2025-02-25 16:37:36 +11:00
content: 'summary_large_image',
2025-01-02 15:33:37 +11:00
},
{
2025-02-25 16:37:36 +11:00
name: 'twitter:image',
content: `${NEXT_PUBLIC_WEBAPP_URL()}/share/${slug}/opengraph`,
2025-01-02 15:33:37 +11:00
},
{
name: 'twitter:description',
2025-03-24 15:55:08 +01:00
content: 'I just signed with BLS sign!',
2025-01-02 15:33:37 +11:00
},
];
}
export const loader = ({ request }: Route.LoaderArgs) => {
const userAgent = request.headers.get('User-Agent') ?? '';
if (/bot|facebookexternalhit|WhatsApp|google|bing|duckduckbot|MetaInspector/i.test(userAgent)) {
return null;
}
2025-03-24 15:55:08 +01:00
// Is hardcoded because this whole meta is hardcoded anyway for BLS sign.
throw redirect('https://bls.media/');
2025-01-02 15:33:37 +11:00
};
2025-02-20 15:38:06 +11:00
export default function SharePage() {
return <div></div>;
}