【问题标题】:Jekyll/Kramdown link within page页面内的 Jekyll/Kramdown 链接
【发布时间】:2017-04-27 16:50:29
【问题描述】:

我在 Github 上使用 Jekyll 和 Kramdown,我想知道是否有办法链接到页面中的一行。说我有

some line here

稍后我想链接到这一行。如果这一行是一个部分,那么an ID would be autogenerated。但这里只是一条简单的线。我试着把

some line here {#idhere}

后来的链接为

[link](#idhere)

但是没有用。

【问题讨论】:

    标签: html jekyll kramdown


    【解决方案1】:

    使用块内联属性列表跟随块:{: id="one_id"} 或简短版本:{: #one_id}

    在你的例子中:

    some line here 
    {: id="idhere"}
    

    some line here 
    {: #idhere}
    

    后来的链接为

    [link](#idhere)
    

    【讨论】:

    • 它不起作用;它只是在行后显示为“{: id="idhere"}”或“{: #idhere}”。
    • 好的,好像ID部分只需要单独放在一行。
    • @user7843034 就是这样!已修复。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多