Skip to content

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

Conversation

msynk
Copy link
Member

@msynk msynk commented Aug 15, 2025

closes #11277

Summary by CodeRabbit

  • New Features
    • Added a configurable “keywords” meta tag to page head content.
    • Supports combining default keywords with page-specific values.
    • Allows setting keywords per page via a new parameter.
    • Existing head metadata (title, description, Open Graph, Twitter) remains unchanged.

@msynk msynk requested a review from ysmoradi August 15, 2025 14:23
Copy link

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
SEO meta updates
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor
Inserts a meta name="keywords" tag into HeadContent, combining static keywords with the component’s Keywords value. Other meta tags unchanged.
Component API
src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/PageOutlet.razor.cs
Adds [Parameter] public string? Keywords { get; set; } to expose keywords for the Razor component.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Assessment against linked issues

Objective Addressed Explanation
Add support for keywords meta tag in Platform pages (#11277)

Poem

I twitch my nose at SEO delight,
New keywords glimmer in meta light.
With hop and bop, I set the tag,
A string of carrots in a tidy bag.
PageOutlet smiles—content takes flight! 🥕✨

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 Keywords

Findings 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-behind

As 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 comma

If 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 overstuffing

Most 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

📥 Commits

Reviewing files that changed from the base of the PR and between 10b248f and b296bbb.

📒 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 — LGTM

The new nullable Keywords parameter aligns with existing props and unblocks the meta tag rendering. No issues spotted.

@msynk msynk merged commit fbdb03c into bitfoundation:develop Aug 15, 2025
3 checks passed
@msynk msynk deleted the 11277-websites-platform-missing-keywords-meta-tag branch August 15, 2025 16:25
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.

Missing keywords meta tag from the Platform website pages
1 participant