Skip to content

Instantly share code, notes, and snippets.

@sweisgerber-dev
Created February 5, 2018 13:59
Show Gist options
  • Save sweisgerber-dev/5a0f7043cee7998c73afaad250434f04 to your computer and use it in GitHub Desktop.
Save sweisgerber-dev/5a0f7043cee7998c73afaad250434f04 to your computer and use it in GitHub Desktop.
Jekyll/Liquid Random number generation hack
<!-- Random ID generation -->
{% assign min = 0 %}
{% assign max = 1000 %}
{% assign diff = max | minus: min %}
{% assign randomNumber = "now" | date: "%N" | modulo: diff | plus: min %}
<!-- /Random ID generation -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment