hugo-embed-pdf-shortcode
hugo-embed-pdf-shortcode copied to clipboard
Support For Multiple Embeds
Hello all,
This PR adds support for multiple embeds as discussed in #25. I've rolled the changes I've made for this into the original shortcode, and added a new partial responsible for loading pdf.js and the shortcode styles.
Give it a test and let me know what you think.
Note that out of necessity, this PR changes how the PDF.js library is loaded.
As such, particular consideration should be taken with respect to #19. It may be wise to add a flag in the Hugo configuration where a site owner could specify the location of their own PDF.js instance, or fetch it from a CDN otherwise inside of the dependency loader.
@anvithks Any thoughts on this?
@anvithks Any thoughts on this?
I am sorry but I haven't been able to test this yet. I will try to spend some time over the weekend and merge the PR if all OK.
Thanks @ctrezevant .
Hi @ctrezevant , thanks for sharing this code!
PR #32 is a proposal mixing your code and this little trick: splitting the code into multiple files can be avoided. See 0b75911 and this discussion on discourse.gohugo.io.
I've tested #32 and it works fine. If it's not working for you, please double-check the commits https://github.com/anvithks/hugo-embed-pdf-shortcode/pull/32/commits/f7a8fecb847c1845d35683c7a85eb82f751aabd3 and https://github.com/anvithks/hugo-embed-pdf-shortcode/pull/32/commits/e3642f0d37a806d5735e5f670e3e31e1f4da6841. They are required to make this shortcode work with my theme (Papermod) but your setup may be different
Glad to see this moving forward! Everything looks solid after a cursory review.