jcdcdev.Umbraco.ReadingTime 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package jcdcdev.Umbraco.ReadingTime --version 0.3.0
                    
NuGet\Install-Package jcdcdev.Umbraco.ReadingTime -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="jcdcdev.Umbraco.ReadingTime" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="jcdcdev.Umbraco.ReadingTime" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="jcdcdev.Umbraco.ReadingTime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add jcdcdev.Umbraco.ReadingTime --version 0.3.0
                    
#r "nuget: jcdcdev.Umbraco.ReadingTime, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package jcdcdev.Umbraco.ReadingTime@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=jcdcdev.Umbraco.ReadingTime&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=jcdcdev.Umbraco.ReadingTime&version=0.3.0
                    
Install as a Cake Tool

jcdcdev.Umbraco.ReadingTime

Umbraco Version NuGet GitHub license Downloads

Custom Data Type for calculating reading time. With full variant support!

The following editors are currently supported:

  • Rich Text
  • Markdown
  • Block Grid
  • Block List
  • Nested Content
  • Textstring
  • Textarea

Quick Start

  1. Install the NuGet package in your Umbraco CMS website project.

     dotnet add package jcdcdev.Umbraco.ReadingTime
    
  2. Add the Reading Time data type to a document type. You can configure:

    • Words per minute (default is 200)
    • Min Unit (default is Minute)
    • Max Unit (default is Minute) A screenshot of the BackOffice showing Reading Time data type
  3. Save and publish content.

  4. Reading Time will display in the backoffice

    A screenshot of the BackOffice showing Reading Time

Using the value in your templates

In your template, you can accessing the Reading Time property value like any other property:

 @Model.ReadingTime.DisplayTime()

A screenshot of page showing Reading Time

Overriding the default display

The DisplayTime method will format the reading time as a string using Humanizer. This supports variants, meaning the reading time will be displayed based on the pluralisation rules of the current culture (e.g. "1 minute", "2 minutes", "0 minuter").

Min and max TimeUnit values are derived from the Data Type settings. The below example shows how you can ensure only seconds are displayed.

 Model.ReadingTime.DisplayTime(minUnit: TimeUnit.Second, maxUnit: TimeUnit.Second)

Configuration

You can change the average words per minute in the data type settings.

When creating a new data type, the default will be 200 words per minute. To change this default, adjust your appsettings.json file:

{
  "ReadingTime": {
    "WordsPerMinute": 200
  }
}

Limitations

Values are derived from published content only.

Draft content is not included in the calculation.

Words per minute applies to all variants.

It is not currently possible to configure words per minute per culture.

Extending

You can extend the data type to support additional editors by implementing the IReadingTimeValueProvider interface.

public class MyCustomReadingTimeValueProvider : IReadingTimeValueProvider
{
    public bool CanConvert(IPropertyType type)
    {
        return type.EditorAlias == "MyCustomEditorAlias";
    }

    public TimeSpan? GetReadingTime(IProperty property, string? culture, string? segment, IEnumerable<string> availableCultures, ReadingTimeConfiguration config)
    {
        var value = property.GetValue(culture, segment, true);
        if (value is string text)
        {
            return text.GetReadingTime(config.WordsPerMinute);
        }

        return null;
     }
 }

Don't forget to register your custom value provider:

public class Composer : IComposer
{
    public void Compose(IUmbracoBuilder builder)
    {
        builder.ReadingTimeValueProviders().Append<MyCustomReadingTimeValueProvider>();
    }
}

Contributing

Contributions to this package are most welcome! Please read the Contributing Guidelines.

