2015-12-01 58 views
0

我有一个基于Jekyll 3.0.1 based on this Kasper theme的博客,并进行了一些修改。为了减少我遇到的问题的自由度,我删除了所有帖子,但删除了所有帖子。当我在帖子的YAML前端内容中包含“摘录”标签和值时,该网站可以正常生成,但是当我删除该内容时,会出现错误(如下所示)。我试过在_config.yml文件中使用“excerpt_separator”标记和值,并将分隔符放在帖子中,但这没有帮助。只是为了它的地狱,我甚至在_config.yml里放了一个默认的“摘录”标签和值,这也没有帮助。在我看来,我的Jekyll安装不再自动生成摘录,因为它在我手动在文章的YAML前端内容中手动添加“摘录”时生成。Jekyll需要“摘录”YAML前题中的液体标签

这里是Github上库: https://github.com/jtelszasz/kasper-trial

users-MacBook-Air:kasper-trial user$ jekyll serve --trace 
Configuration file: /Users/user/Documents/kasper-trial/_config.yml 
Source: /Users/user/Documents/kasper-trial 
Destination: /Users/user/Documents/kasper-trial/_site 
Incremental build: disabled. Enable with --incremental 
Generating... 
Deprecation: Collection#map should be called on the #docs array directly. 
Called by /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:46:in `block in generate'. 
Deprecation: Collection#count should be called on the #docs array directly. 
Called by /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:49:in `rescue in block in generate'. 
Deprecation: Collection#reverse should be called on the #docs array directly. 
Called by /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:51:in `block in generate'. 
Deprecation: Document#title is now a key in the #data hash. 
Called by /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:53:in `block (3 levels) in generate'. 
/usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/document.rb:471:in `method_missing': undefined method `excerpt' for #<Jekyll::Document _posts/2015-11-30-blah.md collection=posts> (NoMethodError) 
from /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:55:in `block (3 levels) in generate' 
from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rss/maker/base.rb:57:in `new_item' 
from /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:52:in `block (2 levels) in generate' 
from /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:51:in `each' 
from /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:51:in `block in generate' 
from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rss/maker/base.rb:438:in `make' 
from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rss/maker/base.rb:402:in `make' 
from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/rss/maker.rb:28:in `make' 
from /Users/user/Documents/kasper-trial/_plugins/rssgenerator.rb:41:in `generate' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/site.rb:154:in `block in generate' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/site.rb:153:in `each' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/site.rb:153:in `generate' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/site.rb:58:in `process' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/command.rb:28:in `process_site' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/commands/build.rb:60:in `build' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/commands/build.rb:35:in `process' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/lib/jekyll/commands/serve.rb:26:in `block (2 levels) in init_with_program' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `call' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `block in execute' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `each' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/command.rb:220:in `execute' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary/program.rb:42:in `go' 
from /usr/local/lib/ruby/gems/2.2.0/gems/mercenary-0.3.5/lib/mercenary.rb:19:in `program' 
from /usr/local/lib/ruby/gems/2.2.0/gems/jekyll-3.0.1/bin/jekyll:17:in `<top (required)>' 
from /usr/local/bin/jekyll:23:in `load' 
from /usr/local/bin/jekyll:23:in `<main>' 
+0

你有GitHub的仓库? –

+0

刚添加到帖子。谢谢参观! – Justin

回答

0

您在_plugins/rssgenerator.rb线路有问题55

item.description = parser.convert(post.excerpt) 

应该是:

item.description = parser.convert(post.to_liquid['excerpt']) 

删除它,并使用标准jekyll文件生成您的饲料(find it here)。

在_config.yml附加:

excerpt_separator: "<!--excerpt-->" 

您的讯息:

--- 
layout: post 
title: Post Title 
description: "blah." 
modified: 2014-12-17 
category: articles 
tags: [futbol] 
--- 
excerpt 

<!--excerpt--> 

asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf 
+0

绝对的辉煌。出于好奇,rssgenerator.rb文件中的具体问题是什么? – Justin

+0

我编辑了我的答案。 –