如何在Rails公共目录的子目录中使用CSS设置静态页面

问题描述 投票:0回答:1

我正在尝试在我的public / blog目录中设置jekyll博客。

对于这个问题,我只想在此页面上将public/blogindex.html放在css目录中。

我正在使用capistrano进行部署,因此我将css/site.css添加到了public/blog

index.html:

linked_dirs

css / site.css:

<html>
  <head>
    <link rel="stylesheet" type="text/css" href="css/site.css">
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

现在在h1 { color: red; } 之后,我可以访问cap production deploy并查看domain.com/blog标头,但它不加载CSS文件。

我收到Hello World错误。

您知道我如何使它工作吗?

ruby-on-rails ruby-on-rails-5 capistrano
1个回答
0
投票

更多是一个nginx问题。

我将此添加到我的站点nginx文件中:

Failed to load resource: the server responded with a status of 404 (Not Found)
© www.soinside.com 2019 - 2024. All rights reserved.