Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with site appearance when deploying via Netlify #114

Closed
jrosen48 opened this issue May 29, 2017 · 13 comments

Comments

@jrosen48
Copy link

commented May 29, 2017

Thanks for a great package.

When I use blogdown::serve_site(), the site displays correctly:

screen shot 2017-05-29 at 8 02 48 am

However, when I deploy the site to Netlify (with build command hugo and publish directory public), the site does not appear to appear to display correctly:

screen shot 2017-05-29 at 8 04 25 am

In particular, all of the theming seems to not be appearing.

Are there changes I can make to the site's files or other changes I can make the appearance on Netlify as it displays locally?

@znmeb

This comment has been minimized.

Copy link

commented May 29, 2017

Your problem may be using "hugo" to build rather than Blogdown / RStudio. Here's my process, which is known to work (on Linux - may need adjustments on Windows but should work on a Mac):

  1. In RStudio, set up the "Build" tools. Then do a "clean" and a "build".
  2. Open a terminal. "cd" into "public" and type "netlify deploy".

You'll get a menu ... use the arrow key to select the site you want (or create a new one). Then when it finishes, browse to the site.

@cderv

This comment has been minimized.

Copy link
Contributor

commented May 30, 2017

I had the same problem and moreover with the same theme. You have to get your configuration right in config.toml by setting baseurl to your netlify url. Otherwise, component of your theme (css, js, ...) is not found.

See blogdown documention about configurations

@yihui

This comment has been minimized.

Copy link
Member

commented May 30, 2017

My guess would be the same as @cderv. It will be much easier to debug the issue if the source is on Github or at least show us a link to your website @jrosen48.

@jrosen48

This comment has been minimized.

Copy link
Author

commented Jun 9, 2017

It seems to be deploying fine when I follow the first choice for deploying blogdown via GitHub Pages: "The first choice is to follow the default structure of a Hugo website like the diagram below, and initialize the GIT repository under the public/ directory:" So, it seems to be finding the theme components even though the config file doesn't have baseurl set.

The repo with the public directory is here: https://github.com/jrosen48/jrosen48.github.io

The source files for it are here.

The site on Netlify is here: https://maid-hilda-58016.netlify.com/

So, it seems to be working when I use the public directory (i.e., following the first choice described for deploying blogdown via Github). I haven't confirmed that changing the baseurl would fix this, as well.

@yihui

This comment has been minimized.

Copy link
Member

commented Jun 10, 2017

Since we no longer have access to the broken page, I have no idea how to debug it.

You set baseurl to / and that should be okay. Although you had problems with Netlify, I still recommend to use Netlify instead of Github pages: https://yihui.name/en/2017/06/netlify-instead-of-github-pages/

Note you can (and should!) change the name maid-hilda-58016 on Netlify. If you are willing to join rbind (https://support.rbind.io/about/), I can offer you a *.rbind.io subdomain.

@jrosen48

This comment has been minimized.

Copy link
Author

commented Jun 10, 2017

Thanks for your support. Sorry I made a different change before figuring out if what you and the others helpfully recommended. I joined the rbind community and think I may like rbind.io more than github.io URL (and certainly better than maid-hilda....

@yihui yihui added this to the v0.1 milestone Jun 23, 2017

@yihui yihui closed this Jun 23, 2017

perezp44 added a commit to perezp44/my_blog_Rflowers_IV that referenced this issue Jan 9, 2018

maurolepore added a commit to forestgeo/fgeo.blog that referenced this issue Jan 18, 2018

@maurolepore

This comment has been minimized.

Copy link

commented Jan 18, 2018

I had the same problem and fixed it as @cderv and @yihui suggested: I fixed the baseurl which didn't exactly match the site name on netlify.

Thanks all.

@djanesh

This comment has been minimized.

Copy link

commented Feb 22, 2018

Same here. Fixing baseurl fixed issue.

@flh3

This comment has been minimized.

Copy link

commented Jun 25, 2018

Hello -- thanks for working on this great package. I am working with blogdown, Github, and Netlify. The way the three of those work together is amazing.

My website deploys properly (i.e., base URL is fine, links work, updates work) but then there are some small items that are not the same (e.g., font size). I am using the academic theme.

I am trying to figure out what is the cause of that. I noticed that when using the serve_site() function, the following is displayed:

> 
>                    | EN  
> +------------------+----+
>   Pages            | 77  
>   Paginator pages  |  1  
>   Non-page files   |  1  
>   Static files     | 18  
>   Processed images |  0  
>   Aliases          | 20  
>   Sitemaps         |  1  

On Netlify-- I tried redeploying the site and it indicates this:

7:26:48 PM:                    | EN
7:26:48 PM: +------------------+----+
7:26:48 PM:   Pages            | 72
7:26:48 PM:   Paginator pages  |  1
7:26:48 PM:   Non-page files   |  1
7:26:48 PM:   Static files     | 18
7:26:48 PM:   Processed images |  0
7:26:48 PM:   Aliases          | 18
7:26:48 PM:   Sitemaps         |  1
7:26:48 PM:   Cleaned          |  0

I was hoping a clean redeployment would fix things. However, the number of pages is different from what serve_site() is reporting and what Netlify is reporting. (77 vs 72)-- what might be causing that?

Thank you in advance.

@cderv

This comment has been minimized.

Copy link
Contributor

commented Jun 25, 2018

the number of pages is different from what serve_site() is reporting and what Netlify is reporting. (77 vs 72) ?

Do you have draft pages ? (with draft: true in yaml). serve_site rendered everything including draft page and build_site does not. It could be the cause of the difference you observed.

One remark on your question: An old closed issue in Github is not the better place to ask such question. All the more if your issue is not related to the topic of the github issue. (And here, it is not related).
I think you should search for help on this kind of topic on Q&A site like https://rstudio.community.com or http://stackoverflow.com/. There will be a broader audience and it won't overcharge the github issue board preferred for bug issue or feature request issue. Thanks!

@pupaglupa

This comment has been minimized.

Copy link

commented Oct 6, 2018

I'm having the exact same problem but with a different theme (hugo-theme-sam). I've tried many different variants of the url in the baseurl section of the config.toml file but nothing seems to work... any other ideas?

@pat-s

This comment has been minimized.

Copy link

commented Oct 16, 2018

@pupaglupa Do you have a slash at the end of the baseURL by chance? (its needed) This problem costed me hours...

@tcgriffith

This comment has been minimized.

Copy link
Collaborator

commented Oct 17, 2018

@pupaglupa
could you show us your repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
10 participants
You can’t perform that action at this time.