Rotating quotes in Jekyll

193 views Asked by At

I'm new to this Jekyll business but have tasted the massive potential of liquid - with this test personal website I'm building.

Getting to the point, I'd like rotating quotations, in the right hand box, of the type found at the top right of the veteran Oil Drum blog. (Check it out.)

I already have a stock of quotes separated by blank lines. What do I need to do to get my site to select them one by one and put a different one up every day/week/month?

Imagine the answer will involve some of the {{xx}} style code that is the trademark of the liquid template language, used by Jekyll.

Closest answer I could find was this btw - not satisfactory for my needs.

Cool rotating quote e.g.: quote

2

There are 2 answers

0
qingxp9 On

I think you can imitate the posts which are auto listed.

you can customize it by edit the list-make file at _include/JB/ to your wanted form.
And in this way you have to put your quotes to different file. Maybe you can find exist implement to do it or write the program by yourself.

i'm sorry to make the complex way.

0
David Hutchison On

If setting this up with Liquid, the quote could only be changed by rebuilding the site (cron job if self hosting or something).

Alternatively if you need to make it update on it's own, there are JS solutions available. Quick google brought this up which gives a rotation, but it is not time based. https://stackoverflow.com/a/15614495/230449

It will be possible to do a time based solution in JS, but that is not my speciality.