craft-plugins/reading-time 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

craft-plugins/reading-time

最新稳定版本:1.1.0

Composer 安装命令:

composer require craft-plugins/reading-time

包简介

Reading Time plugin shows the estimated reading time of the content, in seconds or minutes.

README 文档

README

License MIT GitHub Repo stars GitHub forks Hits of Code

Reading Time plugin shows the estimated reading time of the content, in seconds or minutes.

Requirements

  • Craft CMS: ^4.0
  • PHP: ^8.0

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

    cd /path/to/project
    
  2. In your terminal run composer require awilum/craft-reading-time.

  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Reading Time.

Usage

Display reading time in the twig templates:

{{ readingTime('Some text here ...') }}

Display reading time with custom translates in the twig templates:

{{ readingTime('Some text here ...', {
                'minute': 'Minute',
                'minutes': 'Minutes',
                'second':  'Second',
                'seconds': 'Seconds'
                }) }}

Display reading time with custom translates and format in the twig templates:

{{ readingTime('Some text here ...', {
                'minute': 'Minute',
                'minutes': 'Minutes',
                'second':  'Second',
                'seconds': 'Seconds',
                'format': '[minutes_count] [minutes_label] – [seconds_count] [seconds_label]'
                }) }}

Display reading time with custom translates and format that with alternative format that hides the minutes and seconds label in the twig templates

{{ readingTime('Some text here ...', {
                'minute': 'Minute',
                'minutes': 'Minutes',
                'second':  'Second',
                'seconds': 'Seconds',
                'format': '[minutes_count] [minutes_label] – [seconds_count] [seconds_label]'
                }) }}

Also you can use readingTime filter in your twig templates:

{{ 'Some text here ...'|readingTime }}

Use readingTime function in the PHP:

use function Awilum\CraftReadingTime\readingTime;

echo readingTime('Some text here ...');

LICENSE

The MIT License (MIT) Copyright (c) Sergey Romanenko

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固