BF添加输入页数跳转
发表于更新于
字数总计:248阅读时长:1分钟阅读量:
QX-AI初始化中...
暂无预设简介,请点击下方生成AI简介按钮。
前言
  以后文章多了页数也会多起来,bf没有输入页码跳转实在不方便,现在就加上这个功能好。

实现
  修改\layout\includes\pagination.pug替换else后的源码,或者对应着修改。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
   | else   nav#pagination     .pagination       if is_home()         - options.format = 'page/%d/'       !=paginator(options)       if is_home()         input#textnumer(oninput="value=value.replace(/[^0-9]/g,'')" maxlength="3" onkeyup='this.value=this.value.replace(/[^u4e00-u9fa5w]/g,"")')         a#textbtn(onclick='textbtn()') 跳转     if is_home()       .js-css         script.           function textbtn(){var e=document.querySelectorAll(".page-number"),t=e[e.length-1].innerHTML,n=Number(t),a=document.getElementById("textnumer"),o=Number(a.value);if(""!=o&&!isNaN(o)&&o%1==0)if(1==o)document.getElementById("textbtn").href="/";else if(o>n){var d="/page/"+n+"/";document.getElementById("textbtn").href=d}else d="/page/"+a.value+"/",document.getElementById("textbtn").href=d}         style.           #pagination .pagination .extend{display: none!important}
 
   | 
 
  css的话,没有通用的,怎么好看怎么改。
后记
  暂无