-
-
Notifications
You must be signed in to change notification settings - Fork 249
Add missing keywords meta tag to platform website (#11277) #11279
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
Add missing keywords meta tag to platform website (#11277) #11279
Conversation
WalkthroughAdds a keywords meta tag to PageOutlet.razor and introduces a new nullable Keywords parameter in PageOutlet.razor.cs to supply dynamic keyword content. No other logic or metadata behavior changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Assessment against linked issues
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor (1)
3-23
: Action: avoid duplicate and enable per-page KeywordsFindings from the repo search:
- Exactly two occurrences of a keywords meta tag were found:
- src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor
- src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/PageOutlet.razor
- No other
name="keywords"
occurrences found.- Most PageOutlet usages do NOT pass a Keywords parameter (examples):
- src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/OverviewPage.razor
- src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/HomePage.razor
- src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor
- src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor
- src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor
(the script output lists all pages that currently omit Keywords.)Recommended action (short):
- Update the shared PageOutlet(s) so the keywords meta is not always hard-coded. Options:
- Remove the default keywords from PageOutlet and put a single site-wide default in the layout/host, OR
- Render the keywords meta only when a Keywords parameter is provided (optionally merging a small site-default with per-page keywords).
- Add per-page Keywords to pages where SEO-specific keywords are needed.
Files to change:
- src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor
- src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/PageOutlet.razor
- (Plus any pages identified by the script where you want per-page keywords added.)
🧹 Nitpick comments (3)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor.cs (1)
5-12
: Avoid dangling comma when Keywords is null/empty; centralize static keywords in code-behindAs implemented in the .razor file, a trailing ", " will remain when Keywords is not supplied. Suggest computing the final keywords once in code-behind and binding to it from markup. This improves readability, avoids duplication, and prevents the dangling comma.
Apply this diff to add a const and a computed property:
public partial class PageOutlet { [Parameter] public string? Title { get; set; } [Parameter] public string? Description { get; set; } [Parameter] public string? Keywords { get; set; } [Parameter] public string? Url { get; set; } [Parameter] public string ImageUrl { get; set; } = "https://bitplatform.dev/images/og-image.webp"; + private const string SiteKeywords = + ".NET development, Blazor tools, Blazor utilities, PWA tools, cross-platform .NET, .NET boilerplate, bit Boilerplate, bit Butil, bit Bswup, bit Besql, bit BlazorUI, .NET project template, low-code .NET, .NET DevTools, multi-platform apps, .NET developers, Blazor PWA, Entity Framework in browser"; + + protected string KeywordsContent => + string.IsNullOrWhiteSpace(Keywords) ? SiteKeywords : $"{SiteKeywords}, {Keywords}"; + [Parameter] public RenderFragment? ChildContent { get; set; } }Then, update the .razor file to use
@KeywordsContent
(see the corresponding comment there).src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor (2)
6-6
: Bind to a computed Keywords value to prevent a trailing commaIf
Keywords
is not provided, the current attribute will render a dangling ", " at the end. Bind to a computed property instead.Apply this diff after adding
KeywordsContent
in the code-behind:- <meta name="keywords" content=".NET development, Blazor tools, Blazor utilities, PWA tools, cross-platform .NET, .NET boilerplate, bit Boilerplate, bit Butil, bit Bswup, bit Besql, bit BlazorUI, .NET project template, low-code .NET, .NET DevTools, multi-platform apps, .NET developers, Blazor PWA, Entity Framework in browser, @Keywords" /> + <meta name="keywords" content="@KeywordsContent" />Alternative (inline-only) if you prefer not to touch code-behind (still avoids the dangling comma but duplicates the static string):
- <meta name="keywords" content=".NET development, Blazor tools, Blazor utilities, PWA tools, cross-platform .NET, .NET boilerplate, bit Boilerplate, bit Butil, bit Bswup, bit Besql, bit BlazorUI, .NET project template, low-code .NET, .NET DevTools, multi-platform apps, .NET developers, Blazor PWA, Entity Framework in browser, @Keywords" /> + <meta name="keywords" content="@($".NET development, Blazor tools, Blazor utilities, PWA tools, cross-platform .NET, .NET boilerplate, bit Boilerplate, bit Butil, bit Bswup, bit Besql, bit BlazorUI, .NET project template, low-code .NET, .NET DevTools, multi-platform apps, .NET developers, Blazor PWA, Entity Framework in browser{(string.IsNullOrWhiteSpace(Keywords) ? "" : $", {Keywords}")}")" />
6-6
: Keep keywords concise; avoid overstuffingMost modern search engines ignore meta keywords; for those that don't, shorter, targeted lists (10–15 terms) are sufficient. Consider trimming the static list to avoid bloat.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting
📒 Files selected for processing (2)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor
(1 hunks)src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor.cs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build and test
🔇 Additional comments (1)
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor.cs (1)
7-7
: Keywords parameter added — LGTMThe new nullable Keywords parameter aligns with existing props and unblocks the meta tag rendering. No issues spotted.
closes #11277
Summary by CodeRabbit