16500682
V2EX  ›  Hexo

Hexo 如何优化 URL 结构?

  •  
  •   16500682 · Jan 7, 2017 via iPhone · 4311 views
    This topic created in 3608 days ago, the information mentioned may be changed or developed.
    个人比较喜欢目录 /id.html 的方式但是 hexo 的 id 太长太乱了。
    Supplement 1  ·  Jul 24, 2017
    发现一个插件,已经愉快的用上了 hexo
    https://github.com/rozbo/hexo-abbrlink
    12 replies  •  2017-01-14 22:49:14 +08:00
    helloSwift
    helloSwift
    Jan 7, 2017 via iPhone❤️1
    1
    自己每次定义 ID 就行了

    在每篇博客的 ----- 前面
    添加一行 id:
    16500682
    16500682
    OP
    Jan 7, 2017 via iPhone
    2
    @helloSwift 没有改变其命名方式的办法吗
    helloSwift
    helloSwift
    Jan 7, 2017 via iPhone
    3
    @16500682 应该可以自定义每篇 md 博客的头部(------的前面),比如分类,标签,标题, ID 之类的,我是每次手动的😂
    Dvel
    Dvel
    Jan 7, 2017
    5
    = =。。。
    卧槽,我刚试了一下后面接 ID
    给我生成了这个: cixn53y8a0001p1jbcw6cmges
    真是又臭又长啊。。。
    Showfom
    Showfom
    PRO
    Jan 7, 2017 via iPhone
    6
    @Dvel 和 JB 一样嘛😹
    ywUXm9U86a62N7rN
    ywUXm9U86a62N7rN
    Jan 7, 2017
    7
    @helloSwift @16500682 其实可用分类别名和文章标题做链接,这样最合理,标题尽量用英文(目前不知道能不能直接写中文标题,然后转成英文),因为文章 id 不是唯一的,我以前试过加个变量用时间戳,但是很麻烦
    helloSwift
    helloSwift
    Jan 7, 2017 via iPhone
    8
    @shuoit 我的 ID 是手动设置的,唯一的,我想怎么定义就怎么定义,这种方案比较适合我,一般用数字,特殊的某篇用字母
    16500682
    16500682
    OP
    Jan 7, 2017 via iPhone
    9
    @Dvel
    @shuoit
    目前在用 Typecho 这几乎是我不用 hexo 的唯一原因
    16500682
    16500682
    OP
    Jan 8, 2017 via iPhone
    10
    似乎还是没有好的解决方案
    fourstring
    fourstring
    Jan 14, 2017
    11
    Hexo 默认就在 front-matter 里面提供了 Permalink 选项来支持自定义链接地址的。
    具体可以看我的拙作: https://n4l.pw/how-to-set-up-hexo-blog-on-linux.html#自定义链接格式太蠢
    fourstring
    fourstring
    Jan 14, 2017
    12
    @fourstring 另外还有一个解决办法,这也是我现在的办法,比较简单。
    执行 hexo new 时就用一个自定义链接名作为文章标题,在写文章时再去修改 title 值
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4829 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 113ms · UTC 02:37 · PVG 10:37 · LAX 18:37 · JFK 21:37
    ♥ Do have faith in what you're doing.