jekyll rss喂heroku

时间:2018-12-10 04:22:13

标签: heroku rss jekyll

我目前在heroku上设置了一个正在运行的jekyll,并使用以下procfile

web: jekyll serve --no-watch --port $PORT --host 0.0.0.0

我认为问题出在这里,但是我的rss feed xml返回了此消息,并且显然没有设置链接所需的域名。

enter image description here

这是怎么回事?

1 个答案:

答案 0 :(得分:0)

我发现处理此问题的最佳方法是将jekyll捆绑在Rack中。 http://rack.github.io/

您可以通过创建一个config.ru和一个处理构建的Rake任务来做到这一点

Rakefile:

namespace :assets do
  task :precompile do
    puts `bundle exec jekyll build`
  end
end

config.ru:

require 'rack/contrib/try_static'
require 'rack/contrib/not_found'

    use Rack::TryStatic,
      :root => "_site",
      :urls => %w[/],
      :try  => ['index.html', '/index.html']

    run Rack::NotFound.new('_site/404.html')