Search code examples
hugonetlify

Fixing 'Invalid Filename' Deploy Error in Hugo


I've deployed my Hugo website using Netlify, but after my latest changes I keep getting the same error that is as follows:

Failed during stage 'deploying site': Invalid filename 'tags/c#/page/1/index.html'. Deployed filenames cannot contain # or ? characters

I can't find any file in my repository that contains such a path and my index.html doesn't contain any of those invalid characters either. I have attempted to revert the changes but I still receive the same deployment error.

Where should I be looking in my repo files to diagnose this problem?


Solution

  • That is pointing to an auto-generated file that lists those pages that have 'C#' as a tag in the front matter. So look for pages that have something like:

    tags: [ 'C#']
    

    in it.

    In order fix, you will need to change the tag to 'c-sharp' or something similar.

    Or - check that preserveTaxonomyNames is not in your site.yml (or is set to false).