Does anyone know any way to display random content, so that each page refresh would render new content? {{ range random }} style.I'm pulling the title and links of 5 pieces of content to the homepage, but the website is not date-defined and I'd like to show any 5 posts, and not the same 5 posts every time.
--
Hugo
A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go
Download the latest at https://github.com/spf13/hugo/releases
---
You received this message because you are subscribed to the Google Groups "Hugo Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugo-discuss...@googlegroups.com.
To post to this group, send email to hugo-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/hugo-discuss.
For more options, visit https://groups.google.com/d/optout.
---
title: Redirecting to a random entry
type: random
--- <html>
<head>
<script>
// https://github.com/rwmpelstilzchen/jekyll-random-post
var posts = [];
{{ range .Site.Pages }}
posts.push("{{ .URL }}");
{{ end }}
document.write("<meta http-equiv=\"refresh\" content=\"1;url=");
document.write(posts[Math.floor(Math.random() * posts.length)]);
document.write("\">");
</script>
</head>
<body>
Redirecting to a
<script>
document.write("<a href=\"");
document.write(posts[Math.floor(Math.random() * posts.length)]);
document.write("\">random post</a>...");
</script>
</body>
</html>https://github.com/rwmpelstilzchen/jekyll-random-post