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

Partial Static Sync #1644

Closed
spf13 opened this Issue Nov 29, 2015 · 10 comments

Comments

Projects
None yet
7 participants
@spf13
Contributor

spf13 commented Nov 29, 2015

Today Hugo synchronizes the entire static directory each time a file change is detected. While it only copies the changed file(s), it still goes through the process of evaluating all files on both sides to determine which file needs to be synced. This isn't necessary as we already know what file changed. We should just sync that file.

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 4, 2015

gohugoio#1644 gohugoio#1559 Copy only the static files changed. Added…
… the flag forceCopyStatic to always copy all static files when a file is changed

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 4, 2015

Copy only the static files changed
Update on the watcher copy static to copy only the changed files and add an flag forceSyncStatic to copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 5, 2015

Copy only the static files changed
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Dec 7, 2015

Copy only the static files changed
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559

spf13 added a commit that referenced this issue Dec 23, 2015

Copy only the static files changed
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See #1644 #1559
@anthonyfok

This comment has been minimized.

Show comment
Hide comment
@anthonyfok

anthonyfok Dec 28, 2015

Contributor

Hello @ffrizzo,

Thank you for your contribution, @ffrizzo! But I think I encountered a bug in your current implementation in #1671: the static directory in the theme is not synchronized. It detects that I changed the style.css (which is inside the theme's static/ directory), but it is probably trying to copy it from the wrong place.

Contributor

anthonyfok commented Dec 28, 2015

Hello @ffrizzo,

Thank you for your contribution, @ffrizzo! But I think I encountered a bug in your current implementation in #1671: the static directory in the theme is not synchronized. It detects that I changed the style.css (which is inside the theme's static/ directory), but it is probably trying to copy it from the wrong place.

@anthonyfok anthonyfok added this to the v0.16 milestone Dec 28, 2015

@ffrizzo

This comment has been minimized.

Show comment
Hide comment
@ffrizzo

ffrizzo Dec 28, 2015

Contributor

Hello @anthonyfok ,

I'll take a look on that and I'll submit a new pull request with the fix.

Contributor

ffrizzo commented Dec 28, 2015

Hello @anthonyfok ,

I'll take a look on that and I'll submit a new pull request with the fix.

ffrizzo added a commit to ffrizzo/hugo that referenced this issue Jan 2, 2016

Copy static files changed
Fix watcher copy static theme files for
changed files

See gohugoio#1644 gohugoio#1559

spf13 added a commit that referenced this issue Jan 4, 2016

Copy static files changed
Fix watcher copy static theme files for
changed files

See #1644 #1559
@Skrylar

This comment has been minimized.

Show comment
Hide comment
@Skrylar

Skrylar Feb 17, 2016

On my box, it actually copies a bit more than just the changed file. Every single file is written to the output directory for every single run of hugo, with the exception of those in the static files directory.

Skrylar commented Feb 17, 2016

On my box, it actually copies a bit more than just the changed file. Every single file is written to the output directory for every single run of hugo, with the exception of those in the static files directory.

@spf13

This comment has been minimized.

Show comment
Hide comment
@spf13

spf13 Feb 18, 2016

Contributor

@Skrylar can you provide more information about that? Can you paste the output running with --verbose?

Contributor

spf13 commented Feb 18, 2016

@Skrylar can you provide more information about that? Can you paste the output running with --verbose?

@Skrylar

This comment has been minimized.

Show comment
Hide comment
@Skrylar

Skrylar Feb 21, 2016

@spf13

INFO: 2016/02/21 00:08:56 hugo.go:439: Using config file: c:\Dev\Hugotest\config.toml
WARN: 2016/02/21 00:08:56 hugo.go:522: Unable to find Theme Static Directory:
INFO: 2016/02/21 00:08:56 hugo.go:542: c:\Dev\Hugotest\static\ is the only static directory available to sync from
INFO: 2016/02/21 00:08:56 hugo.go:580: syncing static files to c:\Dev\Hugotest\public\
INFO: 2016/02/21 00:08:56 site.go:1275: found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
WARN: 2016/02/21 00:08:56 site.go:1995: Unable to locate layout for 404 page: [404.html]
WARN: 2016/02/21 00:08:56 site.go:1971: "404.html" is rendered empty
0 draft content
0 future content
10 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 31 ms

