github+hexo搭建自己的部落格網站(四)主題之外的一些基本配置(統計配置,網站訪問量顯示)

來源:互聯網
上載者:User

標籤:new   ejs   rip   com   ace   div   pre   bst   網站   

 1、百度、Google統計配置

百度統計配置

  • 申請帳號:https://tongji.baidu.com/web/welcome/login
  • 代碼擷取的地方只要填入key即可

註冊的時候,填的網域名稱和url,我選的都是https://saucxs.github.io/

 

在yilia主題下檔案裡themes\yilia檔案夾下的_config.yml)找到這個baidu_analytics

# Miscellaneousbaidu_analytics: ‘ace6dXXXXXXXXXXfbc‘google_analytics: ‘UA-9700XXXXXXXXXXXXXX‘

就可以統計網站訪問情況了,如,點擊查看報告

 

 查看報告,就可以看到具體的統計分析。

 

Google統計同理

 

2、網站訪問量顯示

2.1實現方法

  • 使用了不蒜子第三方的統計外掛程式,網址:http://ibruce.info/2015/04/04/busuanzi/
  • themes\yilia\layout\_partial下的footer.ejs中加入如下代碼即可,紅色部分是需要新增加的代碼。
<footer id="footer">  <div class="outer">    <div id="footer-info">        <div class="footer-left">            &copy; <%= date(new Date(), ‘YYYY‘) %> <%= config.author || config.title %>        </div>      <!--統計start-->      <script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">      </script>      <span id="busuanzi_container_site_pv">    本站總訪問量<span id="busuanzi_value_site_pv"></span>次  </span>      <span id="busuanzi_container_site_uv">  總訪客數<span id="busuanzi_value_site_uv"></span>人次  </span>      <!--統計end-->          <div class="footer-right">              <a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten          </div>    </div>  </div></footer>

 

2.2顯示效果

 

github+hexo搭建自己的部落格網站(四)主題之外的一些基本配置(統計配置,網站訪問量顯示)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.