生成永久链接

第一步

  • 安装插件
    1
    npm install hexo-abbrlink --save

第二步

  • 修改_config.yml 中的对应文件
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    ## permalink: :year/:month/:day/:title/
    permalink: posts/:abbrlink.html ## 此处可以自己设置
    ## abbrlink config
    abbrlink:
    alg: crc32 #support crc16(default) and crc32 进制
    rep: hex #support dec(default) and hex 算法
    drafts: false #(true)Process draft,(false)Do not process draft. false(default)
    ## Generate categories from directory-tree
    ## depth: the max_depth of directory-tree you want to generate, should > 0
    auto_category:
    enable: true #true(default)
    depth: #3(default)
    over_write: false
    auto_title: false #enable auto title, it can auto fill the title by path
    auto_date: false #enable auto date, it can auto fill the date by time today
    force: false #enable force mode,in this mode, the plugin will ignore the cache, and calc the abbrlink for every post even it already had abbrlink.
    permalink_defaults:
    pretty_urls:
    trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
    trailing_html: true # Set to false to remove trailing '.html' from permalinks

本地三连预览

1
hexo clean; hexo g; hexo s