Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@budparr
Created May 4, 2015 16:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save budparr/103dcd0f3dbd6615761b to your computer and use it in GitHub Desktop.
Save budparr/103dcd0f3dbd6615761b to your computer and use it in GitHub Desktop.
Webhook Prefetch for Prev/Next items
Place this in your head.
{% block head_extra %}
{% set prev = prevItem(item, 'publish_date', true) %}
{% set next = nextItem(item, 'publish_date', true) %}
{% if prev %}
<link rel="prefetch" href="{{ url(prev) }}" />
{% endif %}
{% if next %}
<link rel="prefetch" href="{{ url(next) }}" />
{% endif %}
{% endblock %}
and some tutorials
http://davidwalsh.name/html5-prefetch
https://medium.com/@luisvieira_gmr/html5-prefetch-1e54f6dda15d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment