【问题标题】:jekyll rss feed on herokujekyll rss feed on heroku
【发布时间】:2018-12-10 13:20:16
【问题描述】:

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

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

我认为问题出在此处,但我的 rss 提要 xml 会返回此内容,并且显然没有我需要设置链接的域名。

这里发生了什么?

【问题讨论】:

    标签: heroku rss jekyll


    【解决方案1】:

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

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

    瑞克文件:

    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')
    

    【讨论】:

      猜你喜欢
      • 2012-08-25
      • 2011-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-11
      • 2013-02-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多