Skip to content

Commit

Permalink
Add meta tags for sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Jul 13, 2023
1 parent 6507fc7 commit cb84804
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion apps/web/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cssBundleHref } from '@remix-run/css-bundle'
import type { LinksFunction, LoaderArgs } from '@remix-run/node'
import type { LinksFunction, LoaderArgs, MetaFunction } from '@remix-run/node'
import { json } from '@remix-run/node'
import {
Links,
Expand All @@ -13,6 +13,35 @@ import {
import { getUser } from '~/session.server'
import stylesheet from '~/tailwind.css'

export const metaTags = ({
title = 'Thumbnailed',
description = 'A Discord bot that allows creators to preview YouTube thumbnails.',
coverImage = 'hero-image.png',
}) => {
return {
title,
description,
'twitter:title': title,
'twitter:description': description,
'twitter:image': coverImage,
'twitter:url': `https://thumbnailed.drewis.cool`,
'twitter:creator': '@drewlyton',
'twitter:site': '@drewlyton',
'twitter:card': 'summary_large_image',
'og:type': 'article',
'og:title': title,
'og:description': description,
'og:image': coverImage,
'og:url': `https://thumbnailed.drewis.cool`,
}
}

export const meta: MetaFunction = () => ({
charset: 'utf-8',
viewport: 'width=device-width,initial-scale=1',
...metaTags({}),
})

export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: stylesheet },
...(cssBundleHref ? [{ rel: 'stylesheet', href: cssBundleHref }] : []),
Expand Down
Binary file added apps/web/public/hero-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb84804

Please sign in to comment.