hbs-rcs / R_Intro-gapminder

A tutorial on data analysis and visualization in R for the social sciences
https://hbs-rcs.github.io/R_Intro-gapminder/
Other
0 stars 0 forks source link

Fix permalinks #15

Open amarder opened 7 years ago

amarder commented 7 years ago

I am trying to use the Material Docs theme for Hugo with blogdown. Unfortunately the navigational links do not work.

amarder commented 7 years ago

I think this might be an issue with blogdown interacting with hugo.

amarder commented 7 years ago

I could use the R/build.R script to modify the render_page function.

https://github.com/rstudio/blogdown/blob/master/R/render.R#L79-L110 https://github.com/rstudio/blogdown/blob/master/R/render.R#L132-L135 https://github.com/rstudio/blogdown/blob/master/inst/scripts/render_page.R

amarder commented 7 years ago

This gets me a bit closer:

render_page <- function(input, script = NULL) {
    rmarkdown::render(input, output_format = "md_document")
    md <- sub('.Rmd', '.md', input)
    html <- sub('.Rmd', '.html', input)
}

assignInNamespace(
    x = "render_page",
    value = render_page,
    ns = "blogdown"
)

But, I think I need to modify the build_rmds function too.