mauricerenck / ratepage
让您的访客对页面进行评分
Requires
- getkirby/composer-installer: ^1.1
- phpunit/phpunit: ^9.4
Requires (Dev)
- getkirby/cms: ^3.5
This package is auto-updated.
Last update: 2024-09-05 23:28:02 UTC
README
一个支持webmention的Kirby评分插件
由于我没有更多时间,我在寻找愿意接替这个插件开发的人
页面评分插件。无需页面刷新即可工作,并可以接收webmention。附带所有评分的漂亮面板概览。
如果您喜欢没有javascript和webmention的插件,请查看 https://getkirby.com/plugins/medienbaecker/likes
安装
composer require mauricerenck/ratepage
- 将 master.zip 解压到
site/plugins/ratepage
git submodule add https://github.com/mauricerenck/rate-page.git site/plugins/ratepage
配置
在config.php中添加您自己的表情符号或html代码
[
'thumb-up-symbol' => '👍',
'thumb-down-symbol' => '👎',
'enable-webmention-support' => false,
'stars.symbol-empty' => '🌑',
'stars.round' => true,
'stars.showAvg' => true,
]
请确保所有选项都以前缀mauricerenck.ratePage.
开始。例如,调试选项应在您的config.php
中设置如下:'mauricerenck.komments.debug' => true
您可以在配置中启用webmention支持。这样做时,您还必须安装我的webmention插件(https://github.com/mauricerenck/tratschtante)。然后您可以使用像brid.gy/这样的服务将您的twitter或mastodon账户连接到webmentions.io。当有人喜欢您相关的tweet时,该like也将作为积极的页面评分添加。
用法
五星评分
在您的模板中,只需加载片段
<?php snippet('star-rating'); ?>
在<head />
中使用插件css或编写自己的。 <?php echo css('/media/plugins/mauricerenck/ratePage/stars.css'); ?>
要修改星星的样式,请查看assets/stars.css
。您可以在自己的css中覆盖以下行以添加自己的样式
.rate-page__stars .rating > span.checked:before {
content: "🌕";
}
.rate-page__stars .rating > span.half:before {
content: "🌗";
}
.rate-page__stars .rating > span.fquarter:before {
content: "🌘";
}
.rate-page__stars .rating > span.lquarter:before {
content: "🌖";
}
.rate-page__stars .rating > span.user:before {
content: "🌎";
}
.rate-page__stars .rating > span:hover:before,
.rate-page__stars .rating > span:hover ~ span:before {
content: "🌎";
}
点赞/踩
在您的模板中,只需加载片段
<?php snippet('thumb-rating'); ?>
在<head />
中使用插件css或编写自己的。 <?php echo css('/media/plugins/mauricerenck/ratePage/thumbs.css'); ?>
未来计划
- json-ld输出
- 面板字段