Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Do not remove the figure-html subdir #7

Merged
merged 1 commit into from Aug 6, 2017
Merged

Do not remove the figure-html subdir #7

merged 1 commit into from Aug 6, 2017

Conversation

yihui
Copy link
Contributor

@yihui yihui commented Jul 31, 2017

This will fix rstudio/blogdown#38.

@bhaskarvk
Copy link
Collaborator

Thanks! I am traveling this whole week but I will get back to this over the weekend. And thanks much for your support.

@yihui
Copy link
Contributor Author

yihui commented Aug 1, 2017

Sounds good. It is a simple change but you may need some time to think about the consequences. I have tested both blogdown and other R Markdown documents, and they seem to still work well.

@bhaskarvk
Copy link
Collaborator

Yeah it's mostly to test out every possible R Markdown format.

@bhaskarvk
Copy link
Collaborator

I am testing this now, and so far works with rmarkdown, rmarkdown-website, xaringan, flexdashboard.
But I still require the hackish way of using a Makefile and specifying widgets_dir for bookdown. Otherwise the dependencies are not moved to the final book output directory.
Tomorrow I'll check for the blogdown part.

@yihui
Copy link
Contributor Author

yihui commented Aug 6, 2017

I'll address the bookdown issue in bookdown when I have more time. You won't need any changes in widgetframe.

@bhaskarvk
Copy link
Collaborator

I just tested this with blogdown and it works perfectly if the method is 'html', but doesn't work if the method is html_encoded. The widgets folder is neither to be found under static folder and hence also not present under the public folder.
I am fine documenting this limitation, but it would be awesome if we can support html_encoded too.

@yihui
Copy link
Contributor Author

yihui commented Aug 6, 2017

You are correct. It does not work with html_encoded. I don't think there will be more than three people in the world who would use html_encoded. The benefit is minimal, and the disadvantages sound bad enough.

@bhaskarvk bhaskarvk merged commit 5ee1ade into trafficonese:master Aug 6, 2017
@bhaskarvk
Copy link
Collaborator

@yihui Thanks for the fix. One more small point the URL to the iframed widget HTML works only when the site is deployed on the root. When the site is deployed in a level below the root, i.e. http://www.abcd.com/blog/, then the URL to the child widget HTMLs is wrong. This is not a big issue as I really doubt if many people will deploy their blogs to non root path.

Thanks again for your help!

@yihui yihui deleted the patch-1 branch August 7, 2017 04:52
@elliottmorris
Copy link

I'm still getting an error in my file, and I think it has something to do with @bhaskarvk most recent comment.

I'm trying to use a widgetframe with datatable in a .Rmarkdown that lies within my /pages subdirectory. The frame just pulls up my 404 page. I'm also running on the future-imperfect theme, which I know has had some trouble in the past.

Any solutions?

@yihui
Copy link
Contributor Author

yihui commented Aug 8, 2017

It should work unless you have set relativesurl = true in config.toml. Try to remove this option or set it to false, then blogdown::build_site() with the latest version of blogdown.

@bhaskarvk
Copy link
Collaborator

@elliottmorris could you share your config files and where you deploy your site?

@elliottmorris
Copy link

elliottmorris commented Aug 8, 2017

I tried setting relativesurl = false and updating both blogdown and widgetframe to their latest versions, but still to no avail.

Attempting to display the widget at http://www.thecrosstab.com/trump-tracker/. Attached is my config.toml in text format.
config_toml.txt

EDIT: there seems to have been a corrupted download for blogdown. Have reinstalled, restarted, rebuilt and it all works now. Thanks for the tip on relativesurl.

@yihui
Copy link
Contributor Author

yihui commented Aug 9, 2017

Okay, glad to hear that.

@bhaskarvk
Copy link
Collaborator

FWIW I don't think relativeurl was your problem to begin with. It must have been sometihng to do with corrupt blogdown install. @yihui I double checked and regardless of what relativeurl is set to the url attribute for the iframe source starts with an absolute path. so something like '/post/....' which works fine when the site is deployed at the root of a webserver which is what @elliottmorris is doing.
But if the site is deployed one level down so e.g. www.abcd.com/blog/ instead of www.abcd.com then it won't work coz the URL is not changed to /blog/post as it should be.

@yihui
Copy link
Contributor Author

yihui commented Aug 9, 2017

@bhaskarvk When relativeurls = false, you should get /blog/post/... instead of /post/.... Could you test with the latest version of blogdown?

@elliottmorris
Copy link

elliottmorris commented Aug 9, 2017 via email

@B2Silva
Copy link

B2Silva commented Jan 30, 2019

FWIW I don't think relativeurl was your problem to begin with. It must have been sometihng to do with corrupt blogdown install. @yihui I double checked and regardless of what relativeurl is set to the url attribute for the iframe source starts with an absolute path. so something like '/post/....' which works fine when the site is deployed at the root of a webserver which is what @elliottmorris is doing.
But if the site is deployed one level down so e.g. www.abcd.com/blog/ instead of www.abcd.com then it won't work coz the URL is not changed to /blog/post as it should be.

I am suffering from the same behavior.
But I am using "hugo-creative-portfolio-theme".
Basically, I am deploying one level down www.abcd.com/website instead of www.abcd.com and the URL inside the widgetframe is pointing to the www.abcd.com.
Any solution?

@elliottmorris
Copy link

elliottmorris commented Jan 31, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for widgetframe
4 participants