SEO
This commit is contained in:
tangly1024
2021-12-16 17:33:53 +08:00
parent 47e781d517
commit ddbeebae57
7 changed files with 42 additions and 34 deletions

View File

@@ -18,7 +18,7 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
return <Custom404 />
}
const meta = {
title: `${post.title}`,
title: `${BLOG.title} | ${post.title}`,
description: post.summary,
type: 'article',
tags: post.tags
@@ -30,7 +30,10 @@ const Slug = ({ post, blockMap, tags, prev, next, allPosts, recommendPosts, cate
}
export async function getStaticPaths () {
const posts = await getAllPosts({ from: 'slug - paths', includePage: true })
let posts = []
if (BLOG.isProd) {
posts = await getAllPosts({ from: 'slug - paths', includePage: true })
}
return {
paths: posts.map(row => `${BLOG.path}/article/${row.slug}`),
fallback: true