Skip to content

Docs/updates to docs layout #505

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

alex72508
Copy link
Collaborator

@alex72508 alex72508 commented Jul 23, 2025

Description (required)

Updating pages to include a richer header so that SEO and AI LLMs index the content better than before.

Summary by CodeRabbit

  • New Features

    • Enhanced SEO and social sharing metadata for documentation pages, including richer meta tags and structured data for improved discoverability.
    • Expanded metadata support in documentation, allowing for topics, keywords, audience, complexity, SDK, languages, updated date, featured/deprecated status, and AI-generated summaries.
    • Documentation suggestions now provide more detailed metadata and content previews for better search and indexing.
  • Chores

    • Updated sitemap and robots.txt configurations to refine search engine crawling, add crawl delay, and better control indexed paths.

Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

Walkthrough

The changes enhance SEO and metadata handling throughout the project. The sitemap and robots.txt configurations are refined for improved search engine interaction. The documentation schema is extended with a rich metadata object, and this metadata is surfaced in documentation suggestions and the custom Head component, which now generates comprehensive SEO tags and structured data.

Changes

File(s) Change Summary
astro.config.mjs Refined sitemap filter logic to explicitly include/exclude certain paths, removed customPages, and added new sitemap options (changefreq, priority, lastmod).
public/robots.txt Expanded with crawl delay, specific bot rules, explicit disallow for /admin/, and comments clarifying sitemap location and directives.
src/content.config.ts Extended the docs collection schema with an optional metadata object containing SEO-related fields (topics, sdk, languages, audience, complexity, keywords, updated, featured, deprecated, ai-summary).
src/pages/docs-suggestions.json.ts Enhanced the JSON output for docs suggestions to include new metadata fields and computed properties (content_preview, search_terms) for improved search and SEO.
src/starlight-overrides/Head.astro Overhauled to extract and merge metadata from frontmatter, generate comprehensive meta tags and JSON-LD structured data for SEO, and conditionally render Open Graph images based on metadata.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DocsPage (Astro)
    participant HeadOverride
    participant Metadata (Frontmatter)
    participant SEO/OG Tags
    participant JSON-LD

    User->>DocsPage: Requests documentation page
    DocsPage->>HeadOverride: Renders with entry prop
    HeadOverride->>Metadata: Extracts/merges metadata (keywords, topics, etc.)
    HeadOverride->>SEO/OG Tags: Generates meta tags (SEO, Open Graph, Twitter)
    HeadOverride->>JSON-LD: Generates structured data (TechArticle)
    HeadOverride-->>DocsPage: Renders enhanced <head> section
    DocsPage-->>User: Returns page with rich metadata
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

  • Update site map code #493: Both PRs modify the sitemap integration configuration in astro.config.mjs, with the main PR extending the sitemap filter logic and adding sitemap options, while the retrieved PR introduces a redirect and a simpler filter excluding '404' pages and a static customPages array; thus, they are related changes to sitemap generation.

Suggested labels

enhancement

Suggested reviewers

  • clairekinde11

Poem

In burrows deep where metadata grows,
The rabbit hops where SEO flows.
With sitemaps clear and robots polite,
Docs now sparkle in search engine light.
New fields, new tags, a structured delight—
This bunny’s code makes web pages bright!
🐇✨

Note

⚡️ Unit Test Generation - Beta

CodeRabbit's unit test generation is now available in Beta! Automatically generate comprehensive unit tests for your code changes, ensuring better test coverage and catching edge cases you might miss. Our AI analyzes your code structure and creates tests that follow best practices and your project's testing patterns. Learn more here, or just try it under ✨ Finishing Touches.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/updates-to-docs-layout

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

@alex72508
Copy link
Collaborator Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

Deploying kinde-docs-previews with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9a01771
Status: ✅  Deploy successful!
Preview URL: https://823c6414.kinde-docs-previews.pages.dev
Branch Preview URL: https://docs-updates-to-docs-layout.kinde-docs-previews.pages.dev

View logs

Copy link
Contributor

@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: 3

🔭 Outside diff range comments (1)
src/pages/docs-suggestions.json.ts (1)

4-4: Avoid using any type - define proper types for better type safety

Using as any removes type safety and could lead to runtime errors. Consider defining a proper type for the imported MDX modules.

+interface MDXModule {
+  frontmatter: {
+    page_id: string;
+    title: string;
+    description?: string;
+    app_context?: any[];
+    metadata?: {
+      topics?: string[];
+      keywords?: string[];
+      audience?: string[];
+      complexity?: 'beginner' | 'intermediate' | 'advanced';
+      sdk?: string[];
+      languages?: string[];
+      updated?: string | Date;
+      featured?: boolean;
+      deprecated?: boolean;
+      'ai-summary'?: string;
+    };
+  };
+}
+
-  const docs = import.meta.glob("../content/docs/**/**/*.mdx", {eager: true}) as any;
+  const docs = import.meta.glob<MDXModule>("../content/docs/**/**/*.mdx", {eager: true});
🧹 Nitpick comments (2)
public/robots.txt (1)

