Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

New boolean param for user to choose to hide empty stats #176

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

RyanTG
Copy link
Contributor

@RyanTG RyanTG commented Jul 27, 2020

Description

Adds logic to the stats file to hide stats, based on user preference, when two conditions are met: user prefers to hide them, and they are empty.

This logic had to be more complex (or busy-looking) than I originally envisioned. But this is the best I could come up with. The logic is way simpler when you simply enable this functionality, without giving the user a choice.

Motivation and Context

Currently, If a Tag or Category isn't populated, the icon is displayed and it says "None". This seems like noise to me. This PR gives the user the choice to hide the icon and text if none.

Checklist:

  • I have updated the documentation, as applicable.
  • I have updated the theme.toml, as applicable.

I updated the exampleSite config, and I included a comment describing it. If that is not preferable, I can remove the comment and add the text to the wiki.

exampleSite/config.toml Outdated Show resolved Hide resolved
layouts/_default/stats.html Outdated Show resolved Hide resolved
@RyanTG
Copy link
Contributor Author

RyanTG commented Aug 2, 2020

Ah, yes. Thanks, that logic is much more... logical. I should have seen that, considering how long I spent looking at it.

Your markup was missing the initial if, and we still need the whole range jive. Now it works!

Wiki entry:

hideEmptyStats
Hides the "Category" and/or "Tag" icon on a post, if neither is defined for that post.

layouts/_default/stats.html Outdated Show resolved Hide resolved
layouts/_default/stats.html Outdated Show resolved Hide resolved
@RyanTG
Copy link
Contributor Author

RyanTG commented Aug 3, 2020

It did not work. But I can try to investigate why it didn’t.

Copy link
Owner

@pacollins pacollins left a comment

Choose a reason for hiding this comment

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

Once I get final approval from @RyanTG, I will go ahead and merge this.

@RyanTG
Copy link
Contributor Author

RyanTG commented Aug 4, 2020

Once I get final approval from @RyanTG, I will go ahead and merge this.

I approve. Is that a more formal way for me to approve? If so, I'm not seeing it.

@pacollins
Copy link
Owner

Nah, I just am looking for a final comment to make sure that you have everything there. I have been known to move too quick, so I like that you guys are helping with development so I can force myself to slow down!

I mean you could theoretically do a review in the files changed tab.

@pacollins pacollins merged commit 329a979 into pacollins:master Aug 4, 2020
@pacollins pacollins mentioned this pull request Aug 4, 2020
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants