Skip to content

Instantly share code, notes, and snippets.

@serverwentdown
Created August 23, 2014 16:19
Show Gist options
  • Save serverwentdown/5ed7eee21954be3eb6c8 to your computer and use it in GitHub Desktop.
Save serverwentdown/5ed7eee21954be3eb6c8 to your computer and use it in GitHub Desktop.
Random jekyll post
---
title: random
---
<script>
var posts = [{% for post in site.posts %}"{{ post.url }}", {% endfor %}];
var id = Math.floor(Math.random() * posts.length);
window.location.href = posts[id];
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment