添加 SEO 结构化数据
This commit is contained in:
@@ -2,6 +2,7 @@ import path from 'path';
|
||||
import _fs from 'fs';
|
||||
const fs = _fs.promises;
|
||||
import { fileURLToPath } from 'url';
|
||||
import SITE_INFO from '../config';
|
||||
// 获取当前模块的目录路径
|
||||
const __filename = fileURLToPath(import.meta.url); // 当前文件的绝对路径
|
||||
const __dirname = path.dirname(__filename); // 当前文件所在的目录
|
||||
@@ -61,7 +62,7 @@ const fileIter = createImageIterator(targetDir);
|
||||
const getCover = async (filename: string | null | undefined) => {
|
||||
if (filename) return filename;
|
||||
const { value } = await fileIter.next();
|
||||
return `/assets/images/banner/${value}`
|
||||
return SITE_INFO.Site + `/assets/images/banner/${value}`
|
||||
}
|
||||
|
||||
export default getCover;
|
||||
Reference in New Issue
Block a user