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

DT package not working with hugo-future-imperfect theme #88

Closed
pssguy opened this Issue Apr 19, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@pssguy

pssguy commented Apr 19, 2017

I have a blogdown site based on the hugo-future-imperfect theme where a DT output is created correctly in the rmd but the data is not shown (although the headings are) when applying serve_site/build_site

I have created two brand new sites ( so with no other complications) to illustrate the issue. This is the code and outputs

library(DT)
library(tidyverse)
glimpse(iris)

iris %>% 
  datatable()

a) default theme
defaulttheme

b) hugo-imperfect
imperfecttheme

The problem also occurs with the plotly package and hugo-imperfect

@pssguy

This comment has been minimized.

pssguy commented May 1, 2017

Similar to issue 20

Hack solution

Pending a long-term solution, it would be helpful to know which widgets and themes this issue occurs with

@pssguy pssguy closed this May 1, 2017

@ThierryO

This comment has been minimized.

ThierryO commented Jul 18, 2017

the issue occurs with hugo-tranquilpeak theme and DT as well

@pssguy

This comment has been minimized.

pssguy commented Jul 18, 2017

@ThierryO
FYI, I switched to Icarus - with no problems so far

@yihui

This comment has been minimized.

Member

yihui commented Jul 21, 2017

Sorry I don't have time to investigate this issue in hugo-tranquilpeak or hugo-future-imperfect. If I were to do it, I'd first look at the JavaScript console of my browser to see if there are any errors.

@andrie

This comment has been minimized.

andrie commented Apr 17, 2018

For reference, the JavaScript console error is:

Uncaught TypeError: $table.DataTable is not a function
    at Object.renderValue (datatables.js:269)
    at htmlwidgets.js:625
    at Array.forEach (<anonymous>)
    at forEach (htmlwidgets.js:55)
    at htmlwidgets.js:551
    at Array.forEach (<anonymous>)
    at forEach (htmlwidgets.js:55)
    at Object.window.HTMLWidgets.staticRender (htmlwidgets.js:549)
    at HTMLDocument.<anonymous> (htmlwidgets.js:638)

The StackOverflow question is related, and it seems the most likely underlying root cause is that jQuery should be loaded before jQuery datatables.

@yihui

This comment has been minimized.

Member

yihui commented Apr 17, 2018

Appendix D.6 might be helpful: https://bookdown.org/yihui/blogdown/html-widgets.html

@andrie

This comment has been minimized.

andrie commented Apr 18, 2018

I switched to use the Icarus theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment