Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
hager
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-11-04 14:57:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ffc375d5a0d7f016a50fe6c0d67819602a25f9e5
ffc375d5
1 parent
66b1e67c
fix
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
13 deletions
package.json
src/App.vue
vite.config.js
yarn.lock
package.json
View file @
ffc375d
...
...
@@ -29,6 +29,9 @@
"sass"
:
"1.55.0"
,
"sitemap"
:
"^8.0.0"
,
"swiper"
:
"5"
,
"vite-plugin-html"
:
"^3.2.2"
,
"vite-plugin-pages"
:
"^0.32.3"
,
"vite-plugin-pages-sitemap"
:
"^1.7.1"
,
"vite-plugin-sitemap"
:
"^0.7.1"
,
"vue"
:
"2.7.13"
,
"vue-awesome-swiper"
:
"4.1.1"
,
...
...
src/App.vue
View file @
ffc375d
<!--
* @Date: 2024-09-26 13:36:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-04 1
3:11:08
* @LastEditTime: 2024-11-04 1
4:02:06
* @FilePath: /hager/src/App.vue
* @Description: 文件描述
-->
...
...
@@ -26,7 +26,7 @@ export default {
title: '海格电气官方网站',
meta: [
{ name: 'keyword', content: '海格集团是全球领先的电气及智能化解决方案和服务提供商,应用领域涵盖住宅、商业建筑、公共建筑和工业。海格电气品牌代表了集团的核心业务,覆盖配电系统、电缆管理系统,KNX 智能控制系统和开关面板、楼宇自动化和安防系统。' },
{ name: 'description', content: '构建未来电气世界 让人们的生活更安全、更清洁、更愉悦' },
{ name: 'description', content: '构建未来电气世界 让人们的生活更安全、更清洁、更愉悦
。
' },
]
},
components: { hagerHeader, hagerFooter },
...
...
vite.config.js
View file @
ffc375d
/*
* @Date: 2024-08-26 10:12:56
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-11-04 1
2:49:23
* @LastEditTime: 2024-11-04 1
4:56:26
* @FilePath: /hager/vite.config.js
* @Description: 文件描述
*/
...
...
@@ -15,6 +15,7 @@ import Components from 'unplugin-vue-components/vite';
import
{
ElementUiResolver
}
from
'unplugin-vue-components/resolvers'
;
import
commonjs
from
'vite-plugin-commonjs'
;
import
sitemap
from
'vite-plugin-sitemap'
;
// 生成网站的站点地图,以便搜索引擎可以更容易地抓取网站上的页面
import
{
createHtmlPlugin
}
from
'vite-plugin-html'
;
// var path = require('path');
import
path
from
'path-browserify'
;
...
...
@@ -89,16 +90,34 @@ return defineConfig({
priority
:
0.7
,
ignore
:
[
'**/*.json'
,
'**/*.md'
],
dynamicRoutes
,
routes
:
[
'/'
,
'/product/index'
,
'/product/detail'
,
'/solution/index'
,
'/solution/detail'
,
'/solution/case'
,
'/about'
,
],
generateRobotsTxt
:
false
// 禁用 robots.txt 生成
generateRobotsTxt
:
false
,
// 禁用 robots.txt 生成
readable
:
true
,
}),
createHtmlPlugin
({
minify
:
false
,
inject
:
{
data
:
{
sitemapUrl
:
'/f/hager/sitemap.xml'
},
tags
:
[
{
tag
:
'link'
,
attrs
:
{
rel
:
'sitemap'
,
type
:
'application/xml'
,
title
:
'Sitemap'
,
href
:
'/f/hager/sitemap.xml'
}
}
]
},
// 只修改特定的标签,不覆盖其他插件的插入
transformIndexHtml
:
(
html
,
ctx
)
=>
{
return
html
.
replace
(
/<link rel="sitemap" type="application
\/
xml" title="Sitemap" href="
\/
sitemap
\.
xml">/
,
`<link rel="sitemap" type="application/xml" title="Sitemap" href="
${
ctx
.
data
.
sitemapUrl
}
">`
);
}
})
],
publicDir
:
'public'
,
// 作为静态资源服务的文件夹。这个目录中的文件会在开发中被服务于 /,在开发模式时,会被拷贝到 outDir 的根目录,并没有转换,永远只是复制到这里。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录路径。
...
...
yarn.lock
View file @
ffc375d
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment