- This topic has 10 replies, 3 voices, and was last updated 3 years, 4 months ago by
Tom.
-
AuthorPosts
-
September 24, 2019 at 1:35 am #1017342
Reed
Hello,
I would like to go about implementing the solution proposed by xLeitix on https://academia.stackexchange.com/questions/109114/how-to-efficiently-and-aesthetically-display-an-evolving-publications-list-on.
I want to generate an interactive publication list from a .bib file hosted in github.
How would I implement the JS through hooks?Thanks,
reedSeptember 24, 2019 at 2:01 am #1017360David
StaffCustomer SupportHi there,
general rule is to load JS in the Footer ( WP_footer Hook ) to prevent render blocking or in the case of a page where the content is primarily generated through JS then immediately after the container that will render the output.
In this particular instance i couldn’t advise whether either of these is a valid solution. This would require custom development.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 27, 2019 at 7:15 pm #1020990Reed
Following these examples:
https://academia.stackexchange.com/questions/109114/how-to-efficiently-and-aesthetically-display-an-evolving-publications-list-on
https://awesomeopensource.com/project/vkaravir/bib-publication-list (https://github.com/vkaravir/bib-publication-list)
https://libraries.io/github/rpng/bib-publication-list (https://github.com/rpng/bib-publication-list)I have taken the following actions:
1. Child theme created
2. Bibtexify.js uploaded to wp-content/themes/generatepress_child/js
3. Bibtexify.css uploaded to wp-content/themes/generatepress_child/css
4. Three elements added
I) Bibtexify – Hook into wp_footer, displays on Publications page only
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script>
<script src=”https://reedsutton.ml/wp-content/themes/generatepress_child/js/bibtexify.js”></script>II) Bibtexify – CSS – Hook into wp_head, displays on Publications page only
<link rel=”stylesheet” href=”https://reedsutton.ml/wp-content/themes/generatepress_child/css/bibtexify.css” type=”text/css”>III) Bibtexify – i/o – Hook into inside_container, displays on Publications page only
<script type=”text/javascript”>
bibtexify(“https://github.com/reedtsutton/publication_list/publications.bib”, “pubTable”);
</script>However; I am still getting a blank page and not loading the bibtex table. Any idea where I might be going wrong?
September 28, 2019 at 9:39 am #1021361Tom
Lead DeveloperLead DeveloperHi there,
It depends on the javascript. It’s possible that the function isn’t firing since the
.js
hasn’t loaded yet.I’m not able to confirm anything as your site isn’t viewable.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 28, 2019 at 1:26 pm #1021452Reed
Where can I message you to give you private access.
Site is not published yet.September 28, 2019 at 2:08 pm #1021470David
StaffCustomer SupportHi there,
you can send the links and login via the Account issue form here:
https://generatepress.com/contact/
Please add the URL of this topic so we can track.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 28, 2019 at 4:08 pm #1021497David
StaffCustomer SupportThere is an error in the code on line 2934 :
if ($("#shutter").size() === 0) {
the
.size
function was removed from jQuery – use the.length
instead:Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 28, 2019 at 4:54 pm #1021510Reed
Thanks, fixed.
Now I’m getting the following errors:Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Access to XMLHttpRequest at ‘https://github.com/reedtsutton/publication_list/publications.bib’ from origin ‘https://reedsutton.ml’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.Do I need to add some code to authorize it to parse the bib file on github?
September 28, 2019 at 7:18 pm #1021558Tom
Lead DeveloperLead DeveloperYou might need to host that file on your own server. The browser is preventing it from loading from another URL for security reasons.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentSeptember 30, 2019 at 3:35 pm #1022875Reed
Even when hosting on my own server, I am getting a multitude of errors:
Uncaught TypeError: Cannot read property ‘id’ of undefined
at Bib2HTML.addBarChart (bibtexify.js:2871)
at Bib2HTML.initialize (bibtexify.js:2817)
at new Bib2HTML (bibtexify.js:2779)
at Object.callbackHandler [as success] (bibtexify.js:2950)
at c (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at l (jquery.min.js:2)
at XMLHttpRequest.<anonymous> (jquery.min.js:2)September 30, 2019 at 4:51 pm #1022908Tom
Lead DeveloperLead DeveloperThat’s an issue in the javascript file itself, unfortunately. It’s looking for an element that doesn’t exist (as a guess).
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.