Embedding html comments while using kramdown, jekyll and github
I use github, github-pages, kramdown and jekyll to publish my static sites.
I need to embed html comments that are visible when viewing the source of a page. The reason for this that I want to be able to visually use comments to differentiate between the different parts of raw source html markup. This is doable by using regular html syntax:
<!-- here's my comment -->
The problem I've encountered is that while I serve my jekyll site locally I do see comments in the page source, but once pushed to my github repository the comment isn't visible anymore. However it's still visible in my repo when viewing the raw markdown source file.
The behavior I expect would be seeing my comment in the page source code like I do locally. I've tried kramdown comment syntax:
{::comment}
here's my comment
{:/comment}
This works but this way I don't see it in the page source at all. Another solution I've tried is the workaround described in this response. It works but it produces an actual html tag and therefore any clear separation between the comment and the other html tags is lost.
The bottom-line is that I want to see the comment when viewing my page source even after pushing my files to my repository.
Is there something I'm missing here or isn't it possible to keep html comments intact while used in conjunction with github-pages?
EDIT: Turns out it was not a markup or Github problem after all. I use a CDN service, this minified the HTML and stripped away HTML comments.
请检查GitHub上没有运行“HTML Minification”,它可能实际上删除了评论,同时提供节省的带宽。
链接地址: http://www.djcxy.com/p/20160.html