【问题标题】:Jekyll Liquid Error, no implicit conversion of Integer to String. Zero information given and breaks when posts are generatedJekyll Liquid 错误,没有将 Integer 隐式转换为 String。生成帖子时给出的零信息和中断
【发布时间】:2019-11-08 23:26:59
【问题描述】:

我正在推送到 github 页面的网站存在问题。

我的 Gemfile 有 github-pages gem,而 jekyll gem 已被注释掉。

该错误没有提供任何关于文件路径 (/_layout/defaults.html) 的错误发生位置的信息,该文件路径在我的项目中不存在。构建不起作用,为网站提供服务也不起作用。如果有人能指出我在哪里可以找到更多信息的方向,或者在此之前遇到过这个问题,那就太棒了!

---
title: "New Website, First Post"
layout: post
date: '2019-10-08'
categories: hyperlisk first
---

Hello World! This is my first ever jekyll post on my website. This is a new experiece and I would like to thank Evan Pratten (@ewpratten) for creating most of this website for me.
Go to his <a href="https://retrylife.ca">website</a>, he has some cool stuff over there! This blog will contain cool things I discover, tutorials and possible some updates to bigger projects I am working on. One such project called HyperEngine. That will be explained in a later post. The post directly following it will be a giant post about linear algebra and something called Optimal Control Theory. 

^^ 那是唯一的帖子,并且在为帖子生成提要后立即发生错误 谢谢!

【问题讨论】:

    标签: jekyll github-pages


    【解决方案1】:

    您可能需要添加default 布局;听起来您的配置中的其他文件正在要求它。您收到的错误消息表明此布局模板在您的代码中的其他位置被引用。 (如果您可以分享指向您的仓库的指针,它将有助于更具体地回答您的问题!)

    特别是,除非您对配置做一些时髦的事情,否则 Jekyll 倾向于期望您拥有 _default.html 布局。请参阅 jekyll 文档 here

    您可以像这样添加一个最小布局(取自上面链接的页面):

    <!doctype html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>{{ page.title }}</title>
      </head>
      <body>
        {{ content }}
      </body>
    </html>
    

    此错误通常表明您正在尝试将某个值强制转换为另一种(不兼容的)类型。例如,请参阅this question,其中用户在尝试将整数转换为转义字符串时遇到了类似的错误。

    (我还建议克隆一个现有的 jekyll 网站,这样您就可以确保您的安装工作正常。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多