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 reading time: #209

Merged
merged 3 commits into from
Apr 8, 2020
Merged

Add reading time: #209

merged 3 commits into from
Apr 8, 2020

Conversation

alexearnshaw
Copy link
Contributor

@alexearnshaw alexearnshaw commented Feb 19, 2020

This PR fixes #122

This is what I've changed:

I've gone for a more minimal look than the one proposed in the discussion on #122, and am showing only minutes (not seconds). I'm also using the build in Hugo variable for reading time instead of calculating it manually.

There is one issue with this PR in that the reading time is not appearing on the index pages but only on all other pages.

E.g. it appears fine on https://deploy-preview-209--docsydocs.netlify.com/docs/adding-content/content/ but not on https://deploy-preview-209--docsydocs.netlify.com/docs/getting-started/

I've implemented this in the same way as the feedback widget (which appears on all doc pages) so can't understand why this is not showing on all pages?

* Add new reading time partial
* Add conditional block for reading time in content layout
* Add new config param in userguide config.toml
* Remove reading time from specific page using front matter field
@LisaFC
Copy link
Collaborator

LisaFC commented Feb 19, 2020

Thanks so much for doing this! I'll take a look when I have a few spare moments and see if I can figure out why it's not showing up on indexes.

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 8, 2020

Sorry for the enormous delay, I've finally had a chance to look at this properly - the reason why the index pages don't have the update is because they use the docs/list layout rather than the one you updated. I'll see if I can fix it for you!

@LisaFC
Copy link
Collaborator

LisaFC commented Apr 8, 2020

This is great! I'm going to merge it in now so we have it, though I'll need to update the config file on the example project as well so it has the same parameter. Do we think it should be switched on or off by default I wonder?

We'll also need to update the docs...

@LisaFC LisaFC merged commit 9768a66 into google:master Apr 8, 2020
@alexearnshaw alexearnshaw deleted the readingtime branch April 15, 2020 11:13
@alexearnshaw
Copy link
Contributor Author

Thanks for getting this to work properly and merging it :) I think the property should be off by default.

@frodriguezsmartclip
Copy link

@LisaFC I think, in my opinion, enabled by default because it's a nice feature to show it up...

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.

Add Reading Time support
3 participants