Hexo主題實現多級分類顯示,hexo主題
前言
最近在搞一個部落格,是託管在github和gitcafe上的,利用Hexo產生的。
之後,發現一個問題,顯示的分類都是一級的。而我想要的是:能顯示多級分類,層次分明`的那樣。
問題
基本主題內建的分類顯示都是一級的,如何顯示多級?
解決方案
所以,研究了一下,找到了理想的方法,方法如下:
樣本
說明:我使用的是jacman主題,以這個主題為例說明。
在主題檔案夾下找到source/css/_partial/aside.styl檔案,其他的也可能是source/css/_partial/sidebar.styl。反正,能在頁面顯示即可。
添加新的樣式,我的如下:
//categories.category-block>ul>li border-bottom 1px solid #ccc.category-block li margin-bottom 8px.category-list @media mini width 45% float left margin 0 5% 0 0 @media tablet width 100% float none margin .5em 0 0 .categoriy-list-item padding .5em 5% .category-list-count top -.5em padding-left .3em font-size 75% line-height 0 position relative vertical-align baseline ul, ol, dl list-style none ul, ol, dl background-color #f9f9fa margin-left 20px li border-bottom 1px dashed #ccc .category-list-child border-top 1px dashed #ccc margin-bottom 8px
想實現不同的樣式,自己可以修改。
原文來自:http://git.seay.me