ccbikai
V2EX  ›  问与答

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

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

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

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