Skip to content

Conversation

JasonRaveling
Copy link
Contributor

Ensures a GitHub or Twitter username is configured in _config.yml before displaying them in the sidebar. Adds a conditional to capture/assign url so that it is nil if no username was provided. That way when the check for url is done for building the link, it will be skipped if no username is configured.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (refactoring and improving code)

Description

Before this commit, GitHub and Twitter icons would be displayed on the sidebar, even if you deleted the username from _config.yml. In that case, the logo would just appear with a link to the root site (e.g. twitter.com instead of twitter.com/some_user). This fix adds logic so that when _includes/sidebar.html is rendered it will check if _config.yml has an entry for it. If no entry is configured the icon will not be displayed.

…splaying the icon as a contact

Ensures a GitHub or Twitter username is configured in `_config.yml` before displaying them in the sidebar. Adds a conditional to capture/assign `url` so that it is `nil` if no username was provided. That way when the check for `url` is done for building the link, it will be skipped if no username is configured.
Copy link
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

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

That addition is important — thanks!

Refactor contact entry URL generation logic to skip entries without usernames or emails.

Signed-off-by: Cotes Chung <[email protected]>
@cotes2020 cotes2020 merged commit 5f8ec7f into cotes2020:master Aug 31, 2025
5 checks passed
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.

2 participants