10-18: Consider removing redundant user-agent sections

The separate user-agent sections for Googlebot, Bingbot, and Slurp are redundant since they only contain Allow: /, which is already specified for User-agent: *. These search engines will follow the general rules.

Consider simplifying:

-# Allow all major search engines
-User-agent: Googlebot
-Allow: /
-
-User-agent: Bingbot
-Allow: /
-
-User-agent: Slurp
-Allow: /
-
src/starlight-overrides/Head.astro (1)

73-78: Use standard schema.org properties instead of custom isFeatured

The isFeatured property is not part of the schema.org specification and may be ignored by search engines. Consider using standard properties or omitting this non-standard field.

Consider using a standard approach:

-if (featured !== undefined) {
-  structuredData.isPartOf = {
-    "@type": "CreativeWork",
-    "isFeatured": featured
-  };
-}
+if (featured) {
+  // Add to keywords or use a different standard property
+  structuredData.keywords = structuredData.keywords + ", featured";
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bb8691e and 9a01771.

📒 Files selected for processing (5)
  • astro.config.mjs (1 hunks)
  • public/robots.txt (1 hunks)
  • src/content.config.ts (1 hunks)
  • src/pages/docs-suggestions.json.ts (1 hunks)
  • src/starlight-overrides/Head.astro (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
astro.config.mjs (1)

Learnt from: marcosmartini
PR: #253
File: src/content/docs/properties/work-with-properties/property-groups.mdx:13-13
Timestamp: 2024-11-12T06:00:08.396Z
Learning: In the project documentation, the /kinde-apis/management and /kinde-apis/frontend pages use a third-party API reference and client that loads a Single Page Application (SPA). Therefore, links to sections within these pages are valid, even if they appear to point to non-existent sections in static analysis, and should not be flagged.

},
changefreq: 'weekly',
priority: 0.7,
lastmod: new Date()
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use actual content modification dates instead of build time for lastmod

Using new Date() sets the same modification date (build time) for all pages in the sitemap, which doesn't reflect actual content changes and could mislead search engines about update frequency.

Consider using actual file modification dates or the updated metadata field from your content files for more accurate lastmod values.

Apply this approach to use actual modification dates:

-      lastmod: new Date()
+      lastmod: (page) => {
+        // Use the actual modification date from content metadata if available
+        // This would require passing entry data to the sitemap generation
+        return undefined; // Let Astro determine from file system
+      }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In astro.config.mjs at line 334, replace the static assignment of lastmod using
new Date() with dynamic values reflecting actual content modification dates.
Retrieve the last modified timestamp from each content file's metadata or file
system modification time and assign that to lastmod to ensure the sitemap
accurately represents when each page was last updated.

updated: z.union([z.string(), z.date()]).optional(), // Allow both string and date
featured: z.boolean().optional(),
deprecated: z.boolean().optional(),
'ai-summary': z.string().optional()
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use consistent camelCase naming for all metadata fields

The field 'ai-summary' uses kebab-case while all other metadata fields use camelCase. This inconsistency requires special handling and makes the API less uniform.

-          'ai-summary': z.string().optional()
+          aiSummary: z.string().optional()

Note: This change will require updates in other files that reference this field.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'ai-summary': z.string().optional()
aiSummary: z.string().optional()
🤖 Prompt for AI Agents
In src/content.config.ts at line 25, rename the metadata field 'ai-summary' to
use camelCase as 'aiSummary' to maintain consistent naming conventions across
all metadata fields. After renaming, update all references to this field in
other files to reflect the new camelCase name to avoid breaking changes.

},
"articleSection": topics.join(", "),
"articleBody": entry.data.description,
"wordCount": entry.data.description?.length || 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix inaccurate wordCount - using character count instead of word count

The wordCount field is set to the character length of the description, not the actual word count. This provides misleading information to search engines.

Either calculate the actual word count or remove this field:

-  "wordCount": entry.data.description?.length || 0,
+  "wordCount": entry.data.description?.split(/\s+/).filter(Boolean).length || 0,

Or remove it entirely if an accurate count from the full content isn't available:

-  "wordCount": entry.data.description?.length || 0,

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/starlight-overrides/Head.astro at line 61, the wordCount is incorrectly
calculated using the character length of the description. To fix this, replace
the current assignment with a calculation that counts the actual number of words
in the description string, for example by splitting the string on whitespace and
counting the resulting array length. If an accurate word count cannot be derived
from the description, consider removing the wordCount field entirely to avoid
misleading information.

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