tags: Hexo yilia Copyright Notice
Add copyright statement, renderings:
reference:
inthemes/yilia/layout/_partial/article.ejsThe specified location of the file is as follows:
<%- post.content %>
<% } %>
<-- Add code here-->
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 && post.reward)) && !index){ %>
Add the following code:
<!-- Add copyright notice -->
<%
var sUrl = url.replace(/index\.html$/, '');
sUrl = /^(http:|https:)\/\//.test(sUrl) ? sUrl : 'https:' + sUrl;
%>
<% if ((theme.declare_type === 2 || (theme.declare_type === 1 && post.declare)) && !index){ %>
<div class="declare">
<strong>Author:</strong>
<% if(config.author != undefined){ %>
<%= config.author%>
<% }else{%>
<font color="red">Please fill in the correct "author" in the blog root directory "_config.yml"</font>
<%}%>
<br>
<strong>Links to this article:</strong>
<a href="<%= config.url %>/<%= post.path %>" title="<%= post.title %>" target="_blank"><%= config.url %>/<%= post.path %></a>
<br>
<strong>Copyright Notice:</strong>
This work uses
<a rel="license" href="<%= theme.licensee_url%>"><%= theme.licensee_name%></a>
Make permission. Please indicate the source!
<% if(theme.licensee_img != undefined){ %>
<br>
<a rel="license" href="<%= theme.licensee_url%>"><img alt="Creative Commons License Agreement" style="border-width:0" src="<%= theme.licensee_img%>"/></a>
<% } %>
</div>
<% } else {%>
<div class="declare" hidden="hidden"></div>
<% } %>
<!-- Add copyright notice -->
In fileyilia/source/main.0cf68a.cssAdd in:
/*Style of copyright notice*/
.declare {
background-color: #eaeaea;
margin-top: 2em;
border-left: 3px solid #ff1700;
padding: .5em 1em;
}
In filethemes/yilia/_config.ymlAdd in:
# Copyright Notice
#In the md file header of the article that requires copyright declaration, set the attribute declare: true.
#Copyright Basic Settings: 0-Close the statement; 1-The md file corresponding to the article has the declare: true attribute to have a copyright statement; 2-All articles have a copyright statement
declare_type: 1
licensee_url: https://creativecommons.org/licenses/by-nc-sa/4.0/ #The copyright agreement address of the current application.
licensee_name: 'Creative Commons Attribution-Non-commercial use-Share in the same way 4.0 International License Agreement' #Copyright agreement name
licensee_img: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png #Copyright agreement logo
Effect picture:
modify:H:\Hexo\themes\yilia\_config.yml:
# Copyright Notice
#In the md file header of the article that requires copyright declaration, set the attribute declare: true.
#Copyright Basic Settings: 0-Close the statement; 1-The md file corresponding to the article has the declare: true attribute to have a copyright statement; 2-All articles have a copyright statement
declare:
declare_type: 1
licensee_url: https://creativecommons.org/licenses/by-nc-sa/4.0/ #The copyright agreement address of the current application.
licensee_name: 'CC BY-NC-SA 4.0' #Copyright agreement name
licensee_alias: 'Creative Commons Attribution-Non-commercial use-Share in the same way 4.0 International License Agreement' # alias alias
licensee_img: https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png #Copyright agreement logo
NewH:\Hexo\themes\yilia\layout\_partial\post\declare.ejs:
<!-- "Add copyright notice -->
<!--Add a copyright statement https://github.com/JoeyBling/hexo-theme-yilia-plus/commit/c1215e132f6d5621c5fea83d3c4f7ccbcca074a3-->
<%
var sUrl = url.replace(/index\.html$/, '');
sUrl = /^(http:|https:)\/\//.test(sUrl) ? sUrl : 'https:' + sUrl;
%>
<!-- #Copyright basic settings: 0-close the statement; 1-The md file corresponding to the article has declare: true attribute to have a copyright statement; 2-All articles have a copyright statement -->
<% if ((theme.declare.declare_type === 2 || (theme.declare.declare_type === 1 && post.declare)) && !index){ %>
<div class="declare">
<strong class="author">Author:</strong>
<% if(config.author != undefined){ %>
<%= config.author%>
<% }else{%>
<font color="red">Please fill in the correct "author" in the blog root directory "_config.yml"</font>
<%}%>
<br>
<strong class="create-time">release time:</strong>
<%- date(post.date, 'YYYY-MM-DD') %>
<br>
<strong class="update-time">latest update:</strong>
<%- date(post.updated, 'YYYY-MM-DD') %>
<br>
<strong class="article-titles">Title of this article:</strong>
<a href="<%= config.url %>/<%= post.path %>" title="<%= post.title %>" target="_blank"><%= post.title %></a>
<br>
<strong class="article-url">Links to this article:</strong>
<a href="<%= config.url %>/<%= post.path %>" title="<%= post.title %>" target="_blank"><%= config.url %>/<%= post.path %></a>
<br>
<strong class="copyright">Copyright Notice:</strong>
This work uses
<a rel="license" href="<%= theme.declare.licensee_url%>" title="<%= theme.declare.licensee_alias %>"><%= theme.declare.licensee_name%></a>
License agreement for licensing. Please indicate the source!
<% if(theme.declare.licensee_img != undefined){ %>
<br>
<a rel="license" href="<%= theme.declare.licensee_url%>"><img alt="Creative Commons License Agreement" style="border-width:0" src="<%= theme.declare.licensee_img%>"/></a>
<% } %>
</div>
<% } else {%>
<div class="declare" hidden="hidden"></div>
<% } %>
<!-- Add copyright statement -->
modifyH:\Hexo\themes\yilia\layout\_partial\article.ejs
<!-- "Add copyright notice -->
<% if(theme.declare){%>
<%- partial('post/declare') %>
<% } %>
<!-- Add copyright statement -->
Effect picture:
The article was first published in:hexo+yilia add copyright notice
Some of the articles that add directories are self-adding css files and theme configurations. The author also updated the functionality of the article's general catalog. Open configuration filethemes/...
Review articles on a similar method as follows: 1. Add widgetpack theme configuration Modify hexo blog directorytheme/yilia middle _config.yml File, add the following configuration: 2. Add code files ...
This article discusses only the code added or modified in yila, the relevant leancloud application and configuration, please refer to my referenced two blog posts: "Hexo yilia theme Add valine co...
Hexo yilia theme add article visit statistics Because of love, so work hard. --RuiDer Leading must Github + hexo themed blog Your heart hexo add traffic function tool Hexo added access statistics func...
Hexo + yilia theme add Subnav social icon I want to add my own CSDN blog address and brief book on Subnav. . Operate like this Make picture text I recommend a URL where you can search for the icon you...
Article Directory First, increase the album function 1. Principle 2. Modify the code 2.1 New blog's photos page 2.2 New local picture library 2.3 Modify the path in `tool.py` 2.4 Every time you upload...
Article Directory installation 1. Install the plugin 2. Choose a model 3. Configuration 4. Effect picture supplement Cancel Kanban Girl Being not Uninstall plugin Add live2d kanban girl, plug-in: hexo...
Article Directory 1. Sign up for leancloud 2.hexo settings 2.1 Add comment settings in blog theme files 2.2 Add valine comments to `article.ejs` 2.3 New file `valine.ejs` 3. Generate release 4. View d...
HEXO-YILIA Add Valine Review System Configuration steps I. Creating an application II. Profile under .yilia 3. The whole review system is created, look at the results! If you have any questions, pleas...
Edit theme file:single.php Insert the code snippet at the position below: code show as below: The effect is as follows:...