fix(seo): 修复页面标题公司名重复与品牌名繁简体不一致问题

- 新增 COMPANY_INFO.displayName 属性用于页面标题和SEO元数据
- 统一所有页面 metadata 使用 displayName(简体"睿新致远")
- 视觉展示元素保留 shortName(繁体"睿新致遠"配合青柳隷書字体)
- 修复关于/联系/团队页面标题中公司名重复出现的问题
- 修复新闻ID从数字改为SEO友好slug
- 更新结构化数据使用完整公司名
- 修复ESLint报错:引号转义、组件displayName、any类型替换
This commit is contained in:
张翔
2026-05-03 09:15:14 +08:00
parent f0657ce9f4
commit 1bf22a8f95
29 changed files with 183 additions and 76 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import { render } from '@testing-library/react';
import '@testing-library/jest-dom';
import { OrganizationSchema, WebsiteSchema } from './structured-data';
import { COMPANY_INFO } from '@/lib/constants';
describe('StructuredData', () => {
beforeEach(() => {
@@ -18,7 +19,7 @@ describe('StructuredData', () => {
const { container } = render(<OrganizationSchema />);
const script = container.querySelector('script[type="application/ld+json"]');
const schema = JSON.parse(script?.textContent || '{}');
expect(schema.name).toBe('四川睿新致远科技有限公司');
expect(schema.name).toBe(COMPANY_INFO.name);
});
it('should contain organization type', () => {
@@ -54,7 +55,7 @@ describe('StructuredData', () => {
const { container } = render(<WebsiteSchema />);
const script = container.querySelector('script[type="application/ld+json"]');
const schema = JSON.parse(script?.textContent || '{}');
expect(schema.name).toBe('四川睿新致远科技有限公司');
expect(schema.name).toBe(COMPANY_INFO.name);
});
});
});
+5 -3
View File
@@ -1,8 +1,10 @@
import { COMPANY_INFO } from '@/lib/constants';
export function OrganizationSchema() {
const schema = {
"@context": "https://schema.org",
"@type": "Organization",
"name": "四川睿新致远科技有限公司",
"name": COMPANY_INFO.name,
"alternateName": "诺瓦隆",
"url": "https://www.novalon.cn",
"logo": "https://www.novalon.cn/logo.svg",
@@ -32,7 +34,7 @@ export function WebsiteSchema() {
const schema = {
"@context": "https://schema.org",
"@type": "WebSite",
"name": "四川睿新致远科技有限公司",
"name": COMPANY_INFO.name,
"url": "https://www.novalon.cn",
"potentialAction": {
"@type": "SearchAction",
@@ -56,7 +58,7 @@ export function ServiceSchema() {
"serviceType": "企业数字化转型服务",
"provider": {
"@type": "Organization",
"name": "四川睿新致远科技有限公司"
"name": COMPANY_INFO.name
},
"description": "提供软件开发、云计算、数据分析、信息安全等一站式数字化转型解决方案",
"areaServed": {