Fix misc. errors

This commit is contained in:
Aleks Rūtiņš 2024-09-08 21:17:46 -04:00
parent 5779c37f5b
commit f824eae230
2 changed files with 6 additions and 2 deletions

View file

@ -10,10 +10,13 @@ class Phlexite::Router
end end
def page(out_path, component) def page(out_path, component)
File::write(full_out_path(out_path), component.call) out = full_out_path(out_path)
system("mkdir -p #{File::dirname(out)}")
File::write(out, component.call)
end end
private private
def full_out_path(out_path) def full_out_path(out_path)
File::join(@site.build_dir, @site.base_url, @base, out_path) File::join(@site.build_dir, @site.base_url, @base, out_path)
end end

View file

@ -7,7 +7,8 @@ class Phlexite::Site < Phlexite::Router
def initialize def initialize
super("/", self) super("/", self)
base_url = "/" @build_dir = "_build"
@base_url = "/"
yield self yield self
end end
end end