'erb' is relative to the html directory

This commit is contained in:
0x1eef 2023-10-07 03:26:43 -03:00
parent 4850546eb1
commit 88630bae1b
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
module Mixin::ERB
def erb(partial, local_assigns = {})
erb = File.binread File.join(Dir.getwd, "src", "html", "partials", partial)
def erb(path, local_assigns = {})
erb = File.binread File.join(Dir.getwd, "src", "html", path)
scope = binding
local_assigns.each { scope.local_variable_set(_1, _2) }
::ERB.new(erb).result(scope)

View file

@ -2,7 +2,7 @@
module Mixin::OpenGraph
def opengraph(context)
erb "opengraph.html.erb", local_assigns(context)
erb "partials/opengraph.html.erb", local_assigns(context)
end
def local_assigns(context)