question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve the word count Tag helper to include images.

See original GitHub issue

The <post-read-time /> TagHelper is used to calculate the number of minutes we guess it will take to read the article. This calculation uses a simple arithmetic around the number of words Post.Content.

There is a hypothesis that suggests we should also include 30 seconds per image in the post.

The task here is to find the number of images in Post.Content and add it to the number of minutes calculated on line 24 in the following TagHelper:

\source\DasBlog.Web.UI\TagHelpers\Post\PostReadTimeTagHelper.cs

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tsdamascommented, Apr 8, 2022

Hey @poppastring

Thank you very much for clarifying! I believe I got into a possible solution.

I will do a PR for your review.

1reaction
tsdamascommented, Mar 29, 2022

Thanks @poppastring!!

As I said, I am pretty new in C#, so I think I might have a solution. But I would like to check with you first, if I am in the right path, if possible: var images = dasBlogSettings.Post.Content.HtmlTagContext(img).Count(); var imgMinutes = images*30/60;

Thank you in advance, Thais

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pick path in Tag Helper attribute
Lets say I want to create a custom ImageTagHelper, which loads the image name from a database field and generates an IMG. As...
Read more >
Solved: Using power automate to tag images uploaded into s...
Hello everyone. I already have the AI builder models. And need to build a flow that tags images uploaded into sharepoint using the...
Read more >
Kentico Xperience 13 Beta 3 - Page Builder Tag Helpers in ...
The attributes of the Tag Helper element are being assigned C# expressions, the expressions are longer in character count, and there is more ......
Read more >
Handlebars Helpers Reference
Handlebars Helpers Reference. This article is a reference for Stencil supported Handlebars (opens in a new tab) helpers. It includes custom helpers ......
Read more >
Advanced configuration
helper_image, (Advanced) The default helper image used to clone repositories and upload artifacts. helper_image_flavor, Sets the helper image flavor ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found