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

word_count and reading_time count the footnotes #2690

Open
liavhibe opened this issue Nov 7, 2024 · 1 comment
Open

word_count and reading_time count the footnotes #2690

liavhibe opened this issue Nov 7, 2024 · 1 comment
Labels

Comments

@liavhibe
Copy link

liavhibe commented Nov 7, 2024

Bug Report

Environment

Zola version: 0.19.2

Expected Behavior

word_count and reading_time should not count footnotes.

Current Behavior

word_count and reading_time count the footnotes.

Step to reproduce

create a page then add and remove some footnotes, you'll see the change in the output for both functions.

@Keats Keats added the bug label Nov 7, 2024
@vilhelmgray
Copy link

let (word_count, reading_time) = get_reading_analytics(&page.raw_content);

Currently, the reading analytics are derived from page.raw_content which is all content (including footnotes). In order to get the word count for just the main content, the footnotes will need to be differentiated from the rest of the contents in raw_content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants