Blogdown doesnt render properly on netlify (theme tranquilpeak)

北城以北 提交于 2019-12-23 03:57:10

问题


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:

netlify:


回答1:


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.



来源:https://stackoverflow.com/questions/54339682/blogdown-doesnt-render-properly-on-netlify-theme-tranquilpeak

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!