开发者

Does Jekyll work with Pow?

开发者 https://www.devze.com 2023-03-20 20:18 出处:网络
How do I get Jeky开发者_运维百科ll to work with Pow?Thanks to the @mipadi answer, I learned that Pow automatically serves static files in the public directory of your application, so just configure Je

How do I get Jeky开发者_运维百科ll to work with Pow?


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"]

Then, just do the usual:

cd ~/.pow
ln -s /path/to/myjekyllsite

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.


Here's an approach that doesn't require overriding any of the normal Jekyll defaults:

Install rack-jekyll:

gem install rack-jekyll

Add config.ru with the following contents:

require "rack/jekyll"
run Rack::Jekyll.new

And now symlink your project directory into ~/.pow as you normally would.


I'm not familiar with Pow, but it looks like you could just symlink the output of your Jekyll-generated site into ~/.pow/public.

0

精彩评论

暂无评论...
验证码 换一张
取 消