Skip to content
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

File Path issue with servr::jekyll #26

Closed
kieran-mace opened this issue Apr 18, 2016 · 6 comments
Closed

File Path issue with servr::jekyll #26

kieran-mace opened this issue Apr 18, 2016 · 6 comments

Comments

@kieran-mace
Copy link

kieran-mace commented Apr 18, 2016

When converting from Rmd -> md files the file path for figures is missing a /

this does not occur when calling servr::jekyll() from an R session, however if one calls jekyll serve from bash, one cannot find the image.

looking at the md file I notice this:

![plot of chunk unnamed-chunk-1](/mysitefigure/source/2016-04-17-test/unnamed-chunk-1-1.png)

whereas the code should read:

![plot of chunk unnamed-chunk-1](/mysite/figure/source/2016-04-17-test/unnamed-chunk-1-1.png)

If I manually change the md file, this issue goes away

@kieran-mace
Copy link
Author

If one changes the base url in _config.yml to "/mysite/" it works, but I believe that this is not correct (jekyll serve now says Server address: http://127.0.0.1:4000/mysite//

@yihui
Copy link
Owner

yihui commented Apr 19, 2016

You didn't bring a minimal reproducible example, so all I can do is guess, and my guess is you didn't set the option correctly, e.g. you should

knitr::opts_knit$set(base.url = '/mysite/')

and for some reason, you probably ended up with

knitr::opts_knit$set(base.url = '/mysite')

@yihui yihui closed this as completed Apr 19, 2016
@kieran-mace
Copy link
Author

i specify the base url in the _config.yml file, which is read by build.R
according to the example supplied by jekyll, the baseurl in _config.yml should not include the final /
#baseurl: /path/to/blog
not
#baseurl: /path/to/blog/

however I believe that this issue may be with the build.R script in your other repo here, and not in this repo. sorry.

@yihui
Copy link
Owner

yihui commented Apr 19, 2016

Okay, I'll fix the _config.yml in the other repo. Thanks!

yihui added a commit to yihui/blogdown-jekyll that referenced this issue Apr 19, 2016
@rcorty
Copy link

rcorty commented Oct 15, 2016

I don't know much about servr, knitr, jekyll, etc., but this problem is preventing me from publishing my blog, so I tried the following and it didn't help:

on line 91 of dynamic.R, pass in argument paste0(baseurl, '/') as the baseurl parameter, instead of local variable baseurl.

Just mentioning this in case it is helpful to those who know more about the situation than I do.

I also noticed the build_jekyll function is never called.

@rcorty
Copy link

rcorty commented Oct 15, 2016

OK, I made a very kludgey patch, but it does work....

https://github.com/rcorty/CortyKit/blob/master/R/servr_patch.R

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

No branches or pull requests

3 participants