tolyo / html-pages-brunch

Brunch plugin for compiling and minifying HTML files
MIT License
11 stars 4 forks source link

path access issue - [error] 7#7: *14 directory index of "/var/www/" is forbidden #5

Closed muz3 closed 8 years ago

muz3 commented 8 years ago

Hi team,

what I am trying to do is move all my index.html to public/ and all other html files to /public/partials folder. My build is fine locally, but when I deploying, getting " [error] 7#7: *14 directory index of "/var/www/" is forbidden". looks like it is trying to access the absolute path. Any hints?

    htmlPages: {
        htmlMin: {
            caseSensitive: false,
            collapseBooleanAttributes: true,
            collapseInlineTagWhitespace: false,
            collapseWhitespace: true,
            conservativeCollapse: false,
            html5: true,
            includeAutoGeneratedTags: false,
            keepClosingSlash: false,
            minifyCSS: true,
            minifyJS: true,
            preserveLineBreaks: false,
            preventAttributesEscaping: false,
            processConditionalComments: true,
            removeAttributeQuotes: true,
            removeComments: true,
            removeEmptyAttributes: true,
            removeOptionalTags: true,
            removeScriptTypeAttributes: true,
            removeStyleLinkTypeAttributes: true,
            sortAttributes: true,
            sortClassName: true
        },
        destination: function(path) {               
            if ( path.includes('/index.html') ) {               
                return "index.html";
            }
            if ( path.includes("/") ) {
                var res = path.split("/");
                return "partials/" + res[res.length-1];
            }
            return path;
        },
        disabled: false
    },
tolyo commented 8 years ago

@RuiWangGit Does it work with default setting? What is your path setting? Take a look a this seed app for a functional example.

muz3 commented 8 years ago

not exactly what I want, your example preserves the old folder structures. The code pasted above worked on my local-dev environment, but not in a deployed environment. It seems access issue. My old solution was to use after-brunch plugin.

tolyo commented 8 years ago

The plugin is intended for such use case.