Skip to content

Commit

Permalink
fix: og:image tags for /area/ and /climbs/ (#1200)
Browse files Browse the repository at this point in the history
* fix: invalid og:image for all areas

* fix: extra slash in climb page SEO image
  • Loading branch information
julianlam authored Nov 8, 2024
1 parent 8764672 commit 51375e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/(default)/area/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export async function generateMetadata ({ params }: PageWithCatchAllUuidProps):

const name = sanitizeName(areaName)

const previewImage = media.length > 0 ? `${CLIENT_CONFIG.CDN_BASE_URL}/${media[0].mediaUrl}?w=1200q=75` : null
const previewImage = media.length > 0 ? `${CLIENT_CONFIG.CDN_BASE_URL}${media[0].mediaUrl}?w=1200&q=75` : null

const description = `Community knowledge • ${wall}${name}`

Expand Down
2 changes: 1 addition & 1 deletion src/js/hooks/seo/useClimbSeo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ export const useClimbSeo = ({ climb }: ClimbSeoProps): SeoHookType => {
*/
const getRandomPreviewImages = (list: MediaWithTags[]): string[] => {
const shortList = shuffle(list.slice(0, 10)) // shuffle the first 10
return shortList.slice(0, 4).map(image => (`${CLIENT_CONFIG.CDN_BASE_URL}/${image.mediaUrl}?w=1200&ch=630&cy=center&format=jpg&q=85`))
return shortList.slice(0, 4).map(image => (`${CLIENT_CONFIG.CDN_BASE_URL}${image.mediaUrl}?w=1200&ch=630&cy=center&format=jpg&q=85`))
}

0 comments on commit 51375e5

Please sign in to comment.