Skip to content

Instantly share code, notes, and snippets.

@elliotjaystocks
Created May 3, 2012 14:33
Show Gist options
  • Save elliotjaystocks/2586017 to your computer and use it in GitHub Desktop.
Save elliotjaystocks/2586017 to your computer and use it in GitHub Desktop.
Art direct your blog posts in Harmony by inserting this loop into the <head> and injecting any extra CSS or JSS you might need by creating a field in your post template called 'injected_code'.
{% if item.root? %}
{{ 'blog' | item_from_path | assign_to: 'blog' }}
{% for post in blog.recent_posts.1 %}
<!-- Injected code from the latest blog post -->
{{ post.data.injected_code }}
{% endfor %}
{% else %}
<!-- Injected code from this specific blog post -->
{{ item.data.injected_code }}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment