cnblogs-theme-silence icon indicating copy to clipboard operation
cnblogs-theme-silence copied to clipboard

提些定制化需求

Open calfmark opened this issue 4 years ago • 1 comments

提点优化建议:

  1. 禁用了赞赏,但文章页面还是会显示赞赏图标 sponsor: { enable: false, paypal: null, wechat: null, alipay: null }, 临时解决办法:在CSS代码最后加上.esa-sponsor { display: none; }
  2. 在配置里,能否支持配置默认主题呢? 临时解决办法:src/components/toolbar/index.js里的42行const themeLoading = sessionStorage.getItem(themeKey) || 'a1';改一下“a1”为默认的主题就可以了
  3. 能否支持默认开启右侧文章的目录导航呢?现在要用户手动点,才会出现。 临时解决办法:src/components/postContents/index.js 13行esa-contents后边加上 active,但这样移动端的展示就很难看,导航会把整个屏幕覆盖住。需要添加以下代码进行区分是否移动端:
function isMobile(){
  let info = navigator.userAgent;
  let agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPod", "iPad"];
  for(let i = 0; i < agents.length; i++){
    if(info.indexOf(agents[i]) >= 0) return true;
  }
  return false;
}

  if (isMobile()) {
            $('body').append(`<div class="esa-contents"></div>`);
  } else {
            $('body').append(`<div class="esa-contents active"></div>`);
 }   

calfmark avatar Sep 27 '20 08:09 calfmark

相关问题已实现或修复。如果还有其他问题,非常欢迎你直接参与到这个 OP。

esofar avatar Oct 03 '20 00:10 esofar