def is_hidden(file_path):
    """Returns true if the file should not be uploaded to the site.

    A file is hidden if its name or the name of any parent directory
    begins with an underscore.  For example, these files are not
    published to the site, even if they appear in a content source
    directory:
      /foo/bar/_baz.dat
      /foo/_templates/base.html

    Args:
      file_path: The filesystem path for the file.
    """
    hidden_parts = [p for p in file_path.split('/') if p.startswith('_')]
    return len(hidden_parts) > 0