【问题标题】:Jekyll content being duplicated on pageJekyll 内容在页面上重复
【发布时间】:2021-02-23 18:54:29
【问题描述】:

我正在使用带有 bulma-clean-theme 的 github 页面,当我在本地渲染我的页面时,它显示得很好并且没有问题。但是,当我在 github 上查看我的网站上的博客文章时,我看到网站上的内容重复了!

这是最有可能导致此结果的区域,我从主题更改为 pages.html

<div class="content">

    <h2><a href="{{ page.url }}">{{ page.title }}</a></h2>
      <div class="meta"><i class="fa fa-calendar" aria-hidden="true"></i> Published {{ page.date | date: '%B %d, %Y' }} by 
        <i class="fa fa-user" aria-hidden="true"></i> FoxDeploy
        <i class="fa fa-hourglass" aria-hidden="true"></i> <i>{{ content | reading_time_as_s }} average reading time</i>
      </div>      
      <a href="{{ post.url }}"><img src="{{ post.header }}{{ post.coverImage }}"></a><br>   
    {{ content }}
</div>

【问题讨论】:

    标签: jekyll jekyll-extensions


    【解决方案1】:

    我发现了错误!

    我使用的是"jekyll-time-to-read" gem,它在 github 页面上不受支持。这个插件将通过一个新的 Liquid 命令解析content 来计算阅读帖子所需的时间。

     <i>{{ content | reading_time_as_s }} average reading time</i>
    

    由于它不受支持,因此页面将呈现帖子的全部内容,然后在帖子后面加上一个蹩脚的 average reading time

    目前的解决方法是从我的帖子中删除该位并删除插件,问题就解决了。

    【讨论】:

      猜你喜欢
      • 2011-02-25
      • 2016-08-07
      • 2018-03-15
      • 1970-01-01
      • 2015-06-20
      • 1970-01-01
      • 1970-01-01
      • 2017-12-26
      • 1970-01-01
      相关资源
      最近更新 更多