Notes by KargWare
Software | Web | QA-CI-CD | Apps | Hardware
Impressum Datenschutz
Tags Categories Dates
 Seitenende 

Archive of Notes by KargWare

2021-01-22
Jekyll Show Random Posts
2021-01-22 Nicolas Karg
WEB-DEVELOPMENT
jekyllliquid

Neither in Jekyll nor in Liquid there is a option to get a random value out of an array. But there is modulo filter which can be used to archive the goal. I found a solution on StackOverflow - 31490789, and adjusted my need a bit so I was able to get three different random posts. --- layout: post title: "Jekyll Show Random Posts" date: 2021-01-22 12:41:37 +0200 --- {% assign random1 = site.time | date: "%s%N" | modulo: site.posts.size %} {% assign post_random1 = site.…

 Seitenanfang 

Kargware

  • RSS-Feed
  • GitHub
  • GitLab
  • Twitter
  • Instagram
  • Stackoverflow
  • Nuget

Website

  • Impressum
  • Datenschutz
  • Info

Services

  • Wordpress Blog
  • Jekyll Notes
  • NextCloud
  • OwnCloud
  • Matomo
  • YOURLS