- This topic has 10 replies, 3 voices, and was last updated 11 months, 3 weeks ago by Tom.
September 24, 2019 at 1:35 am #1017342Reed
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?
reedSeptember 24, 2019 at 2:01 am #1017360DavidStaffCustomer Support
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.September 27, 2019 at 7:15 pm #1020990Reed
Following these examples:
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
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
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 #1021361TomLead DeveloperLead Developer
.jshasn’t loaded yet.
I’m not able to confirm anything as your site isn’t viewable.September 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 #1021470DavidStaffCustomer SupportSeptember 28, 2019 at 4:08 pm #1021497DavidStaffCustomer SupportSeptember 28, 2019 at 4:54 pm #1021510Reed
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 #1021558TomLead DeveloperLead Developer
You might need to host that file on your own server. The browser is preventing it from loading from another URL for security reasons.September 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 #1022908TomLead DeveloperLead Developer
- You must be logged in to reply to this topic.