Skip to content

Commit 22ab2e8

Browse files
committed
ci(route): add 404 page
1 parent 5658cb5 commit 22ab2e8

File tree

2 files changed

+30
-74
lines changed

2 files changed

+30
-74
lines changed

index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@
6868
}
6969
}
7070
</script>
71+
72+
<script>
73+
(function () {
74+
var params = new URLSearchParams(window.location.search);
75+
var redirect = params.get('redirect');
76+
if (redirect) {
77+
window.history.replaceState(null, '', redirect);
78+
}
79+
})();
80+
</script>
7181

7282
<script>
7383
window.MAPV_BASE_URL = 'mapvthree/'; // 配置为mapv-three包路径的dist目录

public/404.html

Lines changed: 20 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,26 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="zh-CN">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" href="/favicon.ico" />
6-
<link rel="manifest" href="/manifest.json" />
7-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
9-
<!-- Primary Meta Tags -->
10-
<title>JSAPI Three 案例 - 地图可视化展示案例集 | MapV Three</title>
11-
<meta name="title" content="JSAPI Three 案例 - 地图可视化展示案例集 | MapV Three" />
12-
<meta name="description" content="基于JSAPI Three的3D地图可视化展示案例集合,包含倾斜摄影、人口迁徙、风场可视化、热力图、地铁线路图等丰富的地理数据可视化效果。适用于智慧城市、数据可视化、GIS应用开发。" />
13-
<meta name="keywords" content="JSAPI Three,MapV Three,地图可视化,3D可视化,地理数据可视化,倾斜摄影,人口迁徙,风场可视化,热力图,WebGL,Three.js,GIS,智慧城市,数据可视化" />
14-
<meta name="author" content="百度地图开放平台" />
15-
<meta name="robots" content="index, follow" />
16-
<link rel="canonical" href="https://lbsyun.baidu.com/jsapithree/showcase/" />
17-
18-
<!-- Open Graph / Facebook -->
19-
<meta property="og:type" content="website" />
20-
<meta property="og:url" content="https://lbsyun.baidu.com/jsapithree/showcase/" />
21-
<meta property="og:title" content="JSAPI Three 案例 - 地图可视化展示案例集 | MapV Three" />
22-
<meta property="og:description" content="基于JSAPI Three的3D地图可视化展示案例集合,包含倾斜摄影、人口迁徙、风场可视化、热力图、地铁线路图等丰富的地理数据可视化效果。" />
23-
<meta property="og:image" content="https://lbsyun.baidu.com/jsapithree/showcase/thumbnails/cityPhotogrammetry.webp" />
24-
<meta property="og:locale" content="zh_CN" />
25-
<meta property="og:site_name" content="JSAPI Three 案例" />
26-
27-
<!-- Twitter -->
28-
<meta name="twitter:card" content="summary_large_image" />
29-
<meta name="twitter:url" content="https://lbsyun.baidu.com/jsapithree/showcase/" />
30-
<meta name="twitter:title" content="JSAPI Three 案例 - 地图可视化展示案例集 | MapV Three" />
31-
<meta name="twitter:description" content="基于JSAPI Three的3D地图可视化展示案例集合,包含倾斜摄影、人口迁徙、风场可视化、热力图、地铁线路图等丰富的地理数据可视化效果。" />
32-
<meta name="twitter:image" content="https://lbsyun.baidu.com/jsapithree/showcase/thumbnails/cityPhotogrammetry.webp" />
33-
34-
<!-- 移动端适配 -->
35-
<meta name="mobile-web-app-capable" content="yes" />
36-
<meta name="apple-mobile-web-app-capable" content="yes" />
37-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
38-
<meta name="apple-mobile-web-app-title" content="MapV Three 案例" />
39-
40-
<!-- 主题颜色 -->
41-
<meta name="theme-color" content="#1890ff" />
42-
43-
<!-- JSON-LD 结构化数据 -->
44-
<script type="application/ld+json">
45-
{
46-
"@context": "https://schema.org",
47-
"@type": "WebApplication",
48-
"name": "JSAPI Three 案例",
49-
"description": "基于JSAPI Three的3D地图可视化展示案例集合,包含倾斜摄影、人口迁徙、风场可视化、热力图、地铁线路图等丰富的地理数据可视化效果。",
50-
"url": "https://lbsyun.baidu.com/jsapithree/showcase/",
51-
"applicationCategory": "MultimediaApplication",
52-
"operatingSystem": "Web Browser",
53-
"offers": {
54-
"@type": "Offer",
55-
"price": "0",
56-
"priceCurrency": "CNY"
57-
},
58-
"creator": {
59-
"@type": "Organization",
60-
"name": "百度地图开放平台",
61-
"url": "https://lbsyun.baidu.com/"
62-
},
63-
"keywords": "JSAPI Three, MapV Three, 地图可视化, 3D可视化, 地理数据可视化",
64-
"inLanguage": "zh-CN",
65-
"potentialAction": {
66-
"@type": "ViewAction",
67-
"target": "https://lbsyun.baidu.com/jsapithree/showcase/"
68-
}
69-
}
70-
</script>
71-
5+
<title>Redirecting...</title>
726
<script>
73-
window.MAPV_BASE_URL = 'mapvthree/'; // 配置为mapv-three包路径的dist目录
7+
// GitHub Pages SPA fallback
8+
var segmentCount = 1; // 仓库名层级
9+
var l = window.location;
10+
var newPath =
11+
l.protocol +
12+
'//' +
13+
l.host +
14+
l.pathname
15+
.split('/')
16+
.slice(0, segmentCount + 1)
17+
.join('/') +
18+
'/?redirect=' +
19+
encodeURIComponent(
20+
l.pathname.replace(/^\/[^/]+/, '') + l.search + l.hash
21+
);
22+
window.location.replace(newPath);
7423
</script>
7524
</head>
76-
<body>
77-
<div id="root"></div>
78-
<script type="module" src="/src/main.jsx"></script>
79-
</body>
80-
</html>
25+
<body></body>
26+
</html>

0 commit comments

Comments
 (0)