Updating old RMarkdown hugo website running into errors - r-markdown

It's been a few year's since updating my personal website: https://statsbylopez.netlify.com/
That site was built with what now appears to be an outdated Hugo theme (hugo-academic).
On a new computer, I've downloaded the same repo and went to make changes, but when trying to render the site, ran into errors.
blogdown:::serve_site()
Renders the following error
Launching the server via the command:
C:/Users/michael.lopez/AppData/Roaming/Hugo/0.101.0/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\_default\single.html:1:3": execute of template failed: template: _default/single.html:1:3: executing "_default/single.html" at <partial "header.html" .>: error calling partial: "C:\Users\michael.lopez\Documents\GitHub\mlopez\themes\hugo-academic\layouts\partials\header.html:9:10": execute of template failed: template: partials/header.html:9:10: executing "partials/header.html" at <.Hugo.Generator>: can't evaluate field Hugo in type *hugolib.pageState
It appears the original Hugo themes are outdated (wowchemy), but I also know changing themes is not recommended (see here).
Any advice?

This is the same problem as the one reported in the blogdown Github repo. I'm just copying the answer here:
If you have an old site with the wowchemy/academic theme that used to work, it shouldn't be too hard to make it continue to work. The only thing you need to figure out is which Hugo version you were using at that time. Then pin the Hugo version in .Rprofile (follow the tips of blogdown::check_site()). If you don't remember the version now, you may
either view the HTML source of the old site and see if the Hugo version was written there (of the form <meta name="generator" content="Hugo X.Y[.Z]" />
or browse the Hugo releases: https://github.com/gohugoio/hugo/releases and guess the version released at about the same time as when your old site was created.
Then install that version of Hugo with blogdown::install_hugo("THAT_VERSION").

Read the docs. Or at least search them for "hugo.generator"
Understand you don't need Hugo.Generator.
Delete it.
See if it builds.

Related

docusaurus fails to find images after build

I have a Docusauris site that works fine when in development mode, served using npm run start. My docs pages (e.g. docs/GettingStarted.md) include images such as:
<img src="/images/Buttons.png" width="400"/>
which are displayed properly when using the development server.
However, if I now run npm run build and npm run serve, the images are not found. The build process should have changed the URL to, e.g. assets/images/Buttons.png, but it didn't; it remains unchanged as /images/Buttons.png.
It is possible that this arises from a bad docusaurus.config.js. The docusaurus directory is at http://localhost/prsm/doc/help and I am looking at the served pages at http://localhost:3000/prsm/doc/help/
The docusaurus.config.js config has the lines:
const config = {
title: 'PRSM',
tagline: 'Participatory System Mapper',
url: 'http://localhost',
baseUrl: '/prsm/doc/help/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: '/images/favicon.ico',
...
What am I doing wrong?
What I should have done is read the documentation even more closely. The correct syntax for what I was trying to achieve is:
<img src={require("/static/images/Buttons.png").default} width="400"/>

Django Debug Toolbar Won't Hide on Chrome

Clicking on Hide on the Django debug toolbar (version 1.10.1) does not work on my Google Chrome (Version 69.0.3497.100). I'm using Django 1.11.15 and I can confirm that the Hide does indeed work on Firefox.
The following is output by the console:
Uncaught ReferenceError: djdt is not defined at toolbar.js:305
Line 305 being:
})(djdt.jQuery, djdt);
Anyone have suggestions on how to fix this or provide a possible workaround?
The toolbar.js file does not contain })(djdt.jQuery, djdt); in version 1.10.1. It sounds like your browser may have cached an old version of toolbar.js.
You may have to run collectstatic To update your static files with the new version.

open tensorboard in Google Chrome shows blank

My tensorflow is installed on ubuntu 16.04 and also generates log files, but when running tensorboard there is nothing on Google Chrome. There was no error on the command line.
This error only appears on Google Chrome. What can I do to display it properly?
This file is deprecated. Please use
iron-flex-layout/iron-flex-layout-classes.html, and one of the
specific dom-modules instead
thinkpad/:39507 This file is deprecated. Please use
iron-flex-layout/iron-flex-layout-classes.html, and one of the
specific dom-modules instead
thinkpad/:157058 Uncaught TypeError: Object.values is not a function
It's possible you're using Chrome version 49 or earlier: https://caniuse.com/#search=object.value
I mailed out tensorflow/tensorboard#1089 to solve this problem. Please note there might be other things in our codebase that are incompatible with old browsers. I'd like to improve this situation. Please email jart#google.com if you encounter similar problems.
It especially helps if you can send a screenshot of the code in question. For example, if Chrome says JavaScript broke on line 48238, you can run wget -O index.html http://localhost:6006/ and nano +48238 index.html so you can take a screenshot of the code in question. (Note: This will get easier in the future.)

RMarkdown html_output error

I am trying to create a RMarkdown document with RStudio using shiny server. It works fine if the ouptut is pdf but if I want it as html I get this following error at the end of the process (in the RMarkdown console I can see it reached 100%).
Error: unrecognized fields specified in html_dependency: attachment
I have no idea why this error is happening.
Can anyone help me with this?
Thank you
I had a similar problem and found that it was caused by RStudio attempting to use Knitr to build a Shiny page. You can fix this by running using rmarkdown::run() instead of rmarkdown::render(). In some older versions of RStudio, the "Knit html" button runs this:
rmarkdown::render('filename.Rmd', 'html_document')
whereas, you can get the the results you want by running this command instead:
rmarkdown::run('filename.Rmd')
You could use this command or just update to the latest version of RStudio.
There is more info about authoring Shiny document here: http://rmarkdown.rstudio.com/authoring_shiny.html.
This is caused by a recent update of the relevant rmarkdown package or related ones.
Update RStudio to the latest version and then the error should disappear. It worked in my case.
Updating RStudio didn't work for me. What did work was updating all R packages (Tools > Check for Package Updates...).

Dajaxice not being parsed by template renderer?

Well i recently put my site into production and this is the last of a few bugs i need to fix. Basically dajaxice/dajaxice.core.js in returning this error in console Uncaught SyntaxError: Unexpected token %. I have placed that particular folder into static and run collect static. The file is fetched however upon opening up the file from the error the django code embedded within the file is not being rendered.
I have placed the file wihtin the head of my base file. Does anyone have any suggestions as to why this is occuring. In my local envionment (development) it is working flawlessly. The only difference i had when installing the two is that i used pip to install it on production and on local i directly downloaded the file and installed it from github. How do i find the version of Dajaxice that is installed?
Does anyone have any ideas as to why this is occuring?
Thanks