V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
shuoit
V2EX  ›  Hexo

hexo 分类别名和标签别名咋样的,官网一笔带过,自己配了半天,没什么卵用啊

  •  
  •   shuoit · 2017-01-07 20:39:45 +08:00 · 2379 次点击
    这是一个创建于 2637 天前的主题,其中的信息可能已经有所发展或是发生改变。
    5 条回复    2017-01-07 22:39:15 +08:00
    DoraJDJ
        1
    DoraJDJ  
       2017-01-07 20:43:31 +08:00
    比如这样配置分类别名:

    category_map:
    自产物: create

    那么“自产物”这个分类的链接就不会是中文了

    就像这样: https://blog.yudachi.biz/go/create/
    shuoit
        2
    shuoit  
    OP
       2017-01-07 21:14:16 +08:00
    @DoraJDJ 试过你这样的
    category_map:
    test: testCate

    然而下边这样引用不到啊
    ------
    permalink: :Category/:title.html
    btjoker
        3
    btjoker  
       2017-01-07 22:11:17 +08:00
    ---
    title: Untitled
    tags: []
    categories: []
    date: 2016-12-04 10:48:22
    ---

    md 文章头部是这个样子的
    你装个 admin 插件不就好了, 运行后本地网页创建编辑 md 文件, 实时预览, 还能指定标签之类的
    shuoit
        4
    shuoit  
    OP
       2017-01-07 22:24:40 +08:00
    @btjoker 别名定义的那个拿不到啊
    shuoit
        5
    shuoit  
    OP
       2017-01-07 22:39:15 +08:00
    !!! 封贴

    戳到源码看了下,终于配置对了,网上资料都不靠谱啊,正确方式:
    ```
    # Category & Tag
    default_category: article
    category_map: {test: testCate}
    tag_map: {test: testTag}

    permalink: :category/:title.html

    ```

    现在就可以访问到别名 testCate 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5250 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 09:17 · PVG 17:17 · LAX 02:17 · JFK 05:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.