nicercode / EnvironmentalComputing

These are the R markdown files used to generate
http://environmentalcomputing.net/
Creative Commons Attribution 4.0 International
16 stars 5 forks source link

blogdown isn't building the image paths correctly for pages at lower levels of the hierarchy #1

Closed wcornwell closed 2 years ago

wcornwell commented 2 years ago

i think it has something to do with this:

https://github.com/rstudio/blogdown/issues/45

but mostly i'm confused right now

dfalster commented 2 years ago

Tis is fixed in above commit. The trick is to use the format where every new page is stored in its own folder, along with all the images and data you need. Within that folder the rmd is file is named _index.rmd. Any images or files linked in the page can be stored in the folder too, enabling you to to use relative links in the rmd file. E.g.

├── page_name
|     ├── _index.rmd
|     ├── data.csv
|     ├── image.jpg
|     ├── ....
├── another_page

If you instead make a sub page by creating a second red file inside a folder, you need to prefix all links to files and images with ../