title: Can you use Jekyll page variables in a layout?
body: <p>I'm using Jekyll for my blog, and I'd like the ability to use unique CSS styling in particular posts. Right now, I'm specifying a CSS file in the YAML frontmatter like so: </p>
  
  <pre><code>style: artdirection.css
  </code></pre>
  
  <p>and using it in the layout like this: </p>
  
  <pre><code>{% if page.style %}
      &lt;link rel="stylesheet" href="{{ page.style }}"&gt;
  {% endif %}`
  </code></pre>
  
  <p>This works, but I'd prefer to include the actual CSS styling in a style tag in the page's frontmatter instead of linking to a style sheet.</p>
  
  <p>I've tried dealing with this in a couple of ways, including the method described <a href="https://github.com/mojombo/jekyll/issues/246#issuecomment-583053" rel="noreferrer">here</a>, but the variable that I capture is only usable inside the post itself, not in the layout.</p>
  
  <p>So, is it possible?</p>