Jekyll-在index.html中找不到文件" [英] Jekyll - Couldn't find file '' in `index.html`

查看:101
本文介绍了Jekyll-在index.html中找不到文件"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了要在主页上显示的视频的元数据,如下所示:

I added the meta data for the videos to be displayed on the home page as follows:

index.html:

index.html:

---
layout: default
title: lorem ipsum
description: |
  loren ipsum dolor sit amet, consectetur adipiscing elit. 
  Pellentesque rutrum lacus sed quam pulvinar cursus. Fusce dictum dolor.
animVideo:
  mp4: /videos/Satoshi-intro.mp4
  webm: /videos/Satoshi-intro.webm
  ogv: /videos/Satoshi-intro.ogv
  poster: /videos/Satoshi-intro.png
(...more data)
---
{% include hero-slider.html %}
<div class="section text-center bg-gray"  id="content" >
  <div class="container">
    ...
{% include why-use-s.html %}

当我运行"bundle exec jekyll serve"时,出现错误:

When I run 'bundle exec jekyll serve', I get the error:

Liquid Exception: couldn't find file '' in `index.html' Checked in these paths: /var/etcetcetc ...
jekyll 3.8.1 | Error:  couldn't find file '' in `index.html'

我可以确认错误是由于上面添加的元数据animVideo引起的.没有它,该站点可以正常运行.但是,添加视频文件后,出现上述错误.视频文件的文件夹路径似乎正确,该路径位于根文件夹/videos/[files]上.元数据的格式似乎也很好.

I can confirm the error is due to the meta-data animVideo added above. The site runs fine without it. However, with the video files added, I get the above error. The folder path to the video files appears to be correct, which is located on the root folder /videos/[files]. The format of meta data seems to be fine as well.

我没有想法,如何进一步进行,如何调试&找到问题的原因,然后转向Stackoverflow.

I am without ideas, how to proceed further, how to debug & find the cause of the issue, hence turning to Stackoverflow.

谢谢

根据要求,下面是视频嵌入代码(我认为这不是令人讨厌的问题.

As requested, here is the video embed code (which I believe is not the offending issue here.

why-use-s.html:

why-use-s.html:

  <div class="container">
    {% if page.animVideo %}
    <div class="row">
      <div class="col-sm-12 text-center">
        <video id="introVideo" controls preload="auto" poster="{{ page.animVideo.poster }}">
          <source src="{{ page.animVideo.mp4 }}" type="video/mp4"/>
          <source src="{{ page.animVideo.webm }}" type='video/webm; codecs="vp8, vorbis"'/>
          <source src="{{ page.animVideo.ogv }}" type='video/ogg  codecs="theora, vorbis"' />
          <!-- Fallback object using Flow Player -->
          <object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"
                  width="640" height="360">
            <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"/>
            <param name="allowFullScreen" value="true"/>
            <param name="wmode" value="transparent"/>
            <param name="flashVars"
                   value="config={'playlist':[ '{% pic '{{ page.image }}' %}',{'url':'{{ page.animVideo.mp4 }}','autoPlay':true}]}"/>
            <img alt="My Movie" src="{{ page.animVideo.poster }}" width="640" height="360"
                 title="No video playback capabilities."/>
          </object>
          <!-- Fallback Text -->
          Your browser does not appear to support a video.
        </video>
      </div>
    </div>
 ...

这是文件夹结构,index.html位于pages文件夹& videos在根文件夹中:

And here is the folder structure, the index.html is within pages folder & videos is in root folder:

推荐答案

没有要调试的代码,我只能猜测这个自定义标签存在问题:

Without code to debug I can only guess that you have a problem with this custom tag :

{% pic '{{ page.image }}' %}

如果page.image为空,则pic标记正在查找不存在的''.

If page.image is null, pic tag is looking for '' wich doesn't exists.

这篇关于Jekyll-在index.html中找不到文件"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