Acknowledgments (thanks!)

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
16.0.2 214 9/13/2025
16.0.2-alpha0031 136 9/13/2025
16.0.2-alpha0020 141 9/6/2025
16.0.2-alpha0011 131 9/6/2025
16.0.2-alpha0003 173 8/10/2025
16.0.1 199 7/27/2025
16.0.1-alpha0009 162 7/9/2025
16.0.0 505 6/12/2025
16.0.0-alpha0008 322 6/12/2025
16.0.0-alpha0005 308 6/10/2025
16.0.0-alpha0002 222 5/11/2025
15.0.16 245 9/15/2025
15.0.16-alpha0003 213 9/14/2025
15.0.15 156 9/13/2025
15.0.15-alpha0023 133 9/6/2025
15.0.15-alpha0014 133 9/6/2025
15.0.15-alpha0006 134 9/6/2025
15.0.14 139 7/27/2025
15.0.14-alpha0003 161 7/16/2025
15.0.13 169 7/3/2025
15.0.13-alpha0003 128 6/22/2025
15.0.12 218 6/16/2025
15.0.12-alpha0007 167 6/16/2025
15.0.12-alpha0001 168 6/3/2025
15.0.11 169 6/1/2025
15.0.11-alpha0017 173 6/1/2025
15.0.11-alpha0009 162 6/1/2025
15.0.11-alpha0003 172 5/27/2025
15.0.10 235 5/11/2025
15.0.10-alpha0011 171 5/8/2025
15.0.9 249 4/22/2025
15.0.9-alpha0003 193 4/21/2025
15.0.8 193 4/18/2025
15.0.8-alpha0008 271 4/13/2025
15.0.8-alpha0003 179 4/6/2025
15.0.7 250 3/30/2025
15.0.7-alpha0019 160 3/30/2025
15.0.7-alpha0010 178 3/23/2025
15.0.7-alpha0008 182 3/23/2025
15.0.7-alpha0003 175 3/18/2025
15.0.6 222 3/12/2025
15.0.6-alpha0003 193 3/10/2025
15.0.5 236 3/7/2025
15.0.5-alpha0003 230 3/4/2025
15.0.4 185 3/3/2025
15.0.4-alpha0003 134 2/24/2025
15.0.3 142 2/19/2025
15.0.3-alpha0005 117 2/16/2025
15.0.3-alpha0003 115 2/16/2025
15.0.2 123 2/13/2025
15.0.2-alpha0004 129 2/10/2025
15.0.1 137 2/7/2025
15.0.1-alpha0005 118 2/6/2025
15.0.0 210 11/19/2024
15.0.0-alpha0012 121 11/17/2024
15.0.0-alpha0010 124 11/12/2024
15.0.0-alpha0006 108 10/23/2024
15.0.0-alpha0004 113 10/17/2024
15.0.0-alpha0003 96 10/17/2024
15.0.0-alpha0001 141 10/9/2024
14.0.6 177 6/1/2025
14.0.6-alpha0015 162 5/27/2025
14.0.6-alpha0006 161 5/8/2025
14.0.5 180 4/22/2025
14.0.5-alpha0005 194 4/22/2025
14.0.4 216 10/8/2024
14.0.4-alpha0003 103 10/31/2024
14.0.3 137 9/27/2024
14.0.3-alpha0013 115 9/26/2024
14.0.2 144 9/23/2024
14.0.2-alpha0005 126 9/22/2024
14.0.1 177 7/4/2024
14.0.1-alpha0010 125 7/1/2024
14.0.1-alpha0003 116 6/24/2024
14.0.0 162 6/6/2024
14.0.0-alpha0008 136 6/6/2024
14.0.0-alpha0005 137 6/6/2024
14.0.0-alpha0003 137 6/4/2024
14.0.0-alpha0001 127 5/25/2024
13.0.7 532 8/12/2025
13.0.7-alpha0003 162 8/10/2025
13.0.6 140 7/27/2025
13.0.6-alpha0009 159 7/16/2025
13.0.5 343 6/12/2025
13.0.5-alpha0013 145 6/3/2025
13.0.5-alpha0006 238 5/12/2025
13.0.4 723 4/23/2025
13.0.4-alpha0002 186 4/21/2025
13.0.3 437 3/30/2025
13.0.3-alpha0003 159 3/18/2025
13.0.2 3,036 10/28/2024
13.0.2-alpha0008 118 10/23/2024
13.0.1 1,653 5/25/2024
13.0.0 164 5/25/2024
13.0.0-alpha0001 130 5/25/2024
12.0.2 186 6/16/2025
12.0.1 145 5/25/2024
12.0.0 128 5/25/2024
12.0.0-alpha0001 137 5/25/2024
10.0.5 298 6/12/2025
10.0.5-alpha0015 161 6/2/2025
10.0.5-alpha0007 245 5/12/2025
10.0.4 191 3/30/2025
10.0.4-alpha0003 162 3/30/2025
10.0.3 127 1/29/2025
10.0.2 147 10/28/2024
10.0.2-alpha0030 119 10/23/2024
10.0.2-alpha0018 150 9/29/2024
10.0.2-alpha0008 118 9/29/2024
10.0.1 173 5/25/2024
10.0.0 139 5/25/2024
10.0.0-alpha0001 144 5/25/2024
0.3.1 966 4/5/2024
0.3.0 194 4/2/2024
0.2.0 189 3/31/2024
0.1.1 641 1/8/2024
0.1.0 172 1/8/2024