homebrew-core/Formula/zola.rb

44 lines
1.3 KiB
Ruby
Raw Normal View History

class Zola < Formula
desc "Fast static site generator in a single binary with everything built-in"
homepage "https://www.getzola.org/"
url "https://github.com/getzola/zola/archive/v0.5.0.tar.gz"
sha256 "718aaec6e0db6c0e6fb310d8a1ef3978f41a173e39b1c2515ca7365690b09cff"
2018-11-22 01:54:08 +00:00
bottle do
sha256 "40725be4950469abd15b986fbc77b20306771ab2e011e578a6d55b7d56190bd0" => :mojave
sha256 "545e31eadf477836206d1d69b7d024cfe9e3f3fd3a74d0653549d486559dd708" => :high_sierra
sha256 "812ace288dd7dfdbf637eebdd0a1256fa5e9e9dba1233862f80935f14fda7d53" => :sierra
end
depends_on "cmake" => :build
depends_on "rust" => :build
def install
system "cargo", "install", "--root", prefix, "--path", "."
bash_completion.install "completions/zola.bash"
zsh_completion.install "completions/_zola"
fish_completion.install "completions/zola.fish"
end
test do
system "yes '' | #{bin}/zola init mysite"
(testpath/"mysite/content/blog/index.md").write <<~EOS
+++
+++
Hi I'm Homebrew.
EOS
(testpath/"mysite/templates/page.html").write <<~EOS
{{ page.content | safe }}
EOS
cd testpath/"mysite" do
system bin/"zola", "build"
end
assert_equal "<p>Hi I'm Homebrew.</p>",
(testpath/"mysite/public/blog/index.html").read.strip
end
end