messagebus
V2EX  ›  问与答

jekyll 有没有控制文章题目输出长度的办法?

  •  
  •   messagebus · Jun 7, 2013 · 2870 views
    This topic created in 4896 days ago, the information mentioned may be changed or developed.
    一篇文章的题目是20个字,我只要输出12个字。

    有没有办法?今天搜了好久没有找到方法
    4 replies  •  1970-01-01 08:00:00 +08:00
    agassi_yzh
    agassi_yzh
    Jun 7, 2013
    1
    我记得是在文章中用<!--more-->标签
    你试试。窝现在用hexo了
    messagebus
    messagebus
    OP
    Jun 7, 2013
    2
    @agassi_yzh 我用这种方法截断内容,现在需要 #截断文章标题# 的方法
    bindiry
    bindiry
    Jun 8, 2013
    3
    用CSS或者js控制呗,参考:

    .title
    {
    width:200px;
    white-space:nowrap;
    word-break:keep-all;
    overflow:hidden;
    text-overflow:ellipsis;
    }
    messagebus
    messagebus
    OP
    Jun 8, 2013
    4
    @bindiry 感谢,用了css方法
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5298 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 06:19 · PVG 14:19 · LAX 22:19 · JFK 01:19
    ♥ Do have faith in what you're doing.