Skip to content

Commit f4fb07e

Browse files
authored
Merge pull request #87 from jcdcdev/dev/v15
15.0.10
2 parents 78c23c4 + 46c7d58 commit f4fb07e

File tree

5 files changed

+117
-127
lines changed

5 files changed

+117
-127
lines changed

.github/README.md

Lines changed: 43 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,67 @@
11
# jcdcdev.Umbraco.ReadingTime
22

3-
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/jcdcdev.umbraco.readingtime)
4-
[![GitHub License](https://img.shields.io/github/license/jcdcdev/jcdcdev.Umbraco.ReadingTime?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/blob/main/LICENSE)
5-
[![NuGet Downloads](https://img.shields.io/nuget/dt/jcdcdev.Umbraco.ReadingTime?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime/)
3+
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/jcdcdev.Umbraco.ReadingTime)
4+
[![License](https://img.shields.io/github/license/jcdcdev/jcdcdev.Umbraco.ReadingTime?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime?tab=MIT-1-ov-file)
5+
[![NuGet Downloads](https://img.shields.io/nuget/dt/jcdcdev.Umbraco.ReadingTime?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime)
66
[![Project Website](https://img.shields.io/badge/Project%20Website-jcdc.dev-jcdcdev?style=flat&color=3c4834&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIGNsYXNzPSJiaSBiaS1wYy1kaXNwbGF5IiB2aWV3Qm94PSIwIDAgMTYgMTYiPgogIDxwYXRoIGQ9Ik04IDFhMSAxIDAgMCAxIDEtMWg2YTEgMSAwIDAgMSAxIDF2MTRhMSAxIDAgMCAxLTEgMUg5YTEgMSAwIDAgMS0xLTF6bTEgMTMuNWEuNS41IDAgMSAwIDEgMCAuNS41IDAgMCAwLTEgMG0yIDBhLjUuNSAwIDEgMCAxIDAgLjUuNSAwIDAgMC0xIDBNOS41IDFhLjUuNSAwIDAgMCAwIDFoNWEuNS41IDAgMCAwIDAtMXpNOSAzLjVhLjUuNSAwIDAgMCAuNS41aDVhLjUuNSAwIDAgMCAwLTFoLTVhLjUuNSAwIDAgMC0uNS41TTEuNSAyQTEuNSAxLjUgMCAwIDAgMCAzLjV2N0ExLjUgMS41IDAgMCAwIDEuNSAxMkg2djJoLS41YS41LjUgMCAwIDAgMCAxSDd2LTRIMS41YS41LjUgMCAwIDEtLjUtLjV2LTdhLjUuNSAwIDAgMSAuNS0uNUg3VjJ6Ii8+Cjwvc3ZnPg==)](https://jcdc.dev/umbraco-packages/reading-time)
77

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

10-
The following editors are currently supported:
11-
12-
- Rich Text
13-
- Markdown
14-
- Block Grid
15-
- Block List
16-
- Nested Content
17-
- Textstring
9+
Custom Data Type for calculating reading time. With full variant support!
10+
11+
The following editors are currently supported:
12+
13+
- Rich Text
14+
- Markdown
15+
- Block Grid
16+
- Block List
17+
- Nested Content
18+
- Textstring
1819
- Textarea
1920

2021
## Quick Start
2122

22-
1. Install the [NuGet package](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime) in your Umbraco CMS website project.
23-
```
24-
dotnet add package jcdcdev.Umbraco.ReadingTime
25-
```
26-
2. Add the Reading Time data type to a document type. You can configure:
27-
- `Words per minute` (default is 200)
28-
- `Min Unit` (default is Minute)
29-
- `Max Unit` (default is Minute)
30-
![A screenshot of the BackOffice showing Reading Time data type](https://raw.githubusercontent.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/main/docs/screenshots/datatype.png)
31-
3. Save and publish content.
32-
4. Reading Time will display in the backoffice
33-
34-
![A screenshot of the BackOffice showing Reading Time](https://raw.githubusercontent.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/main/docs/screenshots/backoffice.png)
35-
36-
## Using the value in your templates
37-
38-
In your template, you can accessing the Reading Time property value like any other property:
39-
40-
```html
41-
@Model.ReadingTime.DisplayTime()
42-
```
43-
44-
![A screenshot of page showing Reading Time](https://raw.githubusercontent.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/main/docs/screenshots/displaytime.png)
45-
46-
### Overriding the default display
47-
The `DisplayTime` method will format the reading time as a string using [Humanizer](https://github.com/Humanizr/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").
48-
49-
Min and max `TimeUnit` values are derived from the Data Type settings. The below example shows how you can ensure only seconds are displayed.
50-
51-
```csharp
52-
Model.ReadingTime.DisplayTime(minUnit: TimeUnit.Second, maxUnit: TimeUnit.Second)
23+
1. Install the [NuGet package](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime) in your Umbraco CMS website project.
24+
```
25+
dotnet add package jcdcdev.Umbraco.ReadingTime
26+
```
27+
2. Add the Reading Time data type to a document type. You can configure:
28+
- `Words per minute` (default is 200)
29+
- `Min Unit` (default is Minute)
30+
- `Max Unit` (default is Minute)
31+
3. Save and publish content.
32+
4. Reading Time will display in the backoffice
33+
34+
### Using the value in your templates
35+
36+
In your template, you can accessing the Reading Time property value like any other property:
37+
38+
```html
39+
@Model.ReadingTime.DisplayTime()
5340
```
5441

5542
## Configuration
5643

57-
You can change the average words per minute in the data type settings.
58-
44+
You can change the average words per minute in the data type settings.
45+
5946
When creating a new data type, the default will be 200 words per minute.
6047

61-
## Limitations
62-
63-
**Values are derived from published content only.**
64-
65-
Unpublished (saved) content is _not_ included in the calculation.
66-
67-
**Words per minute applies to all variants.**
68-
69-
It is not currently possible to configure words per minute per culture.
70-
7148
## Extending
7249

73-
You can extend the data type to support additional editors by implementing the `IReadingTimeValueProvider` interface.
74-
75-
```csharp
76-
public class MyCustomReadingTimeValueProvider : IReadingTimeValueProvider
77-
{
78-
public bool CanConvert(IPropertyType type)
79-
{
80-
return type.EditorAlias == "MyCustomEditorAlias";
81-
}
82-
83-
public TimeSpan? GetReadingTime(IProperty property, string? culture, string? segment, IEnumerable<string> availableCultures, ReadingTimeConfiguration config)
84-
{
85-
var value = property.GetValue(culture, segment, true);
86-
if (value is string text)
87-
{
88-
return text.GetReadingTime(config.WordsPerMinute);
89-
}
90-
91-
return null;
92-
}
93-
}
50+
The `DisplayTime` method will format the reading time as a string using [Humanizer](https://github.com/Humanizr/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").
51+
52+
Min and max `TimeUnit` values are derived from the Data Type settings. The below example shows how you can ensure only seconds are displayed.
53+
54+
```csharp
55+
Model.ReadingTime.DisplayTime(minUnit: TimeUnit.Second, maxUnit: TimeUnit.Second)
9456
```
9557

96-
Don't forget to register your custom value provider:
58+
## Contributing
9759

98-
```csharp
99-
public class Composer : IComposer
100-
{
101-
public void Compose(IUmbracoBuilder builder)
102-
{
103-
builder.ReadingTimeValueProviders().Append<MyCustomReadingTimeValueProvider>();
104-
}
105-
}
106-
```
60+
Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/contribute) page.
10761

108-
## Contributing
62+
## Acknowledgements (Thanks)
63+
64+
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)
10965

110-
Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/blob/main/.github/CONTRIBUTING.md).
11166

112-
## Acknowledgments (thanks!)
11367

114-
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)

SECURITY.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22

33
## Supported Versions
44

5-
The following table outlines the versions of the project that are currently supported with security updates:
5+
The following table outlines the versions of the project that are currently supported with security & feature updates:
66

7-
| Version | Supported | Umbraco Version |
8-
| ------------------------------------------------------- | --------- | --------------- |
9-
| [15.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v15) || 15 |
10-
| [14.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v14) || 14 |
11-
| [13.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v13) || 13 |
12-
| [10.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v10) || 10 |
13-
| [12.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v12) || 12 |
14-
| [0.1.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/main) || 11 |
7+
> [!NOTE]
8+
> Once a version starts its security phase, it will no longer receive feature updates. Only critical bug fixes and security updates will be provided.
9+
10+
| Package Version | Umbraco Version | Security Phase Start | End of Life |
11+
| ---------------------------------------------------------------------------------- | --------------- | -------------------- | ----------- |
12+
| [10.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v10) | 10 | 2024-06-16 | 2025-06-16 |
13+
| [13.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v13) | 13 | 2025-12-14 | 2026-12-14 |
14+
| [14.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v14) | 14 | 2025-03-02 | 2025-05-30 |
15+
| [15.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v15) | 15 | 2025-08-14 | 2025-11-14 |
16+
## Unsupported Versions
17+
18+
| Package Version | Umbraco Version | End of Life |
19+
| ---------------------------------------------------------------------------------- | --------------- | ----------- |
20+
| [12.x](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/v12) | 12 | 2024-06-29 |
1521

1622

1723
## Future Support
@@ -25,7 +31,7 @@ Project maintainers plan to support all STS (Short-Term Support) and LTS (Long-T
2531

2632
If you discover a vulnerability in this project, please follow one of these steps to report it:
2733

28-
- Create an [issue](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/security/advisories/new)
34+
- Create an [issue](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/security/advisories/new)
2935
- Contact the project author privately at [jcdc.dev/contact](https://jcdc.dev/contact)
3036

3137
### Details
@@ -36,21 +42,21 @@ Include as much information as possible about the vulnerability, including:
3642
- Potential impact
3743
- Any suggested fixes
3844

39-
4045
### Acknowledgment
4146

42-
You will receive an acknowledgment of your report as soon as possible.
47+
You will receive an acknowledgment of your report as soon as possible.
4348

4449
> [!NOTE]
4550
> Response times may vary depending on other commitments.
4651
4752
### Resolution
4853

49-
Once the vulnerability is confirmed, project maintainers will work to resolve it as quickly as possible.
54+
Once the vulnerability is confirmed, project maintainers will work to resolve it as quickly as possible.
5055

51-
You will be notified once the issue has been resolved or rejected.
56+
You will be notified once the issue has been resolved or rejected.
5257

5358
> [!TIP]
5459
> If the vulnerability is accepted, you will receive credit in the release notes.
5560
5661
Thank you for helping to keep this project secure!
62+

docs/README_nuget.md

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
11
# jcdcdev.Umbraco.ReadingTime
22

3-
[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/tree/main?tab=readme-ov-file#quick-start)
4-
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/jcdcdev.umbraco.readingtime)
5-
[![GitHub License](https://img.shields.io/github/license/jcdcdev/jcdcdev.Umbraco.ReadingTime?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/blob/main/LICENSE)
6-
[![NuGet Downloads](https://img.shields.io/nuget/dt/jcdcdev.Umbraco.ReadingTime?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime/)
3+
[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/#quick-start)
4+
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/jcdcdev.Umbraco.ReadingTime)
5+
[![License](https://img.shields.io/github/license/jcdcdev/jcdcdev.Umbraco.ReadingTime?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime?tab=MIT-1-ov-file)
6+
[![NuGet Downloads](https://img.shields.io/nuget/dt/jcdcdev.Umbraco.ReadingTime?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime)
77
[![Project Website](https://img.shields.io/badge/Project%20Website-jcdc.dev-jcdcdev?style=flat&color=3c4834&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIGNsYXNzPSJiaSBiaS1wYy1kaXNwbGF5IiB2aWV3Qm94PSIwIDAgMTYgMTYiPgogIDxwYXRoIGQ9Ik04IDFhMSAxIDAgMCAxIDEtMWg2YTEgMSAwIDAgMSAxIDF2MTRhMSAxIDAgMCAxLTEgMUg5YTEgMSAwIDAgMS0xLTF6bTEgMTMuNWEuNS41IDAgMSAwIDEgMCAuNS41IDAgMCAwLTEgMG0yIDBhLjUuNSAwIDEgMCAxIDAgLjUuNSAwIDAgMC0xIDBNOS41IDFhLjUuNSAwIDAgMCAwIDFoNWEuNS41IDAgMCAwIDAtMXpNOSAzLjVhLjUuNSAwIDAgMCAuNS41aDVhLjUuNSAwIDAgMCAwLTFoLTVhLjUuNSAwIDAgMC0uNS41TTEuNSAyQTEuNSAxLjUgMCAwIDAgMCAzLjV2N0ExLjUgMS41IDAgMCAwIDEuNSAxMkg2djJoLS41YS41LjUgMCAwIDAgMCAxSDd2LTRIMS41YS41LjUgMCAwIDEtLjUtLjV2LTdhLjUuNSAwIDAgMSAuNS0uNUg3VjJ6Ii8+Cjwvc3ZnPg==)](https://jcdc.dev/umbraco-packages/reading-time)
88

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

11-
The following editors are currently supported:
12-
13-
- Rich Text
14-
- Markdown
15-
- Block Grid
16-
- Block List
17-
- Nested Content
18-
- Textstring
10+
Custom Data Type for calculating reading time. With full variant support!
11+
12+
The following editors are currently supported:
13+
14+
- Rich Text
15+
- Markdown
16+
- Block Grid
17+
- Block List
18+
- Nested Content
19+
- Textstring
1920
- Textarea
2021

22+
## Quick Start
23+
24+
1. Install the [NuGet package](https://www.nuget.org/packages/jcdcdev.Umbraco.ReadingTime) in your Umbraco CMS website project.
25+
```
26+
dotnet add package jcdcdev.Umbraco.ReadingTime
27+
```
28+
2. Add the Reading Time data type to a document type. You can configure:
29+
- `Words per minute` (default is 200)
30+
- `Min Unit` (default is Minute)
31+
- `Max Unit` (default is Minute)
32+
3. Save and publish content.
33+
4. Reading Time will display in the backoffice
34+
35+
### Using the value in your templates
36+
37+
In your template, you can accessing the Reading Time property value like any other property:
38+
39+
```html
40+
@Model.ReadingTime.DisplayTime()
41+
```
42+
43+
## Configuration
44+
45+
You can change the average words per minute in the data type settings.
46+
47+
When creating a new data type, the default will be 200 words per minute.
48+
2149
## Contributing
2250

23-
Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/blob/main/.github/CONTRIBUTING.md).
51+
Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/contribute) page.
52+
53+
## Acknowledgements (Thanks)
54+
55+
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)
56+
2457

25-
## Acknowledgments (thanks!)
2658

27-
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)

src/jcdcdev.Umbraco.ReadingTime.Client/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jcdcdev.Umbraco.ReadingTime.Client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@hey-api/openapi-ts": "^0.66.5",
1717
"@umbraco-cms/backoffice": "^15.3.1",
1818
"typescript": "^5.8.3",
19-
"vite": "^6.3.2"
19+
"vite": "^6.3.4"
2020
},
2121
"volta": {
2222
"node": "22.14.0"

0 commit comments

Comments
 (0)