Skip to content

Commit e225cfe

Browse files
authored
Merge pull request #20 from jcdcdev/dev/v14
feature: v14 support (WIP)
2 parents 9acf6b6 + f677f4f commit e225cfe

File tree

397 files changed

+10784
-17559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

397 files changed

+10784
-17559
lines changed

.github/README.md

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

3-
[![Umbraco Version](https://img.shields.io/badge/Umbraco-10.4+-%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)](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=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+
[![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/)
66

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

@@ -51,27 +51,17 @@ Min and max `TimeUnit` values are derived from the Data Type settings. The below
5151
Model.ReadingTime.DisplayTime(minUnit: TimeUnit.Second, maxUnit: TimeUnit.Second)
5252
```
5353

54-
55-
5654
## Configuration
5755

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

60-
When creating a new data type, the default will be 200 words per minute. To change this default, adjust your `appsettings.json` file:
61-
62-
```json
63-
{
64-
"ReadingTime": {
65-
"WordsPerMinute": 200
66-
}
67-
}
68-
```
58+
When creating a new data type, the default will be 200 words per minute.
6959

7060
## Limitations
7161

7262
**Values are derived from published content only.**
7363

74-
Draft content is _not_ included in the calculation.
64+
Unpublished (saved) content is _not_ included in the calculation.
7565

7666
**Words per minute applies to all variants.**
7767

@@ -116,7 +106,7 @@ public class Composer : IComposer
116106

117107
## Contributing
118108

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

121111
## Acknowledgments (thanks!)
122112

.github/workflows/build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ jobs:
77
metadata:
88
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main
99
build:
10-
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main
10+
runs-on: ubuntu-latest
1111
needs:
1212
- metadata
13-
with:
14-
project-name: ${{ needs.metadata.outputs.project-name }}
15-
project-path: ${{ needs.metadata.outputs.project-path }}
13+
steps:
14+
- name: Build
15+
uses: jcdcdev/jcdcdev.Umbraco.Github.Build@main
16+
with:
17+
project-name: ${{ needs.metadata.outputs.project-name}}
18+
project-path: ${{ needs.metadata.outputs.project-path }}
19+
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }}
20+
npm-enabled: true
21+
umbraco-version: 14

.github/workflows/release.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
name: 🚀 Release
22
on:
33
workflow_dispatch:
4+
pull_request:
5+
types: [ closed ]
46
jobs:
57
metadata:
6-
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main
7-
build:
8-
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main
9-
needs:
10-
- metadata
11-
with:
12-
project-name: ${{ needs.metadata.outputs.project-name}}
13-
project-path: ${{ needs.metadata.outputs.project-path }}
8+
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@dev
149
release:
15-
needs:
16-
- build
10+
runs-on: ubuntu-latest
1711
permissions:
1812
contents: write
19-
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/release-template.yml@main
20-
with:
21-
artifact-name: ${{ needs.build.outputs.artifact-name }}
22-
version: ${{ needs.build.outputs.version }}
23-
secrets:
24-
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
13+
needs:
14+
- metadata
15+
steps:
16+
- name: Build
17+
id: build
18+
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Build@main
19+
with:
20+
project-name: ${{ needs.metadata.outputs.project-name}}
21+
project-path: ${{ needs.metadata.outputs.project-path }}
22+
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }}
23+
npm-enabled: true
24+
umbraco-version: 14
25+
- name: Release
26+
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Release@main
27+
with:
28+
artifact-name: ${{ steps.build.outputs.artifact-name }}
29+
version: ${{ steps.build.outputs.version }}
30+
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: 🔃 Sync branches
2+
3+
on:
4+
push:
5+
branches:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
check-branch:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
is-valid-branch: ${{ steps.branch_check.outputs.is-valid-branch }}
14+
steps:
15+
- name: Check if branch name starts with 'v'
16+
id: branch_check
17+
run: |
18+
BRANCH_NAME=${{ github.ref }}
19+
if [[ $BRANCH_NAME =~ refs/heads/v.* ]]; then
20+
VALID=true
21+
else
22+
VALID=false
23+
fi
24+
25+
echo "is-valid-branch=$VALID" >> $GITHUB_OUTPUT
26+
merge-branches:
27+
needs: check-branch
28+
permissions:
29+
contents: write
30+
if: needs.check-branch.outputs.is-valid-branch == 'true'
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
- name: Merge into dev/v**
38+
run: |
39+
# Extract the version number from the branch name
40+
VERSION=$(echo "${GITHUB_REF}" | sed -n 's#refs/heads/v\([0-9]\+\)#\1#p')
41+
SOURCE_BRANCH="v${VERSION}"
42+
TARGET_BRANCH="dev/v${VERSION}"
43+
# Set git config
44+
git config user.name "${{ github.actor }}"
45+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
46+
47+
48+
echo "Merging $SOURCE_BRANCH into $TARGET_BRANCH"
49+
50+
# Checkout the source branch
51+
git checkout $SOURCE_BRANCH
52+
git pull origin $SOURCE_BRANCH
53+
echo "Pulled latest for $SOURCE_BRANCH"
54+
55+
# Merge into the target branch
56+
git checkout $TARGET_BRANCH
57+
git merge --no-ff $SOURCE_BRANCH -m "Merge v$VERSION into dev/v$VERSION"
58+
echo "Merged $SOURCE_BRANCH into $TARGET_BRANCH"
59+
60+
# Push changes
61+
git push origin $TARGET_BRANCH
62+
echo "Pushed changes to $TARGET_BRANCH"
63+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,3 +358,4 @@ src/.idea
358358
.idea/
359359
*.csproj.DotSettings
360360
**/umbraco/Data/TEMP/
361+
/src/jcdcdev.Umbraco.ReadingTime/wwwroot/App_Plugins/jcdcdev.Umbraco.ReadingTime/dist/

docs/README_nuget.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# jcdcdev.Umbraco.ReadingTime
2+
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/)
7+
8+
Custom Data Type for calculating reading time. With full variant support!
9+
10+
The following editors are currently supported:
11+
12+
- Rich Text
13+
- Markdown
14+
- Block Grid
15+
- Block List
16+
- Nested Content
17+
- Textstring
18+
- Textarea
19+
20+
## Contributing
21+
22+
Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/jcdcdev.Umbraco.ReadingTime/blob/main/.github/CONTRIBUTING.md).
23+
24+
## Acknowledgments (thanks!)
25+
26+
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)

src/TestSite.10/Composer.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/TestSite.10/Program.cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/TestSite.10/Properties/launchSettings.json

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/TestSite.10/Startup.cs

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)