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

Gulp watch does not detect new layouts #46

Closed
Jayphen opened this Issue Sep 12, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@Jayphen

Jayphen commented Sep 12, 2017

For some reason the gulp watch tasks do not execute recursively – adding a new layout does not trigger the hugo task as it should according to the glob pattern.

Removing the ./ in the path of the watch tasks resolves the issue e.g:

  gulp.watch("src/js/**/*.js", ["js"]);
  gulp.watch("src/css/**/*.css", ["css"]);
  gulp.watch("site/**/*", ["hugo"]);

Running latest gulp on macOS:

$ gulp -v
[16:19:41] Requiring external module babel-register
[16:19:41] CLI version 1.4.0
[16:19:41] Local version 3.9.1
@jhabdas

This comment has been minimized.

jhabdas commented Sep 18, 2017

@Jayphen what are your thoughts on pulling gulp in favor of npm scripts? hugo is moving incredibly fast and having the complexity of an abstraction like gulp atop the core binary seems like it'll lead to user frustration and missed opportunities (like use of the new --navigateToChanged feature added in hugo@0.27). what are your thoughts?

@Jayphen

This comment has been minimized.

Jayphen commented Sep 18, 2017

Yes, I agree that utilising the Hugo toolset as much as possible is preferred. PostCSS and Babel integration could be achieved relatively simply using NPM scripts compiled to the static directory, and BrowserSync can be dropped in favour of Hugo's Livereload (admittedly the feature set for the latter is not as extensive in some cases, though navigateToChanged would be nice). With the help of Concurrently, I think Gulp could be easily replaced.

@jhabdas

This comment has been minimized.

jhabdas commented Sep 19, 2017

Totally. It never ceases to amaze me how many cool libs are out there like Concurrently. I started using the nav to changed and was amazed at how wasteful I realized my previous dev workflow was. Haha. Thanks for your inputs. Do you know of any other Hugo boilerplates? Not sure if anyone is targeting the design minimalist case, and Hugulp looks like it's stagnating a bit.

@Jayphen

This comment has been minimized.

Jayphen commented Sep 19, 2017

@jhabdas Apart from those mentioned in the Hugo docs, no I don't know of any others. I made a basic one using Brunch instead of Gulp, but it's very basic and I ended up abandoning it because I couldn't figure out how to fix sourcemaps (Brunch seems to have some issues in that department)

@jhabdas

This comment has been minimized.

jhabdas commented Sep 19, 2017

Oh nice. I should probably sit down for like a day and revisit all the goodness in the new Hugo docs site. I keep finding more around each corner. I love brunch (and Paul Miller—he drinks vodka with the best of them) so I started a list of undocumented starters and boilerplates on the discussion forums and popped you in there. Stay classy and happy hacking @Jayphen.

@Jayphen

This comment has been minimized.

Jayphen commented Sep 19, 2017

Indeed, Hugo is excellent and in my short time with it I have had many pleasant surprises with the toolset. Looking forward to the opportunity to work with it on client sites.

Cheers!

@crgeary

This comment has been minimized.

Contributor

crgeary commented Oct 6, 2017

@jhabdas checkout Atlas. Disclaimer, I built it.

But, to cover the gulp issue.. The default gulp.watch() does not watch new files, which is mentioned on this stack overflow thread, you can use the gulp-watch plugin which does detect new files. I'd be happy to make a PR to swap this out if that suits everyone?

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