Skip to content

Commit

Permalink
fix: slug url replace
Browse files Browse the repository at this point in the history
  • Loading branch information
jrson83 committed Oct 3, 2023
1 parent f89a5d6 commit c33debf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ site
.use(slugify_urls({
replace: {
"&": "and",
"@": "",
},
}))
.use(unified({
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/layouts/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default (
{type && type === "post" && (
<meta
property="og:image"
content={`${urlFilter!(`/images/og/${postSlug}.jpg`, true)}`}
content={`${urlFilter!(`/images/og/${postSlug?.replaceAll(/(\@|\%)/gm, '').replaceAll('/', '-')}.jpg`, true)}`}
/>
)}

Expand All @@ -90,7 +90,7 @@ export default (
{type && type === "post" && (
<meta
name="twitter:image"
content={`${urlFilter!(`/images/og/${postSlug}.jpg`, true)}`}
content={`${urlFilter!(`/images/og/${postSlug?.replaceAll(/(\@|\%)/gm, '').replaceAll('/', '-')}.jpg`, true)}`}
/>
)}

Expand Down

0 comments on commit c33debf

Please sign in to comment.