nielsnicola/kirby-hide-html-comments
最新稳定版本:1.0.0
Composer 安装命令:
composer require nielsnicola/kirby-hide-html-comments
包简介
Hide HTML comments in Kirby output
README 文档
README
Hide or show HTML comments in your Kirby templates using a simple helper function: comment().
Installation
Composer
composer require nielsnicola/kirby-hide-html-comments
Git submodule
git submodule add https://github.com/nielsnicola/kirby-hide-html-comments.git site/plugins/kirby-hide-html-comments
Manual installation
Download this repository and place it in:
site/plugins/kirby-hide-html-comments
Options
Add one config option to control the output of HTML comments:
| Option | Default | Description |
|---|---|---|
nielsnicola.hide-html-comments.enabled |
true |
true hides all comments; false shows comments in the DOM |
Usage
Once installed, you can use the global comment() helper in any template:
<?php comment('Hero section starts'); ?> // <div class="hero"> ... </div> <?php comment('Hero section ends'); ?>
Config example
// site/config/config.php return [ 'nielsnicola.hide-html-comments.enabled' => true, // Set to false to show HTML comments ];
- When
enabledistrue,comment()outputs nothing - When
enabledis false,comment()outputs standard HTML comments in the DOM.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-11-25