Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to add word count to metadata. Closes #735 #740

Merged
merged 1 commit into from
Jan 21, 2022
Merged

Add option to add word count to metadata. Closes #735 #740

merged 1 commit into from
Jan 21, 2022

Conversation

thiagowfx
Copy link
Contributor

Reading time is subjective and relative. Word count is absolute and a
more reliable and traditional proxy to estimate how long a post is. It's
not perfect, and there are variations across languages, hence an option
would leave it to users to decide whether it's relevant to their use
cases.

Introduce a ShowWordCount option and use it in post_meta.html.

Hugo supports word counts natively, c.f.
https://gohugo.io/variables/page/#page-variables

What does this PR change? What problem does it solve?

c.f. commit description above

Was the change discussed in an issue or in the Discussions before?

See #735

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended. --> tested on my blog with 'en' and 'pt', verified it works as expected
  • [N/A] This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

Reading time is subjective and relative. Word count is absolute and a
more reliable and traditional proxy to estimate how long a post is. It's
not perfect, and there are variations across languages, hence an option
would leave it to users to decide whether it's relevant to their use
cases.

Introduce a ShowWordCount option and use it in post_meta.html.

Hugo supports word counts natively, c.f.
https://gohugo.io/variables/page/#page-variables
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thiagowfx
Copy link
Contributor Author

Notes:

  • I only added translations that I am confident to be correct. If you'd like I could add them all with google translate but I wouldn't be sure whether they are accurate.
  • I couldn't find anywhere to document this option in. If there's a suitable to do so let me know, happy to send docs alongside this PR.

Copy link
Owner

@adityatelange adityatelange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thiagowfx!

@adityatelange adityatelange merged commit b0ab8ea into adityatelange:master Jan 21, 2022
@adityatelange adityatelange linked an issue Jan 21, 2022 that may be closed by this pull request
thiagowfx added a commit to thiagowfx/thiagowfx.github.io that referenced this pull request Jan 22, 2022
kylethedeveloper pushed a commit to kylethedeveloper/hugo-PaperMod that referenced this pull request Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR: Add option to add Word Count to metadata
2 participants