Skip to content

How to remove comments from generated HTML #2756

@askyx

Description

@askyx

Question

I have some comments in md files like this <!-- some content -->,this comments will output to generated HTML, If someone looks at the source code of the webpage they will see the comments too.

Is there a way to ignore comments completely while generating the html pages?

addtional, hugo use --minify to support this
https://discourse.gohugo.io/t/adding-comments-in-a-blog-post-in-a-way-that-it-is-not-added-to-the-generated-html/52677

Version


Metadata

Metadata

Assignees

No one assigned

    Labels

    C-questionCategory: A question on how to do something

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions