文章加密TEST2

hexo-blog-encrypt

  1. 安装插件

    $ npm install --save hexo-blog-encrypt
    
  2. 配置

    站点配置文件,添加

    # Security
    ##
    encrypt:
        enable: true
    

    文章头部:

    ---
    title: 标题
    date: 时间
    tags: 标签
    password: 密码
    abstract: 文章摘要,显示在博客首页
    message: 密码输入框上面的描述性文字
    ---
    
  3. 自定义

    • 对TOC加密

      <% if(post.toc == true){ %>
          
      style="display:none" <% } %>> Index <% if (post.encrypt == true) { %> <%- toc(post.origin, {list_number: true}) %> <% } else { %> <%- toc(post.content, {list_number: true}) %> <% } %>
      <% } %> <%- post.content %>
    • 修改加密模板

      # Security
      ##
      encrypt:
          enable: true
          default_abstract: the content has been encrypted, enter the password to read.
          default_message: Please enter the password to read.
          default_template:
                          
                          
    • 自定义

      文章头部

      ---
      title: hello world
      date: 2016-03-30 21:18:02
      tags:
          - fdsfadsfa
          - fdsafsdaf
      password: Mike
      abstract: Welcome to my blog, enter password to read.
      message: Welcome to my blog, enter password to read.
      template:
              
              
      ---

你可能感兴趣的:(文章加密TEST2)