I’m working on a new site and am using NPM and Gulp to work with my SASS files.
I’m using Hugo v0.29, Node v6.11.3, NPM v3.10.10 for information’s sake.
Rather than using a pre-made theme, I’m just trying to build out a site structure from scratch.
I have an src folder with my SASS files.
In my static folder I have a css folder with the main CSS file for the site.
When I run Gulp, it does its thing with the SASS and punts out a new main.css file in the /static/CSS folder and then Hugo returns:
2017-09-30 23:23 -0700
Syncing \css\main.css to C:\Users\logan\documents\site\portfolio\
The livereload breaks and even if I manually hit reload, no changes have been made to the site. I don’t get the site rebuilding message from Hugo at all.
Here’s my gulpfile.js
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
//Variables
var input = './src/scss/**/*.scss';
var output = './static/css';
var sassOptions = {
errLogToConsole: true,
outputStyle: 'expanded'
};
var autoprefixerOptions = {
browsers: ['last 10 versions', '> 5%', 'Firefox ESR']
};
//Tasks
gulp.task('sass', function () {
return gulp
// Find all `.scss` files from the `stylesheets/` folder
.src(input)
// Run Sass on those files
.pipe(sass(sassOptions).on('error', sass.logError))
// Write the resulting CSS in the output folder
.pipe(autoprefixer())
.pipe(gulp.dest(output));
});
gulp.task('watch', function() {
return gulp
// Watch the input folder for change,
// and run `sass` task when something happens
.watch(input, ['sass'])
// When there is a change,
// log a message in the console
.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});
//order of operations
gulp.task('default', ['sass', 'watch']);
And my config.toml:
languageCode = "en-us"
title = "Logan Egbert"
description = "Portfolio Website of Logan Egbert"
publishDir = "docs"
layoutDir = "layouts"
contentDir = "content"
source = "src"
staticDir = "static"
I’m guessing i’m missing something, but I’m new to Hugo and can’t really think of what.
Any help?