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

docs: adding og tags #17

Closed
wants to merge 113 commits into from
Closed

docs: adding og tags #17

wants to merge 113 commits into from

Conversation

grampelberg
Copy link
Owner

@grampelberg grampelberg commented Sep 16, 2024

Summary by Sourcery

Enhance the documentation site by adding Open Graph meta tags, including locale, URL, and type, to improve social media sharing and SEO.

Documentation:

  • Add Open Graph meta tags to the documentation site to improve social media sharing and SEO.

This is non-working and mostly a check in. In
addition to the server, there is a new set of
commands to manage resources (which is integrated
into the server itself). The end goal is to have a
user's session state recorded in k8s with events +
resources.
Kustomize was just too difficult to get working
well in getting started. This introduces an
`install` and `delete` command that does it for
all resources, not just the CRD. There's some
minimal patching that happens to the resources so
that they hopefully can still be applied with
`kubectl` directly from the repo.
There was somewhat significant refactoring
required to get this to work - the effect needed
to be created from the previous buffer. This meant
that:

- Dispatch had to be moved *after* the draw call,
  so that the current buffer was drawn. Ratatui
  gives an empty buffer on every render call.
- Assume that `Dispatch::Consumed` means that we
  want to re-render everything. This triggers the
  tick immediately and assumes that if an event
  was consumed - it was because we want to redraw.
  It gets away from weird UI lag between input and
  rendering.
- Pass the buffer through dispatch as a reference.
- Converted the bundle trait over to a widget.
  This allows us to keep state in the widget
  itself and gets rid of the super weird
  passthrough effects.
- Move animation out of the bundle and into
  widgets themselves. The `Animated` widget is a
  very light wrapper that can optionally render
  things.
- Use `Option<Effect>` instead of `Vec<Effect>`.
  It is much easier to work with from an
  implementation perspective and `fx::parallel`
  works fine.

Some other good changes in here:

- Store now returns a oneshot that allows for
  adding/removing a loading screen. Now the screen
  is removed on loading in pod list.
- Loading is now a `widget::Widget` instead of a
  `ratatui::WidgetRef`.
- `Debug` now does a sum of the ring buffer to
   calculate fps, so it is more accurate. =
   `Debug` now shows how long the last tick was,
   to understand UI latency.
Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kty ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 0:45am

Copy link

sourcery-ai bot commented Sep 16, 2024

Reviewer's Guide by Sourcery

This pull request adds Open Graph (OG) tags to improve the website's metadata for better sharing on social media platforms. The changes are implemented in the docs/theme.config.tsx file, focusing on enhancing the head function of the Nextra theme configuration.

File-Level Changes

Change Details Files
Added new Open Graph (OG) tags for improved social media sharing
  • Imported usePathname from next/navigation
  • Added og:locale meta tag with value 'en_us'
  • Added og:url meta tag with dynamic URL based on current pathname
  • Added og:type meta tag with value 'website'
  • Updated default image path from '/logo-dark-500x500.png' to '/logo-dark.gif'
docs/theme.config.tsx
Updated dependencies and imports
  • Imported usePathname from next/navigation
  • Imported path module (unused in the visible changes)
docs/theme.config.tsx

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @grampelberg - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

const title = `${config.title} – kty`
const description =
config.frontMatter.description || 'kty: Terminal for Kubernetes'

const image = config.frontMatter.image || '/logo-dark-500x500.png'
const image = config.frontMatter.image || '/logo-dark.gif'
Copy link

Choose a reason for hiding this comment

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

question (performance): Reconsider using GIF for the default logo image

Is there a specific reason for changing the default image from PNG to GIF? GIFs often have lower quality for static images and larger file sizes. If animation isn't required, consider using a more efficient format like PNG or WebP.

@@ -48,6 +52,9 @@ const config: DocsThemeConfig = {
<meta property="og:description" content={description} />
<meta name="og:image" content={image} />
<meta name="og:image:alt" content={title} />
<meta property="og:locale" content="en_us" />
<meta property="og:url" content={`https://kty.dev${pathname}`} />
Copy link

Choose a reason for hiding this comment

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

suggestion: Use URL constructor for more robust URL handling

Consider using the URL constructor for more robust URL handling. This would be especially beneficial if you plan to add query parameters or hash fragments in the future. For example: new URL(pathname, 'https://kty.dev').toString()

Suggested change
<meta property="og:url" content={`https://kty.dev${pathname}`} />
<meta
property="og:url"
content={new URL(pathname, 'https://kty.dev').toString()}
/>

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.

1 participant