Building blogdown site twice leads to incorrect formatting - r

Rebuilding blogdown site is not rendering correctly for some themes.
Having created a new directory using the R Project Wizard in RStudio, I create a new site using a custom theme such as "AlexFinn/simple-a" or "zwbetz-gh/vanilla-bootstrap-hugo-theme" with blogdown::new_site(theme = "AlexFinn/simple-a"). Once created, I add the following to to config.TOML; ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
At this point, all is working as expected and I get a properly formatted example site.
When I press the 'Build Website' button in the Build panel in RStudio again OR I upload to Netlify, for these two themes, my website is rendered with all styling and images removed; black text - bolded and sized - and with a plain white background. With "gcushen/hugo-academic" the colours appear but the images are missing. Nothing appears different with the "road2stat/hugo-tanka".
I would understand this behaviour with the vanilla theme but "simple-a" and "hugo-academic" are mentioned in the blogdown book in chapter 1.6
I am using Hugo 0.53 and blogdown_0.10.1

Build Website is not for rendering the blogdown website, What it does is to render multiple Rmarkdown documents into a website.
You should use Addins -> Serve Site or call the command blogdown::serve_site() instead.
For more information on the difference between rmarkdown::render_site() and blogdown, you can read
help("render_site", package="rmarkdown") and
The rmarkdown official manual

Related

File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap. in blogdown

I am trying to make a website using blogdown in R. I have installed blogdown v1.15.
To create the website I click on new project, select the option to create it in a new directory and then select to use the blogdown template. In the screen that comes up after, I give my project a name, paste "google/docsy" into the Hugo theme text box to use this theme and click create (I leave all the tick boxes as is, which is all selected except 'Keep empty directories'.
These steps seem to complete fine. However, when I run blogdown::serve_site() then I get the error
Error: Error building site: TOCSS: failed to transform "scss/main.scss" (text/x-scss): "/path-to-r-project/assets/scss/main.scss:6:1": File to import not found or unreadable: ../vendor/bootstrap/scss/bootstrap.
and the site is not made.
Other information that might be useful, I am using
R v4.1.2
Blogdown v1.15
Hugo v 0.101.0
Many thanks

error adding codefolding in blogdown in r

I have been working on blogdown to generate the following website. So far so good, however I have been trying to add codefolding which is easy to do in a common rmarkdown document.
I found this blogpost, where they do it. I have been trying to play with that, I did steps 1 and 2 for blogdown so generated the codefolding.js and modified the config.toml in the theme template as well, however when I get into the header and/or footer I got stuck, I even tried to generate a new post where I cloned and copied the whole folder here however it is not working an I get the following error
I am not sure what I did wrong here

Blogdown not displaying plots

I have my blogdown site that has been running for a while. When writing a post today I cannot get plots to render when running serve_site().
The plot generates fine when running the .Rmd in interactive mode, it's only when being built by knitting/serve_site/build_site that it doesn't work. The image below shows what I see on the webpage - just that small icon in the bottom.
I know these questions have come up a lot, so just to list the things I've tried:
There is no .gitignore under the static directory
I've set [markup.goldmark.renderer]unsafe = true in the config.toml
I've checked that the figures are being generated (I can see the files under index_files/figure-html)
You can see my blog source here
And the (not working) webpage here

Use Rmd files for content pages in blogdown website

I am considering switching my website to blogdown. My current set-up only uses .Rmd files with a less-than-ideal blog implementation. It seems like one advantage of blogdown is that it automates the blogging part of the website (posts, lists, dates, etc.) and allows RMarkdown. This is my main motivation to switch. However, the downside, I think, is that I cannot create content pages in RMarkdown (i.e., content > about.Rmd)... it seems this is limited to .md files. I would like to use .Rmd for all the pages so that I can incorporate r code. My question: Is it possible to create .Rmd content pages in blogdown?
EDIT...
Specifically, I created by hand research.Rmd in the content folder. I can include a trivial example, such as...
`r 2 + 2`
and when I run serve_site() the r code is not rendered. I can knit the file by hand, but the file does not have the style of the theme I am using and once I again try to serve the site the file is rendered as if it were a .md file.
```
EDIT 2...
You can reproduce the behavior I am referring to by doing the following...
Create a new blowdown site: new_site(dir = ".", theme = 'gcushen/hugo-academic')
Create new content: new_content('test/index.Rmd')
Set draft to false and add trivial r code: I used 2 + 2 as shown above.
Serve site and go to test/index.html. There is no r code rendered.
From your Edit 2, you seem to have fallen into a common Hugo trap: content/test/index.Rmd does not necessarily generate test/index.html. Hugo uses the convention _index.md to generate a homepage for a subfolder, and you have to use content/test/_index.Rmd in your case. For content/about.Rmd or content/research.Rmd, they will generate about/index.html and research/index.html respectively by default.

Visual Composer not parsing

I just installed a theme I bought for wordpress and I installed dummy data.
The istructions said I should install the visual composer plugin so I am assuming that is was built that way.
But when I open pages that it came with, it doesn't parse nicely.
i have 1 page, that when I open it in visual composer the entire page shows up in 1 box that says raw html data.
But when i try to view it in classic mode, all I saw is gibberish letters and numbers
There is another page, that looks like the rows are split properly. But all the boxes say 'text box' instead it should be a bannervideo editing box.
when I view it in classic mode , it looks more like visual composer code
[vc_row][vc_column][bannervideo title="Atena Excellence in teaching" desc="College / University / Campus"
text1="Take a tour" link1="#" text2="View courses" link2="#"
play="Play video" image="184" link="https://vimeo.com/20370747" linkmp4="/intro.mp4" linkogv="huploads/2016/01/intro.ogv"]
[/vc_column][/vc_row]
Did I do something wrong when importing dummy data, or is it a problem with my visual composer?
or am I supposed to be using a different rendering plugin
Because your theme miss map for 'bannervideo' shortcode. You should contact to theme author to fix that or provide plugin define the map for that element.
Other option for page builder is King Composer. It is works well with any website https://wordpress.org/plugins/kingcomposer/

Resources