B
配置公众号功能
配置公众号功能
2025年1月15日已解决。
次功能由《Hydoc的小站》前端大佬贡献,感谢大佬。💖💖
环境
自己开源的 《vuepress-theme-vdoing-one-public》网站模板。
此模板是在Young Kbt blog的开源项目《Kele-Bingtang.github.io》基础上修改为自己的风格而成,感谢大佬开源的模板&感谢原作者开源的vdoing主题。❤️❤️
配置
docs\.vuepress\config\themeConfig.ts
文件:
完整代码:
详细信息
ts
import{VdoingThemeConfig } from"vuepress-theme-vdoing/types";importnav from"../common/nav";importfooter from"../common/footer";importhtmlModules from'./htmlModules'import{readFileList,readTotalFileWords,readEachFileWords,} from"../webSiteInfo/readFile";import{penName,link,avatar,name,slogan } from"../common/info";import{hitokoto } from"./hitokoto";exportdefault<VdoingThemeConfig>{nav,sidebarDepth:2,logo:"/img/xyy-logo.ico",searchMaxSuggestions:10,lastUpdated:"更新时间",docsDir:"docs",editLinks:true,editLinkText:"编辑此页",categoryText:"随笔",bodyBgImg:['/img/bg/1.webp','/img/bg/2.webp','/img/bg/3.webp','/img/bg/4.webp','/img/bg/5.webp','/img/bg/6.webp','/img/bg/7.webp','/img/bg/8.webp','/img/bg/9.webp','/img/bg/10.webp','/img/bg/11.webp','/img/bg/12.webp','/img/bg/13.webp','/img/bg/14.webp','/img/bg/15.webp','/img/bg/16.webp','/img/bg/17.webp','/img/bg/18.webp','/img/bg/19.webp','/img/bg/20.webp','/img/bg/21.webp','/img/bg/22.webp','/img/bg/23.webp','/img/bg/24.webp','/img/bg/25.webp','/img/bg/26.webp',],bodyBgImgOpacity:1,bodyBgImgInterval:8,sidebar:"structuring",blogInfo:{blogCreate:"2021-10-19",indexView:true,pageView:true,readingTime:true,eachFileWords:readEachFileWords([""],300,160),mdFileCountType:"archives",totalWords:"archives",moutedEvent:".tags-wrapper",indexIteration:2500,pageIteration:2500,},privatePage:{openPrivate:true,username:"youngkbt",password:"kbt648621",expire:"1d",loginPath:"/vdoing/login/",loginKey:"vdoing_manager",loginSession:false,firstLogin:0,firstLoginKey:"vdoing_first_login",loginInfo:{"/private/test1/":[{username:"vdoing",password:"123456"}],vdoing_first_login:[{username:"vdoing",password:"123456"},],},},indexImg:{navColor:2,switchNavColor:true,bgTimeColor:true,bgTimeColorArray:["transparent","transparent","transparent","transparent",],descFade:true,desc:hitokoto,descFontSize:"1.4rem",descFadeInTime:200,descFadeOutTime:100,descNextTime:800,bubble:false,bubblePosition:0,bubbleNum:200,},author:{name:penName,link,},blogger:{avatar,name,slogan,},social:{icons:[{iconClass:"icon-github",title:"GitHub",link:"https:},{iconClass:"icon-gitee",title:"Gitee",link:"https:},{iconClass:"icon-rss",title:"网站首页",link:"https:},{iconClass:"icon-QQ",title:"QQ",link:"http:},{iconClass:"icon-youjian",title:"联系我",link:"https:},],},footer,htmlModules };
docs\.vuepress\config\htmlModules.ts
文件:
完整代码:
详细信息
ts
import{VdoingThemeConfig } from'vuepress-theme-vdoing/types'consthtmlModule:VdoingThemeConfig['htmlModules'] ={homeSidebarB:`<div style="padding: 0.95rem">
<p style="
color: var(--textColor);
opacity: 0.9;
font-size: 20px;
font-weight: bold;
margin: 0 0 8px 0;
">公众号</p>
<img src="https://onedayxyy.cn/images/wechat-gzh.jpg" style="width:100%;" />
关注公众号,回复[<b>One</b>],可获取 <a href="https://onedayxyy.cn/" arget="_blank" >我的学习网站<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>
</p>
</div>`,pageB:`<div class="donation">
<button>打赏</button>
<div class="main">
<div class="pic">
<img src="/img/alipay/One-wechat.jpg" alt="微信">
<img src="/img/alipay/One-zhifubao.jpg" alt="支付宝">
</div>
</div>
</div>`,}exportdefaulthtmlModule