日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

NexT 高级配置

發布時間:2025/3/15 编程问答 13 豆豆
生活随笔 收集整理的這篇文章主要介紹了 NexT 高级配置 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前一篇文章介紹了NexT的基本配置,其主要涉及兩個配置文件第一個是主目錄下的_config.yml,另一個是我們的主題配置文件thems/next/_config.yml,接下來我們繼續深入。

添加社交網址

在thems/next/_config.yml查找 social,找到如下代碼:

# Social Links. # Usage: `Key: permalink || icon` # Key is the link label showing to end users. # Value before `||` delimeter is the target permalink. # Value after `||` delimeter is the name of FontAwesome icon. If icon (with or without delimeter) is not specified, globe icon will be loaded. social:#GitHub: https://github.com/yourname || githubE-Mail: mailto:yourname@gmail.com || envelope#Weibo: https://weibo.com/yourname || weibo#Google: https://plus.google.com/yourname || google#Twitter: https://twitter.com/yourname || twitter#FB Page: https://www.facebook.com/yourname || facebook#VK Group: https://vk.com/yourname || vk#StackOverflow: https://stackoverflow.com/yourname || stack-overflow#YouTube: https://youtube.com/yourname || youtube#Instagram: https://instagram.com/yourname || instagram#Skype: skype:yourname?call|chat || skype 復制代碼

去掉 social 的注釋并將你需要展示的信息網址注釋去掉,可以修改名稱和網址。

效果如圖:

頁面底部添加訪問量

在thems/next/_config.yml查找 busuanzi

busuanzi_count:enable: truetotal_visitors: truetotal_visitors_icon: usertotal_views: truetotal_views_icon: eyepost_views: truepost_views_icon: eye 復制代碼

效果如圖:

為文章添加評論與閱讀次數

在leancloud上面注冊帳號,新建一個應用,找到應用對應的appid和appkey,然后在thems/next/_config.yml查找 valine,將填入appid和appkey以下代碼中,相應字段設為true:

valine:enable: true # When enable is set to be true, leancloud_visitors is recommended to be closed for the re-initialization problem within different leancloud adk version.appid: # your leancloud application appidappid: # your leancloud application appkeynotify: false # mail notifier , https://github.com/xCss/Valine/wikiverify: false # Verification codeplaceholder: Just go go # comment box placeholderavatar: mm # gravatar styleguest_info: nick,mail,link # custom comment headerpageSize: 10 # pagination sizevisitor: true # leancloud-counter-security is not supported for now. 復制代碼

為頁面添加搜索功能

在thems/next/_config.yml查找 local_search,并將enable設為true。

local_search:enable: true# if auto, trigger search by changing input# if manual, trigger search by pressing enter key or search buttontrigger: auto# show top n results per article, show all results by setting to -1top_n_per_article: 1# unescape html strings to the readable oneunescape: false 復制代碼

然后訪問注釋提供的網址,按它的步驟操作。

文章分享鏈接

在thems/next/_config.yml查找 needmoreshare,并將enable設為true。

needmoreshare2:enable: truepostbottom:enable: trueoptions:iconStyle: boxboxForm: horizontalposition: bottomCenternetworks: Weibo,Wechat,Douban,QQZone,Twitter,Facebookfloat:enable: trueoptions:iconStyle: boxboxForm: horizontalposition: middleRightnetworks: Weibo,Wechat,Douban,QQZone,Twitter,Facebook復制代碼

然后訪問注釋提供的網址,按它的步驟操作。

博客頁腳記時

打開 \themes\next\layout\_partials\footer.swig,在最下面添加如下代碼:

<script>var now = new Date();function createtime() {var grt= new Date("12/03/2018 00:00:00");//此處修改你的建站時間或者網站上線時間now.setTime(now.getTime()+250);days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days);hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours);if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;}seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;}document.getElementById("timeDate").innerHTML = "Running for "+dnum+" Days ";document.getElementById("times").innerHTML = hnum + " Hours " + mnum + " m " + snum + " s";}setInterval("createtime()",250); </script> 復制代碼

并將以下代碼放在這個文件你喜歡的位置,然后查看效果。

<div> <span id="timeDate"></span><span id="times"></span> </div> 復制代碼

NexT高級配置就介紹這么多,至此,我們已搭建出一個比較完整的博客,然后接下來就可以快樂的寫博客啦!

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的NexT 高级配置的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。