Search code examples
rhugoblogdownnetlify

Blogdown website only works locally and not through neltify


I have made a website using blogdown and hugo, the theme is https://themes.gohugo.io/hugo-tranquilpeak-theme/, and when I use serve_site() it works perfectly. I have pushed it to github and connected netlify to github and chosen the public folder as the publish folder. However, when I go to my netlify website, https://stoic-swirles-da950d.netlify.com/, it does not look the same as the local website. I copied in the session info for blogdown below.

Session info ----------------------------------------------------
 setting  value                       
 version  R version 3.4.2 (2017-09-28)
 system   x86_64, darwin15.6.0        
 ui       RStudio (1.1.453)           
 language (EN)                        
 collate  da_DK.UTF-8                 
 tz       <NA>                        
 date     2018-10-02                  

Packages --------------------------------------------------------
 package   * version  date       source                           
 backports   1.1.2    2017-12-13 cran (@1.1.2)                    
 base64enc   0.1-3    2015-07-28 CRAN (R 3.4.0)                   
 BH          1.66.0-1 2018-02-13 cran (@1.66.0-)                  
 blogdown    0.8.6    2018-10-02 Github (rstudio/blogdown@44895dd)
 bookdown    0.7      2018-02-18 CRAN (R 3.4.3)                   
 digest      0.6.17   2018-09-12 CRAN (R 3.4.4)                   
 evaluate    0.11     2018-07-17 cran (@0.11)                     
 glue        1.3.0    2018-07-17 cran (@1.3.0)                    
 graphics  * 3.4.2    2017-10-04 local                            
 grDevices * 3.4.2    2017-10-04 local                            
 highr       0.7      2018-06-09 cran (@0.7)                      
 htmltools   0.3.6    2017-04-28 CRAN (R 3.4.0)                   
 httpuv      1.4.5    2018-07-19 CRAN (R 3.4.4)                   
 jsonlite    1.5      2017-06-01 CRAN (R 3.4.0)                   
 knitr       1.20     2018-02-20 cran (@1.20)                     
 later       0.7.5    2018-09-18 CRAN (R 3.4.4)                   
 magrittr    1.5      2014-11-22 CRAN (R 3.4.0)                   
 markdown    0.8      2017-04-20 CRAN (R 3.4.0)                   
 methods   * 3.4.2    2017-10-04 local                            
 mime        0.5      2016-07-07 CRAN (R 3.4.0)                   
 promises    1.0.1    2018-04-13 CRAN (R 3.4.4)                   
 R6          2.2.2    2017-06-17 CRAN (R 3.4.0)                   
 Rcpp        0.12.19  2018-10-01 CRAN (R 3.4.2)                   
 rlang       0.2.2    2018-08-16 cran (@0.2.2)                    
 rmarkdown   1.10     2018-06-11 cran (@1.10)                     
 rprojroot   1.3-2    2018-01-03 cran (@1.3-2)                    
 servr       0.10     2018-05-30 CRAN (R 3.4.4)                   
 stats     * 3.4.2    2017-10-04 local                            
 stringi     1.2.4    2018-07-20 CRAN (R 3.4.4)                   
 stringr     1.3.1    2018-05-10 cran (@1.3.1)                    
 tinytex     0.8      2018-08-30 CRAN (R 3.4.4)                   
 tools       3.4.2    2017-10-04 local                            
 utils     * 3.4.2    2017-10-04 local                            
 xfun        0.3      2018-07-06 cran (@0.3)                      
 yaml        2.2.0    2018-07-25 cran (@2.2.0)  

The github repo is https://github.com/rasmusfiskerbang/thedword

I have also added a picture of my netlify settings

netlify settings


Solution

  • If you are just worried about the look, then I suggest you should make the habit of opening up (Ctrl+Shift+J) Console and Network tabs in Chrome or Firefox when loading your webpage. This is the first basic step to find out design errors in the webpages.

    Some of your *.min.css & *.min.js files are getting 404 File not found error. So try changing line 15 at https://github.com/rasmusfiskerbang/thedword/blob/master/config.toml from baseURL = "https://example.org/" to

    baseURL = "https://stoic-swirles-da950d.netlify.com/"

    Also you don't have static/css and static/js folders along with their *.min.js and *.min.css files so first create css & js folders inside static then copy those local files and finally push them to your github repo with correct filepaths. Netlify should automatically build and deploy once the new changes are committed. ELSE run deploy from your Netlify settings.

    In short, it is all about filepaths errors. 404s. Thank you :)