Hello, new to Jekyll and trying to transfer my blog to it. Content will be mainly R Studio markdown files. Plan to host on my own domain.
I am getting the following error when testing locally [2024-11-27 16:58:41] ERROR `/assets/images/unnamed-chunk-1-1.png’ not found.
The file I am testing is:
---
layout: post
title: "Testing image location"
date: "`r Sys.Date()`"
output:
md_document:
variant: gfm
preserve_yaml: true
knit: (function(inputFile, encoding) {
rmarkdown::render(inputFile,
encoding = encoding,
output_file = file.path(paste0("~/Library/CloudStorage/Dropbox/R/blog/staRt/_posts/",
Sys.Date(),
'-',
substr(basename(inputFile), 1, nchar(basename(inputFile)) - 4),
'.md'
)
)
)
})
---
baseDir <- "~/Library/CloudStorage/Dropbox/R/blog/staRt"
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(base.dir = baseDir, base.url = "/")
knitr::opts_chunk$set(fig.path = "assets/images/") #default
knitr::render_jekyll()
Test image
library(ggplot2)
summary (mtcars)
g <- ggplot(mtcars, aes(x=disp, y=hp)) +
geom_point(color = "steelblue", size = 4);
g
The new post shows on the blog but without the image, and the zsh console shows the aforementioned error:
[2024-11-27 16:58:41] ERROR `/assets/images/unnamed-chunk-1-1.png’ not found.
Can you advise how to fix this? Thank you and Happy Thanksgiving!