I get no image in the viewer panel when I run blogdown's serve_site()

Viewed 121

I used the following code to create the blogdown site with HUGO 0.88.1;

new_site(theme = 'puresyntax71/hugo-theme-chunky-poster',
         format = 'toml')

And as per the instructions I am following, a site is supposed to load on the viewer panel which is not happening.

I have tried the check_site() function and within the results I get;

Checking .gitignore
| Checking for items to remove...
○ Nothing to see here - found no items to remove.
| Checking for items to change...
○ Nothing to see here - found no items to change.
| Checking for items you can safely ignore...
○ Found! You have safely ignored: .DS_Store, Thumbs.db
| Checking for items to ignore if you build the site on Netlify...
● [TODO] When Netlify builds your site, you can safely add to .gitignore: /public/, /resources/
| Checking for files required by blogdown but not committed...
● [TODO] Found 1 file that should be committed in GIT:

  layouts/shortcodes/blogdown/postref.html

so I went to inspect the shortcode referred above which had the following content;

{{ if eq (getenv "BLOGDOWN_POST_RELREF") "true" }}{{ .Page.RelPermalink }}{{ else }}{{ .Page.Permalink }}{{ end }}

How can I commit that file to GIT as instructed? And is that the reason I am not getting a preview of the site?

NOTE: Important information I had not mentioned before; the following is the error code that I receive when I try to serve_site()

Launching the server via the command:
  C:/Users/User/AppData/Roaming/Hugo/0.88.1/hugo.exe server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-theme-chunky-poster -D -F --navigateToChanged
Error: "C:\Users\User\Documents\20210913_blogdown\web-tea\config.toml:1:1": unmarshal failed: toml: table markup already exists
1 Answers

Update: This error message

Error: "C:\Users\User\Documents\20210913_blogdown\web-tea\config.toml:1:1": unmarshal failed: toml: table markup already exists

indicates that you have two markup fields in config.toml like this:

[markup]
  [markup.highlight]
    codeFences = false
[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

You have to merge them like this:

[markup]
  [markup.highlight]
    codeFences = false
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

I cannot reproduce your problem. It seems this theme requires an access token for Instagram. I just configured an arbitrary string in accessToken like this in config.toml:

[services]
  [services.instagram]
    disableInlineCSS = true
    accessToken = "aaaa"

Then blogdown::serve_site() worked fine.

Related