Skip to content

Instantly share code, notes, and snippets.

@spencermathews
Last active April 20, 2018 06:45
Show Gist options
  • Save spencermathews/7a9026518425f7e9992e03198db3d7bc to your computer and use it in GitHub Desktop.
Save spencermathews/7a9026518425f7e9992e03198db3d7bc to your computer and use it in GitHub Desktop.
Jekyll snippets
{% if site.custom_css %}
{% for stylesheet in site.custom_css %}
<link rel="stylesheet" href="{{ stylesheet }}" media="screen">
{% endfor %}
{% endif %}
{% if page.custom_css %}
{% for stylesheet in page.custom_css %}
<link rel="stylesheet" href="{{ stylesheet }}" media="screen">
{% endfor %}
{% endif %}
{% if site.custom_js %}
{% for js_file in site.custom_js %}
<script src='{{ js_file }}'></script>
{% endfor %}
{% endif %}
{% if page.custom_js %}
{% for js_file in page.custom_js %}
<script src='{{ js_file }}'></script>
{% endfor %}
{% endif %}
{% comment %}
Get the directory containing a page/post
{% endcomment %}
{% assign path_split = page.path | split: '/'' | pop %}
{% assign directory = path_split | join: '/' | prepend: '/' %}
Jekyll tips, tricks, and snippets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment