How would you build a PDF gallery?

22 views
Skip to first unread message

Jan Girlich

unread,
Jun 2, 2022, 4:49:11 AM6/2/22
to nikola-discuss
Hi,

I am new to Nikola and am trying to build a PDF gallery like
https://ds.ccc.de/download.html

I thought a gallery is close enough to make this work, but I see the
following problems:

1. I need to extract a preview PNG from each PDF. The Python code for
that is trivial, I just don't know how to run it before the gallery
code is running and trying to create the HTML. I only found the FILTER
option to run on files after generation.

2. I want the preview link to be ds102.PNG, but the download link to be
to ds102.PDF and I have no idea how I can configure Nikola to do this.

How would you build such a download gallery?

Thanks,
vollkorn

Roberto Alsina

unread,
Jun 2, 2022, 9:14:30 AM6/2/22
to Nikola—Discuss
We are using PIL (Pillow) to extract the thumbnails. If it supports extracting PDF thumbnails, then that's it (maybe it does and our code is doing it wrong, I don't know)

If not, then there could be a special case in the code for PDFs, since this sounds pretty useful!

--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nikola-discuss/6317882c8e7e1f2175fb6d9c5068bca54b1495fb.camel%40cryptobitch.de.
Reply all
Reply to author
Forward
0 new messages