Skip to content

404 on file change. #9

@Reklino

Description

@Reklino

On first run of my build.js file, everything works fine. Whenever I edit a file, .md or .jade, the browser reloads, but I get a 404 error. Has anyone else run into this issue?

build.js file:

var metalsmith = require('metalsmith'),
    layouts = require('metalsmith-layouts'),
    inPlace = require('metalsmith-in-place'),
    markdown = require('metalsmith-markdown'),
    browserSync = require('metalsmith-browser-sync'),
    moment = require('moment'),
    collections = require('metalsmith-collections'),
    beautify = require('metalsmith-beautify');

var siteBuild = metalsmith(__dirname)
    .metadata({
        site: {
            title: 'MetalSmith test'
        }
    })
    .source('./src')
    .destination('./build')
    .use(collections({
        posts: {
            pattern: 'posts/*.md',
            sortBy: 'date',
            reverse: true
        }
    }))
    .use(markdown())
    .use(layouts({
        engine: 'jade',
        moment: moment
    }))
    .use(browserSync({
        server : 'build',
        files  : ['src/**/*', 'layouts/*.jade']
    }))
    .build(function(err) {
        if(err) {
            console.log(err);
        }
        else {
            console.log('We did it!')
        }
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions