GitHub Pages构建失败:Jekyll::Page无yaml_file?方法报错
解决GitHub Pages构建错误:
undefined method 'yaml_file?' for Jekyll::Page 问题简述
维护的GitHub Pages仓库仅修改了index.md内容,构建时报错:
github-pages 230 | Error: undefined method `yaml_file?' for #<Jekyll::Page @name="01-platform-description.md">
错误触发于页面摘要(excerpt)渲染环节,当前环境为github-pages v230、Jekyll 3.9.5,使用primer主题。
可行解决方案
- 修正页面Front Matter:确保
01-platform-description.md开头包含合法的Front Matter标记(用---包裹,即使内容为空),Jekyll依赖该标记识别摘要分隔逻辑。示例:--- --- 页面正文内容... - 关闭自动摘要生成:在
_config.yml中添加全局配置,禁用自动摘要功能:
或在目标页面的Front Matter中手动设置空摘要:excerpt_separator: ""--- excerpt: "" --- - 切换兼容主题:当前使用的
jekyll-theme-primer 0.6.0可能与Jekyll 3.9.5存在方法调用冲突,可尝试更换为GitHub Pages支持的其他主题(如minimal),修改_config.yml的theme字段:theme: jekyll-theme-minimal - 本地调试定位:本地安装对应版本的github-pages依赖,执行
bundle exec jekyll build,可更直观地定位触发错误的具体代码逻辑,便于针对性修复。
内容的提问来源于stack exchange,提问作者Brooke Gibbons
相关产品推荐
相关产品推荐

