Jekyll - Couldn't find file '' in `index.html`

杀马特。学长 韩版系。学妹 提交于 2019-12-11 13:25:20

问题


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

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 %}

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'

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.

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

Thanks

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

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>
 ...

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


回答1:


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

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

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



来源:https://stackoverflow.com/questions/51041831/jekyll-couldnt-find-file-in-index-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!