-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support For Multiple Embeds #29
Conversation
…e instance's elements. Migrates JS initialization of the viewer to an IIFE rather than using window.onload. Moves pagination controls underneath the PDF image and adds a link to the original document. This link will also appear for users with JavaScript disabled.
Kudos, SonarCloud Quality Gate passed! |
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? |
I am sorry but I haven't been able to test this yet. 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 f7a8fec and e3642f0. 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. |
Kudos, SonarCloud Quality Gate passed! |
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.