5

The tranquilpeak website doesnt render properly on netlify even though it looks fine locally. screen shots are below.

My repo is located here. Any help would be greatly appreciated.

It took me multiple trials and errors to get my site to work fine locally. The previous attempts lead to the same result as you can see on the netlify picture.

Successful local attempt:
a) create an empty folder
b) setwd(folder)
c) new_site(theme = "kakawait/hugo-tranquilpeak-theme")
d) create a project in the existing folder e) init a git repository in this folder

Previous attemps:
- creating a generic project, then using new_site(theme = "kakawait/hugo-tranquilpeak-theme")
- creating a new "website using blogdown" project, asking for the "kakawait/hugo-tranquilpeak-theme" theme.

Screenshots
serve_site:

serve_site

netlify:
netlify

Zoltan
  • 760
  • 4
  • 15
  • 1
    seems `js` libraries haven't loaded properly. Did you check that. – amrrs Jan 24 '19 at 05:07
  • thanks for replying - I have no idea how to check for that – Zoltan Jan 24 '19 at 05:08
  • 2
    this file is missing ` ` – amrrs Jan 24 '19 at 05:09
  • I checked locally. It is in the /public/js folder, meaning that is was created by hugo at build time. If I understand [this](https://bookdown.org/yihui/blogdown/netlify.html) correctly, then I shouldnt have to commit the /public folder to github. Maybe I need to change some settings on netlify? – Zoltan Jan 24 '19 at 05:13
  • 2
    You can see the file here. I think it's the path issue (or home directory( `https://github.com/SimonCoulombe/snippets/tree/master/themes/hugo-tranquilpeak-theme/static/js` – amrrs Jan 24 '19 at 05:14
  • should I put something under base directory? ![continuous_deployment](https://i.imgur.com/7wLMMf4.png) – Zoltan Jan 24 '19 at 05:17
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/187223/discussion-between-amrrs-and-zoltan). – amrrs Jan 24 '19 at 05:25
  • 1
    https://github.com/rstudio/blogdown/issues/114#issuecomment-304998375 – amrrs Jan 24 '19 at 05:29

1 Answers1

5

Your issue comes from your asset paths being built to look for them at your base url path set in config.toml, which happens to be your old server.

During development on Netlify, Hugo works well for me by changing my baseURL.

config.toml

# baseURL = "https://www.simoncoulombe.com/"
baseURL = "/"

Then you can always change it back once you have the domain pointing to Netlify.

Note: add your public folder to your .gitignore when hosting on Netlify. public will get built by your build command.

talves
  • 13,993
  • 5
  • 40
  • 63
  • Yes it was basically the baseURL. I had changed it, but netlify queued the update. After a while it deployed the updated baseURL and everything was good. Good tip regarding the .gitignore! I'm looking at a good way of managing data. Some blog posts need "external" data (csv that need to be provided). Wondering what would be the best practices for the location of those files. – Zoltan Jan 29 '19 at 04:18