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

Syncing does not work properly on Windows #839

Closed
karland opened this issue Jan 26, 2015 · 7 comments
Closed

Syncing does not work properly on Windows #839

karland opened this issue Jan 26, 2015 · 7 comments
Assignees
Milestone

Comments

@karland
Copy link

karland commented Jan 26, 2015

I am testing gulp.js in conjunction with hugo. I have my source Files in /src and gulp.js is processing them and putting them at the correct places under `themes/mytheme/. Now I noticed the following with hugo v0.12:

  1. hugo claims it is syncing my themes/mytheme/static/css with public/css but it leaves old .css-Files in the public/css even though the old source in themes/mytheme/static/cssis gone. So it is not deleting and therefore really not "syncing".
  2. When I am applying changes to the index.html hugo server --watch picks them up and livereload is displaying them beautifully. However, when I am applying changes to a .css-File, hugo outputs:
    Change detected, rebuilding site
    but actually does not. The updated .css-File is not synced into public/css and livereload is not displaying the changes. When I am stopping and restarting the server, the update takes place. So it seems that css-Files are only synced when the server is started.
@anthonyfok
Copy link
Member

Hi @karland,

Thank you for your comments!

  1. About Hugo not deleting old files in public/: I believe it is a design decision to "copy" and "not delete", to avoid destroying user's data inadvertently. For example, some users have hugo installed on the web server to run automatically to deploy a website after a git push. Some users may have decided to nest a "sub-website" in a subdirectory, or perhaps added some secret .htpasswd inside the public/ directory but not in static/ because the user does not want these sensitive information in a public repository on GitHub...

    Whatever the reason, automatically deleting something Hugo doesn't recognize is a very risky behaviour, and generally frowned upon by users. I don't think any other static site generators have ventured down that path either.

  2. I believe the CSS LiveReload issue was reported as Livereload CSS and images without browser refresh #490 and subsequently fixed by @bjornerik in commit df489b4 in September 2014, several weeks after Hugo v0.12 was released. I highly recommend that you try to build from the latest source of Hugo v0.13-DEV using go get as documented in README.md and in http://gohugo.io/overview/installing/.

@bep
Copy link
Member

bep commented Jan 27, 2015

The sync issue has been discussed in other issues.

About livereload, please reopen if still an issue with 0.13.

@bep bep closed this as completed Jan 27, 2015
@karland
Copy link
Author

karland commented Jan 27, 2015

@bjornerik I have compiled Hugo as suggested and I am now on

go version go1.4.1 windows/amd64
Hugo Static Site Generator v0.13-DEV

Unfortunately, the issue persists. Basically what I am doing is changing the background color from the body-element from red to blue for testing purposes in mystyle.css. Hugo detects the change:

Change detected, rebuilding site
2015-01-27 23:53 +0100
WARN: 2015/01/27 Unable to locate layout for 404 page: [404.html theme/404.html]
0 of 1 draft rendered
0 future content
0 pages created
0 paginator pages created
0 tags created
0 categories created
in 20 ms

but neither is Hugo syncing the changed mystyle.cssinto public/css nor is livereload displaying the change. When I manually copy the changed mystyle.css into public/css livereload also does not notice the change. When I refresh manually, the browser updates properly. When I stop the server and restart it, it works fine up until the next change.

@bep bep reopened this Jan 27, 2015
@bep bep changed the title Syncing does not work properly Syncing does not work properly on Windows Jan 28, 2015
@bep bep added the Bug label Jan 28, 2015
@jaden
Copy link
Contributor

jaden commented Jan 29, 2015

@karland I was seeing the same behavior and have submitted a pull request that fixes it on Windows. Once it's merged, could you test it as well to make sure it's working for you?

@bep
Copy link
Member

bep commented Jan 30, 2015

@karland @jaden's patch is merged now.

@bep bep self-assigned this Jan 30, 2015
@anthonyfok anthonyfok added this to the v0.13 milestone Jan 31, 2015
@bep
Copy link
Member

bep commented Feb 3, 2015

As per @karland's comment in #858

@bep bep closed this as completed Feb 3, 2015
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants