Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlonAm/f971ef40755a8176cb64f052ff60205a to your computer and use it in GitHub Desktop.
Save AlonAm/f971ef40755a8176cb64f052ff60205a 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