File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ const config = {
99 baseUrl : '/fcp-doc/' ,
1010 organizationName : 'quickmsg' ,
1111 projectName : 'fcp-doc' ,
12+ baseUrlIssueBanner : false ,
1213 onBrokenLinks : 'throw' ,
1314 onBrokenMarkdownLinks : 'warn' ,
1415 i18n : {
1516 defaultLocale : 'zh-Hans' ,
1617 locales : [ 'zh-Hans' ] ,
1718 } ,
19+ plugins : [ './plugins/favicon-plugin.js' ] ,
1820 presets : [
1921 [
2022 'classic' ,
@@ -37,10 +39,11 @@ const config = {
3739 ( {
3840 navbar : {
3941 logo : {
40- src : 'logo.svg' ,
41- srcDark : 'logo.svg' ,
42+ src : '/fcp-doc/ logo.svg' ,
43+ srcDark : '/fcp-doc/ logo.svg' ,
4244 width : 36 ,
4345 height : 36 ,
46+ alt : 'FCP' ,
4447 } ,
4548 title : 'FCP' ,
4649 items : [ ] ,
Original file line number Diff line number Diff line change 1+ /**
2+ * 注入 favicon 绝对路径,解决 baseUrl 子路径部署时浏览器标签页图标不显示
3+ */
4+ export default function faviconPlugin ( context ) {
5+ const { siteConfig } = context ;
6+ const baseUrl = siteConfig . baseUrl || '/' ;
7+ const url = ( siteConfig . url || '' ) . replace ( / \/ $ / , '' ) ;
8+ const faviconHref = `${ url } ${ baseUrl } favicon.ico` ;
9+
10+ return {
11+ name : 'favicon-plugin' ,
12+ injectHtmlTags ( ) {
13+ return {
14+ headTags : [
15+ {
16+ tagName : 'link' ,
17+ attributes : {
18+ rel : 'icon' ,
19+ type : 'image/x-icon' ,
20+ href : faviconHref ,
21+ } ,
22+ } ,
23+ ] ,
24+ } ;
25+ } ,
26+ } ;
27+ }
You can’t perform that action at this time.
0 commit comments