Hexo-文章版权追加
2016-04-03 17:34
369 查看
目前,网络中出现了一些不和谐因素,某些网站多次剽窃Hexo博友的原创文章。在对这些侵犯博友权益的网站提出谴责的同时,聪明的各位Geek们应该如何增强版权意识呢.
最简单的办法就是在自己的部落格文章里添加水印,即使这些网站通过爬虫私自收录我们的文章,读者也能在文章中轻易的发现原作者。
由于这种办法容易影响读者的阅读体验,我采用的是在每篇文章下面增加版权声明,将本篇文章的信息、初次刊登网站、作者信息追加进文章里面。
将会在非目录页面下执行名为
当然,你也可以自己DIY,修改显示的文字。
cd到
可以根据喜好修改格式。最后别忘了
最简单的办法就是在自己的部落格文章里添加水印,即使这些网站通过爬虫私自收录我们的文章,读者也能在文章中轻易的发现原作者。
由于这种办法容易影响读者的阅读体验,我采用的是在每篇文章下面增加版权声明,将本篇文章的信息、初次刊登网站、作者信息追加进文章里面。
article结构
cd到your_theme\layout\_partial\下,访问
article.ejs,在合适的位置添加
<% if(!index) { %> <%- partial('declare') %> <% } %>
将会在非目录页面下执行名为
declare的脚本。
具体显示内容
还是在your_theme\layout\_partial\下面,创建一个名为
declare.ejs的文件,在里面填写
<! -- 添加版权信息 --> <div class="article-footer-copyright"> <center>本文由<b><a href="<%= config.root %>index.html" target="_blank" title="<%= config.author %>"><%= config.author %></a></b>创作和发表,采用<b>BY</b>-<b>NC</b>-<b>SA</b>国际许可协议进行许可</center> <center>转载请注明作者及出处,本文作者为<b><a href="<%= config.root %>index.html" target="_blank" title="<%= config.author %>"><%= config.author %></a></b>,本文标题为<b><a href="<%- config.root %><%- post.path %>" target="_blank" title="<%= post.title %>"><%= post.title %></a></b></center> <center>本文链接为<b><a href="<%- config.root %><%- post.path %>" target="_blank" title="<%= post.title %>"><%- config.url %>/<%- post.path %></a></b>.</center> </div> <! -- 添加版权信息 -->
当然,你也可以自己DIY,修改显示的文字。
修改CSS样式
编写类对应的CSS代码cd到
your_theme\source\css\_partial下面,创建
copyright.styl
.article-footer-copyright { border-top: 1px solid #d3d3d3; margin: 10px auto; padding-left: 2em; width: 80%; } .article-footer-copyright span, .copyright abbr { color: #3d3d3d; } div.copyright { font-weight: bold; color: #fcb297; padding: 0.3em 0.5em; margin: 0 0 1em 0; border-bottom: none; background-color: #74a474; -moz-border-radius: 1em; -webkit-border-radius: 1em; -webkit-border-radius: 1em; border-radius: 1em; -moz-box-shadow: inset 0px 1px 0px 0px #eee; -webkit-box-shadow: inset 0px 1px 0px 0px #eee; -webkit-box-shadow: inset 0px 1px 0px 0px #eee; box-shadow: inset 0px 1px 0px 0px #eee; background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #aad2f0), color-stop(1, #8bc1ed)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #aad2f0), color-stop(1, #8bc1ed)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #aad2f0), color-stop(1, #8bc1ed)); background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #aad2f0), color-stop(1, #8bc1ed)); background: -moz--webkit-linear-gradient(center top, #aad2f0 5%, #8bc1ed 100%); background: -moz--moz-linear-gradient(center top, #aad2f0 5%, #8bc1ed 100%); background: -moz--ms-linear-gradient(center top, #aad2f0 5%, #8bc1ed 100%); background: -moz-linear-gradient(center top, #aad2f0 5%, #8bc1ed 100%); /* filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#aad2f0', endColorstr='#8bc1ed'); */ background-color: #74a474; border: 1px solid #dcdcdc; text-shadow: 1px 1px 0px #eee; } div.article-footer-copyright { margin-top: 2em; padding: 0.8em; border: 1px solid #d3d3d3; background-color: #ffffcc; } .article-footer-copyright p { line-height: 140%; margin: 10px; font-size: 100%; }
可以根据喜好修改格式。最后别忘了
@import '_partial/copyright
相关文章推荐
- 使用百度静态资源库bootstrap字体出现问题
- 再看知名应用背后的第三方开源项目
- Oracle-05-SQL语句概述、分类&SQL*PLUS概述(初识insert,desc,list,r,del,a,c,n等命令)
- 阅读笔记05
- Hexo-文章版权追加
- ZooKeeper做独立server执行(上)
- Android——实现欢迎界面的自动跳转(转)
- Android 贝塞尔曲线实现QQ拖拽清除效果
- 用iterator接口遍历collection
- 【BZOJ-3293&1465&1045】分金币&糖果传递×2 中位数 + 乱搞
- Linux压缩与解压缩
- memcpy(),strcpy(),strcat()的正确写法
- Android SQLiteOpenHelper
- iOS如何对包含date的数组进行排序
- if /else判断语句
- 模拟退火
- 怎么更好地终极理解递归算法
- 【hdu3544】 Alice's Game
- 第六周: 进程的描述和进程的创建
- 模拟退火