Can you use partials/erb in layouts?

I have an erb file in layout/default

---
---

{% assign basics = site.data.basics %}
{% assign work = site.data.work %}
{% assign education = site.data.education %}
{% assign skills = site.data.skills %}

<!doctype html>
<html lang="en">
  <head>
    {% render "head", metadata: site.metadata, title: page.title %}
  </head>
  <body class="{{ page.layout }} {{ page.page_class }}">
    {{ content }}
    <%= partial 'footer' %>
  </body>
</html>

and a page, src/index.erb


layout: default
title: Resume

{% assign basics = site.data.basics %}
{% assign work = site.data.work %}
{% assign education = site.data.education %}
{% assign skills = site.data.skills %}

<main>
  <div>
    {% render "header", data: basics, %}
    ...... stuff here
  </div>
<main>

But the footer is rendering the string literally as <%= partial 'footer' %>.

If I moved the <%= partial 'footer' %> portion to the layout file instead, the partial is rendered ok.

Is this expected?

I’m not quite sure I’m following what the issue is. Assuming the layout file ends in .erb, it should be processing as an ERB template and allowing a partial to be rendered. Is that not working for you?