Thanks to the @mipadi answer, I learned that Pow automatically serves static files in the public directory of your application, so just configure Jekyll to change the directory where Jekyll will write files to from _site (the default) to public. Since public doesn't start with an underscore (_), you also have to add it to the list of files & directories to exclude. The relevant parts of my _config.yaml look like this:
destination: public
exclude: ["CNAME", "Rakefile", "README.md", "public"]
发布评论
评论(3)
感谢 @mpadi 的回答,我了解到 Pow 自动提供静态文件应用程序的
public
目录,因此只需配置 Jekyll 即可将 Jekyll 将写入文件的目录从_site
(默认)更改为public
。由于public
不以下划线 (_
) 开头,因此您还必须将其添加到文件列表中要排除的目录。我的_config.yaml
的相关部分如下所示:然后,只需执行通常的操作:
并导航到 http://myjekyllsite.dev/。
Pow 公共目录尾部斜杠问题:转到 http://myjekyllsite.dev/projects 应自动重定向到 http://myjekyllsite.dev/projects/ 但没有。
Thanks to the @mipadi answer, I learned that Pow automatically serves static files in the
public
directory of your application, so just configure Jekyll to change the directory where Jekyll will write files to from_site
(the default) topublic
. Sincepublic
doesn't start with an underscore (_
), you also have to add it to the list of files & directories to exclude. The relevant parts of my_config.yaml
look like this:Then, just do the usual:
And navigate to http://myjekyllsite.dev/.
Pow public directory trailing slash issue: Going to http://myjekyllsite.dev/projects should automatically redirect to http://myjekyllsite.dev/projects/ but didn't.
这是一种不需要覆盖任何正常 Jekyll 默认设置的方法:
安装 rack-jekyll:
添加包含以下内容的 config.ru:
现在,像平常一样将您的项目目录符号链接到
~/.pow
中。Here's an approach that doesn't require overriding any of the normal Jekyll defaults:
Install rack-jekyll:
Add
config.ru
with the following contents:And now symlink your project directory into
~/.pow
as you normally would.我不熟悉 Pow,但是看起来你可以只符号链接以下的输出将 Jekyll 生成的站点放入
~/.pow/public
中。I'm not familiar with Pow, but it looks like you could just symlink the output of your Jekyll-generated site into
~/.pow/public
.