Skip to content

Fix wrong conditional checks for Twitter/GitHub links in featured cards#401

Open
arijitroy003 wants to merge 1 commit into
RedHatOfficial:devfrom
arijitroy003:fix/repo-maintenance
Open

Fix wrong conditional checks for Twitter/GitHub links in featured cards#401
arijitroy003 wants to merge 1 commit into
RedHatOfficial:devfrom
arijitroy003:fix/repo-maintenance

Conversation

@arijitroy003

Copy link
Copy Markdown

Summary

The featured project cards in templates/index.html had incorrect conditional checks for the Twitter and GitHub link blocks. Both blocks checked feature.website instead of their respective variables:

  • Line 47: {% if feature.website %} guarded the Twitter link — changed to {% if feature.twitter %}
  • Line 55: {% if feature.website %} guarded the GitHub link — changed to {% if feature.github %}

This caused two problems:

  1. Twitter/GitHub links would render (with potentially empty href) whenever a website URL existed, even if no Twitter/GitHub URL was set
  2. Twitter/GitHub links would be hidden when only those URLs were set without a website URL

Verification

  • Confirmed the bug exists by grepping for feature.website on the affected lines
  • Verified each {% if %} conditional now matches its corresponding <a href> target
  • The outer {% if feature.website or feature.github or feature.twitter %} guard on line 37 remains correct

Fixes #396

…eatured cards

The Twitter and GitHub link blocks in the featured project cards both
checked `feature.website` instead of `feature.twitter` and
`feature.github` respectively. This caused those links to render
whenever a website was set, even if no Twitter/GitHub URL existed,
and to be hidden when only Twitter/GitHub was set without a website.

Fixes RedHatOfficial#396
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.

Wrong Conditions for Twitter & GitHub Card Links

1 participant