If I force the cache directory to be somewhere (ex. in the "cache" folder of the same directory), no files are left behind there. I'm not sure if that's intended or a symptom.

Skrylar commented Feb 21, 2016

@spf13

INFO: 2016/02/21 00:08:56 hugo.go:439: Using config file: c:\Dev\Hugotest\config.toml
WARN: 2016/02/21 00:08:56 hugo.go:522: Unable to find Theme Static Directory:
INFO: 2016/02/21 00:08:56 hugo.go:542: c:\Dev\Hugotest\static\ is the only static directory available to sync from
INFO: 2016/02/21 00:08:56 hugo.go:580: syncing static files to c:\Dev\Hugotest\public\
INFO: 2016/02/21 00:08:56 site.go:1275: found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
WARN: 2016/02/21 00:08:56 site.go:1995: Unable to locate layout for 404 page: [404.html]
WARN: 2016/02/21 00:08:56 site.go:1971: "404.html" is rendered empty
0 draft content
0 future content
10 pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
in 31 ms

If I force the cache directory to be somewhere (ex. in the "cache" folder of the same directory), no files are left behind there. I'm not sure if that's intended or a symptom.

@bep bep modified the milestones: future, v0.16 May 7, 2016

@jdevoo

This comment has been minimized.

Show comment
Hide comment
@jdevoo

jdevoo May 24, 2016

I just wanted to contribute an issue with the static folder not showing the contributed files from the theme on a Windows machine. My post on the forum here.
When I create the css and img folders manually, the content is correctly added. I thought I would mention this under partial static sync.

jdevoo commented May 24, 2016

I just wanted to contribute an issue with the static folder not showing the contributed files from the theme on a Windows machine. My post on the forum here.
When I create the css and img folders manually, the content is correctly added. I thought I would mention this under partial static sync.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 1, 2017

Member

This issue has been automatically marked as stale because it has not been commented on for at least six months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

Member

bep commented Jul 1, 2017

This issue has been automatically marked as stale because it has not been commented on for at least six months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Jul 1, 2017

@jdevoo

This comment has been minimized.

Show comment
Hide comment
@jdevoo

jdevoo Jul 1, 2017

@bep I had indicated on the forum it this had been fixed with 0.17 DEV
Forgot to update here.

jdevoo commented Jul 1, 2017

@bep I had indicated on the forum it this had been fixed with 0.17 DEV
Forgot to update here.

@bep bep added Keep and removed Stale labels Jul 1, 2017

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 1, 2017

Member

@jdevoo this issue isn't really about your problem.

Member

bep commented Jul 1, 2017

@jdevoo this issue isn't really about your problem.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Jul 1, 2017

Member

But then again, I'm pretty sure that this "syncing issue" described in the first post also should be fixed now, by what I can read in the code and by testing; we only sync the path matching the change event(s). Can you confirm, @spf13 ?

Member

bep commented Jul 1, 2017

But then again, I'm pretty sure that this "syncing issue" described in the first post also should be fixed now, by what I can read in the code and by testing; we only sync the path matching the change event(s). Can you confirm, @spf13 ?

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Copy only the static files changed
Update on the watcher copy static to copy only the
changed files and add an flag forceSyncStatic to
copy all statics always a static is changed

See gohugoio#1644 gohugoio#1559

tychoish added a commit to tychoish/hugo that referenced this issue Aug 13, 2017

Copy static files changed
Fix watcher copy static theme files for
changed files

See gohugoio#1644 gohugoio#1559

@bep bep closed this Nov 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment