Skip to content

Commit

Permalink
fixup ♻️ use template on og image url
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentDepth committed Apr 14, 2023
1 parent 5eb1827 commit df35193
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/config-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
showAbout: true,

path: '',
ogImageGenerateURL: '/api/og-image?title={title}',
ogImageGenerateURL: '',
rss: true,
seo: {
keywords: ['Blog', 'Website', 'Notion'],
Expand Down
3 changes: 2 additions & 1 deletion lib/server/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import { resolve } from 'node:path'
import { createDefu } from 'defu'
import { joinURL } from 'ufo'
import { md5 } from './utils'

const applyDefaults = createDefu((obj, key, value) => {
Expand All @@ -14,7 +15,7 @@ const config: Osmium.Config = applyDefaults(
raw,
{
path: '/',
ogImageGenerateURL: `${raw.link}/api/og-image?title=$title`,
ogImageGenerateURL: joinURL(raw.link, raw.path, '/api/og-image?title={title}'),
emailHash: raw.email && md5(raw.email),
rss: true,
},
Expand Down

0 comments on commit df35193

Please sign in to comment.