blogdown

Change the default directory for blogdown posts

ⅰ亾dé卋堺 提交于 2019-12-08 01:06:16
问题 Posts for the Hugo theme I am using are in the /content/blog directory, whereas the default for new posts created with blogdown::new_post() is the /content/post directory. From looking at the function definition, there is a global option to change the directory new posts are saved to (the help indicates this, too): new_post(title, kind = "default", open = interactive(), author = getOption("blogdown.author"), categories = NULL, tags = NULL, date = Sys.Date(), file = NULL, slug = NULL, subdir =

Change blog theme (blogdown+netlify)

∥☆過路亽.° 提交于 2019-12-07 14:14:52
问题 I have followed tutorial by Yihui and created a website using blowdown , github and netlify . Now, I want to change theme of my website. The issue is that I have several posts that produces many plots. As a result when I create a new website locally and add my posts, git push fails. I suspect it is because I have too many files. I tried adding posts piece by piece as if I am writing a new post, which worked. But it will take too much time. I suspect others have the same problem. Is there a

Change figure and table captions in blogdown

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 12:16:16
问题 I'm tinkering with blogdown and would like to create figures and table with non-English caption headers. The following chunk ```{r label1, echo=FALSE, fig.cap="Fancy caption", fig.fullwidth=TRUE} plot(1,1) ``` produces the plot and a caption that reads Figure 1: Fancy caption I'd like to be able to change the label such that, say, "Figure" becomes "Plot". I thought I could fix it in the same way as for bookdown : In the _bookdown.yml file I could have language: ui: chapter_name: "Chap "

Website not updating with blogdown & hugo

旧城冷巷雨未停 提交于 2019-12-07 02:48:18
问题 I know this question is likely to get down-voted due to insufficient reproducibility of code leading to the error, but I am so dumbfounded by the error I do not even know where to start in explaining it clearly enough. I therefore apologise in advance. This issue has occurred twice on two separate machines. I created a new site with blogdown in R-Studio using the hugo-academic theme new_site(theme = "gcushen/hugo-academic") Everything works fine, and I start adding some publications (as

Include image preview in blogdown (.Rmd yaml header)

假装没事ソ 提交于 2019-12-06 14:28:44
I have tried a couple of approaches but none worked so far. I want to include an image preview for a blog post written in R markdown (.Rmd) on my main blog page where a number of posts and projects are generally shown. I can make it work in plain markdown (.md) using below code taken from the Hugo academic-theme here +++ # Optional image to display on homepage (relative to `static/img/` folder). image_preview = "bubbles.jpg" +++ The result would look as shown here (see section Projects ). However, I do not know how to translate this to the .Rmd yaml in my blog post. I can include an image at

Change the default directory for blogdown posts

不打扰是莪最后的温柔 提交于 2019-12-06 06:19:39
Posts for the Hugo theme I am using are in the /content/blog directory, whereas the default for new posts created with blogdown::new_post() is the /content/post directory. From looking at the function definition, there is a global option to change the directory new posts are saved to (the help indicates this, too): new_post(title, kind = "default", open = interactive(), author = getOption("blogdown.author"), categories = NULL, tags = NULL, date = Sys.Date(), file = NULL, slug = NULL, subdir = getOption("blogdown.subdir", "post"), ext = getOption("blogdown.ext", ".md")) It looks like if I

Change blog theme (blogdown+netlify)

本秂侑毒 提交于 2019-12-06 01:46:30
I have followed tutorial by Yihui and created a website using blowdown , github and netlify . Now, I want to change theme of my website. The issue is that I have several posts that produces many plots. As a result when I create a new website locally and add my posts, git push fails. I suspect it is because I have too many files. I tried adding posts piece by piece as if I am writing a new post, which worked. But it will take too much time. I suspect others have the same problem. Is there a way to change theme of my website easier? Two ways of changing themes in blogdown, which are documented

Change figure and table captions in blogdown

爱⌒轻易说出口 提交于 2019-12-06 01:29:29
I'm tinkering with blogdown and would like to create figures and table with non-English caption headers. The following chunk ```{r label1, echo=FALSE, fig.cap="Fancy caption", fig.fullwidth=TRUE} plot(1,1) ``` produces the plot and a caption that reads Figure 1: Fancy caption I'd like to be able to change the label such that, say, "Figure" becomes "Plot". I thought I could fix it in the same way as for bookdown : In the _bookdown.yml file I could have language: ui: chapter_name: "Chap " appendix_name: "App " label: fig: 'Plot ' tab: 'Fancy table ' but I'm not sure how to do something similar

How to add icon to webpage tabs in blogdown

夙愿已清 提交于 2019-12-06 01:07:18
问题 How can I add a favicon to by blogdown website? I am using the minimal theme. I tried adding the line in the config.toml favicon = imgPath and I also attemped to move 'favicon.ico' to the static folder, but neither has worked. 回答1: If you have a file named favicon.ico in root directory, most browsers will use it. The easiest way is to add favicon.ico in static directory (therefore, Hugo will copy it to root directory), see here. Favicon is declared in <head> element. In minimal theme, the

In R 3.5 blogdown:::serve_site() cannot render .Rmd file

大憨熊 提交于 2019-12-05 16:02:21
After I updated R to 3.5, I found I couldn't render .Rmd file. I tried to reinstall the relevant packages, but it seemed it didn't solve the problem. More specifically, the error message is: blogdown:::serve_site() Rendering content/post/mypost.Rmd Fatal error: cannot open file 'C:/Users/John': No such file or directory Error in render_page(f) : Failed to render 'content/post/mypost.Rmd' My blogdown.Rproj is under the folder C:\Users\John Smith\Documents\GitHub\blogdown . I am not sure why the path in the error message only shows cannot open file 'C:/Users/John' , the remaining part of the