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

Fix minor issues with Code Samples #2966

Merged
merged 2 commits into from
Feb 7, 2025
Merged

Fix minor issues with Code Samples #2966

merged 2 commits into from
Feb 7, 2025

Conversation

mDuo13
Copy link
Collaborator

@mDuo13 mDuo13 commented Jan 28, 2025

  • Remov a "feature" where the description gets deleted if it matches the title exactly (due to how our plugin finds the text of the README).
    Before After
    price oracles description starts with '. ' price oracles code sample has the correct description
  • Changed the top level of the Code Sampels layout to be a <main> element, which allows some styles to apply correctly and also helps the search crawler find the contents of the page.
    • The text now (correctly) does not turn purple when a card is hovered.
  • Changed a couple code sample descriptions that had weird casing or typos.

- The description gets deleted if it matches the title exactly (due to
  how our plugin finds the text of the README). Changed a couple
  instances to not match exactly so this doesn't happen.
- Changed the top level of the Code Sampels layout to be a <main>
  element, which allows some styles to apply correctly and also helps
  the search crawler find the contents of the page.
@mDuo13 mDuo13 added bug Typo or other small documentation error web dev Styles, templates, or other technologies for how the site is built & presented labels Jan 28, 2025
@amarantha-k
Copy link
Collaborator

The description on the last card needs to be fixed.
Screenshot 2025-01-29 at 4 18 01 PM

@mDuo13
Copy link
Collaborator Author

mDuo13 commented Jan 31, 2025

Yep, that was another instance of the same problem. It turns out, the "feature" of removing text that matches the title was not even needed, so I removed it entirely. Also fixed another typo I spotted along the way.

@@ -29,7 +29,7 @@ export default function CodeSamples() {
const { codeSamples, langs } = usePageSharedData<any>('code-samples');

return (
<div className="landing page-community">
<main className="landing page-code-samples">
Copy link
Contributor

Choose a reason for hiding this comment

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

I cant find any references to this className in the codebase. Maybe we can remove this? Otherwise LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not used now but it's available if we need it later. Putting it there (on the correct element) is future-proofing.

@mDuo13 mDuo13 merged commit 1131707 into master Feb 7, 2025
5 of 6 checks passed
@mDuo13 mDuo13 deleted the fix_code_samples branch February 7, 2025 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Typo or other small documentation error web dev Styles, templates, or other technologies for how the site is built & presented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants