title: hexo创建的tags和categories页面为空的解决办法

toc: false

date: 2018-04-16 02:26:10


主题:landscape

添加type以及menu后仍然显示空白的解决办法:

打开landscape/_partial/article.ejs,

<div class="article-entry" itemprop="articleBody">的div内添加代码:

<% if (page.type === "tags") { %>
<div class="tag-cloud">
<div class="tag-cloud-title">
<%- "TOTAl : " + site.tags.length %>
</div> <div class="tag-cloud-tags">
<%- tagcloud({
min_font: 12,
max_font: 30,
amount: 200,
color: true,
start_color: '#555',
end_color: '#111'
}) %>
</div>
</div> <% } else if (page.type === 'categories') { %> <div class="category-all-page">
<div class="category-all-title">
<%- "TOTAL : " + site.categories.length %>
</div> <div class="category-all">
<%- list_categories() %>
</div> </div>
<% } %>

重新打开即可看到正常显示的标签和分类页。

修改categories页面样式(也可以自己设计修改):

打开landscape/source/css/_partial/article.styl,在尾部添加:

.category-all-page {
a:link {
font-size: 14px;
color: #333;
text-decoration: none;
}
a:hover {
font-size: 14px;
color: #d8d;
text-decoration: none;
font-weight: bold;
}
.category-all-title { text-align: left; } .category-all {
margin-top: 20px;
} .category-list {
margin: 0;
padding: 0;
list-style: none;
} .category-list-item {
text-align: center;
display: inline-block;
margin: 8px;
padding: 8px;
width: 150px;
position: relative;
background-color: rgba(237, 237, 237, 0.53);
border-radius: 1px;
box-shadow:0px 0px 0px 1px #ccc;
} .category-list-link {
color: #333;
} .category-list-count {
color: #333;
&:before {
display: inline;
content: " ("
}
&:after {
display: inline;
content: ") "
}
} .category-list-child { padding-left: 10px; color: #333;}
}

hexo创建的tags和categories页面为空的解决办法的更多相关文章

  1. 如何创建Hexo站点的Tags和Categories默认页面

    安装Hexo的categories生成插件 1 $ npm install hexo-generator-category --save 安装Hexo的Tags生成插件 1 $ npm install ...

  2. ie、firefox、chrome中关于style="display:block" 引发的页面布局错乱的解决办法

    ie.firefox.chrome中关于style="display:block" 引发的页面布局错乱的解决办法: table中tr 添加style="display:b ...

  3. Vivado SDK 2014.2 创建新工程后,BSP版本不对的解决办法

    问题描述如下: 1. 使用Vivado SDK 2014.2已经创建了工程,但是此时,hdf文件增加了外设,需要重新创建工程以更新SDK中的外设描述: 2. 使用新的hdf创建工程后,发现system ...

  4. 创建link server链接服务器碰到的问题及解决办法

    问题描述 今天在做数据库迁移,然后新建link server(链接服务器)的时候,碰到以下问题. 我的sql 脚本是这样的. 然后,执行的时候就收到以下错误信息. Msg 468, Level 16, ...

  5. Eclipse/MyEclipse向HDFS中如创建文件夹等操作报错permission denied解决办法

    不多说,直接上干货! 问题现象 当执行创建文件的的时候, 即: String Path = "hdfs://host2:9000"; FileSystem fileSystem = ...

  6. Hexo 搭建博客 本地运行 常见报错及解决办法

    作为一名在hexo方面的新手,我在使用hexo编辑文档时遇到了很多问题,hexo generate编译的时候遇到了各种错误. 在此将这些错误及其解决方案记录下来,以便日后查证之用,同时,也可给各位在遇 ...

  7. 【Azure Developer】使用Microsoft Graph API 批量创建用户,先后遇见的三个错误及解决办法

    问题描述 在先前的一篇博文中,介绍了如何使用Microsoft Graph API来创建Azure AD用户(博文参考:[Azure Developer]使用Microsoft Graph API 如 ...

  8. 创建URL为空的解决办法

    在使用+URLWithString:或-initWithString:创建一个URL对象时,提供的参数字符串必须符合RFC 2396标准(O网页链接.而这两个方法又是根据RFC 1738(O网页链接和 ...

  9. dedesms中的导致生成静态页面多出空白行解决办法

    前几天给朋友用织梦仿一个手机网站,保存处理好的代码,页面头部在浏览里莫名其妙多了一段空白区域,用调试工具查看,发现是代码里多了一行&#65279.后来发现很多网友在生成织梦页面的时候,头部 ...

随机推荐

  1. 在centos上面开机自启动某个程序

    Systemd 是 Linux 系统工具,用来启动守护进程,已成为大多数发行版的标准配置.可以通过 systemctl --version 命令来查看使用的版本 常用命令 # 立即启动一个服务 $ s ...

  2. Fragment间相互调用并传值

    public class MainFragment extends Fragment { private static final String ARG_DATE="com.example. ...

  3. SQL纯手写创建数据库到表内内容

    建表啥的只点点鼠标,太外行了,不如来看看我的纯手写,让表从无到有一系列:还有存储过程临时表,不间断的重排序: 一:建数据库 create Database Show on primary ( name ...

  4. vue入门--简单嵌套路由的一个路径小问题

    假设现在有一个项目,刚进去要显示main页面下的contorl页面,那么路由里面的初级路由应该是{main和err},这两个是同一级,然后{control和set}是main下的子路由,foot是这两 ...

  5. struts2学习之基础笔记4

    拦截器 1.自定义拦截器类,必须继承AbstractInterceptor类(抽象类) 重写public String intercept (ActionInvocation arg0) 2.在Str ...

  6. Android跳转到系统Wifi界面的方式

    第一种 Intent intent = new Intent(); intent.setAction("android.net.wifi.PICK_WIFI_NETWORK"); ...

  7. 代码行数统计(mac)

    如何统计自己的代码量?下面介绍两个方法: 一.cloc 1.首先,安装homebrew,已安装的请跳过. 打开终端工具Terminal,输入下列命令.过程中会让你按RETURN键以及输入mac桌面密码 ...

  8. 自定义一个简单的web框架

    from wsgiref.simple_server import make_server def book(request):     #视图函数 return [b'<h1> book ...

  9. 关于使用css伪类实现小图标

    效果: .person_use>span{ display:block; width:0; height:0; border-width:10px; border-style:solid; bo ...

  10. Codeforces Round #499 (Div. 2) F. Mars rover_dfs_位运算

    题解: 首先,我们可以用 dfsdfsdfs 在 O(n)O(n)O(n) 的时间复杂度求出初始状态每个点的权值. 不难发现,一个叶子节点权值的取反会导致根节点的权值取反当且仅当从该叶子节点到根节点这 ...