Skip to content

Commit

Permalink
Adding better SEO for generative post
Browse files Browse the repository at this point in the history
  • Loading branch information
wking-io committed May 1, 2024
1 parent 56ae306 commit f0393df
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Radio, RadioGroup } from '@headlessui/react'
import { json } from '@remix-run/node'
import { type MetaFunction, json } from '@remix-run/node'
import { useLoaderData } from '@remix-run/react'
import Alea from 'alea'
import clsx from 'clsx'
Expand All @@ -13,8 +13,46 @@ import {
import { getHighlighter } from 'shiki'
import { RefreshIcon } from '#app/components/two-tone-icon.js'
import { Icon } from '#app/components/ui/icon.js'
import { seoData } from '#app/utils/seo.js'
import { theme } from '#app/utils/shiki.js'

export const meta: MetaFunction = () => [
...seoData({
title: 'The Generative Part of Generative Art - Craft Lab',
description:
'An interactive guide sharing what I have learned about Generative Art to help you go from zero to one faster.',
image:
'https://res.cloudinary.com/dzqdvin5s/image/upload/v1714586250/generative-part-og.jpg',
}),
{
'script:ld+json': {
'@context': 'https://schema.org',
'@type': 'Article',
name: 'The Generative Part of Generative Art',
author: {
'@type': 'Person',
name: 'Will King',
},
datePublished: '2024-05-01',
description:
'An interactive guide sharing what I have learned about Generative Art to help you go from zero to one faster.',
publisher: {
'@type': 'Organization',
name: 'Craft Lab',
logo: {
'@type': 'ImageObject',
url: 'https://res.cloudinary.com/dzqdvin5s/image/upload/v1714587213/craft-lab-icon.png',
},
},
mainEntityOfPage: {
'@type': 'WebPage',
'@id':
'https://www.craftlab.fun/articles/the-generative-part-of-generative-art',
},
},
},
]

const exampleOne = `/**
* This function is used to return a random positive integer (whole number)
* that will never be any larger than the max integer you pass in.
Expand Down
5 changes: 3 additions & 2 deletions app/utils/seo.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export function seoData({
title,
description,
image = 'https://res.cloudinary.com/dzqdvin5s/image/upload/v1714077475/craft-lab-og-v2.jpg',
}: {
title: string
description: string
image?: string
}) {
return [
{ title },
Expand All @@ -21,8 +23,7 @@ export function seoData({
},
{
property: 'og:image',
content:
'https://res.cloudinary.com/dzqdvin5s/image/upload/v1714077475/craft-lab-og-v2.jpg',
content: image,
},
{
property: 'og:type',
Expand Down

0 comments on commit f0393df

Please sign in to comment.