Hey Tiffany! If I understand your question correctly, you're trying to call page_partials and substitute the text {{ head }} with the value of page_partials.
If that's the case. You should be able to call that method directly in the gsub. Like so:
# Where new_page_partial is the file name of whatever page partial you want to pass in.base_html.gsub("{{ head }}",page_partials(new_page_partial))
It does look like your page_partials function might have a small bug. Here are my comments for it:
defpage_partials(new_page_partial)# bug: page_partial isn't being referenced anywhere. You may want to use new_page_partial instead.pages="site/#{page_partial}.html"new_page_partial=File.open(pages).readend
Hopefully this helps! I'm happy to pair on any Ruby code!
Hey! Yeah we should definitely link up as I'm struggling with it a bit. It's pretty late on the East Coast, but I'll DM you on Twitter tomorrow if that's okay?
Hey Tiffany! If I understand your question correctly, you're trying to call
page_partials
and substitute the text{{ head }}
with the value ofpage_partials
.If that's the case. You should be able to call that method directly in the
gsub
. Like so:It does look like your
page_partials
function might have a small bug. Here are my comments for it:Hopefully this helps! I'm happy to pair on any Ruby code!
Hey! Yeah we should definitely link up as I'm struggling with it a bit. It's pretty late on the East Coast, but I'll DM you on Twitter tomorrow if that's okay?
Yeah for sure!