… was a single if
statement!
Yesterday, I reported a bug I encountered in the jekyll-paginate-v2 plugin that I use on this site, where it would not generate the first page (index.html
) if there were no posts. This resulted in 404 (Not found)
errors on GitLab Pages, which lead me to believe that I had royally screwed up my hosting configuration.
After a few minutes, I managed to find out where the problem was, and thus my first-ever lines of Ruby were born. Since I’ve a bit of insomnia tonight, I’ve written a few more.
I don’t know why it took me so long to check out Ruby. It’s fun! Maybe Python will be, too… (Yeah, yeah, I’m an old stodgy Node.js/Java/Perl guy, but at least I try, hehe!)
Update: Of course, I got code-reviewed down to:
total_pages = 1 if total_pages.zero?
Ruby does Perl? Tim Toady!