Pdf parsing inside a Jekyll app

I’ve run a jekyll site on Github pages for awhile & want to display info (metadata & selected content) from a couple of PDF files. Presumably the pdf-reader gem is a good starting point.

This feature would be post-dependent, so I’d like to access the gem from inside the post using (I think) a liquid assign statement:

{% assign file = site.pdf_reader.read('path goes here') %}

Liquid kicks this out with a syntax error:

Expected end_of_string but found open_round in "{{reader.read("test") }}"


I don’t see that the pdf-reader gem has any support for Jekyll, so I think you’d need to find or write a Jekyll plugin to expose info from pdf-reader in Liquid.

1 Like

ChatGPT suggested a plugin alternative too: Jekyll with PDF-Reader Gem.

Thanks - I wanted to hear a human take too.

Yikes, that whole Custom Page section is a drunken confabulation…

Well, my motto is “More Human Than Human” :wink:

writing the ruby code inside of the raw tags on an md page is a very cunning plan.

1 Like