Skip to content

Conversation

@gocanto
Copy link
Collaborator

@gocanto gocanto commented Oct 15, 2025

Summary

  • add dedicated CLI menu options to run static page and blog post SEO generation separately
  • expose a static page generation routine and update blog post logging in the SEO generator
  • adjust SEO generator tests to cover the separated flows

Summary by CodeRabbit

  • New Features

    • Added CLI option to generate SEO for a single post by slug and a prompt to capture/validate the slug.
    • Added separate CLI options for static pages and for posts.
  • Refactor

    • Split SEO generation into dedicated flows for static pages, posts list, and individual posts.
  • UX

    • Updated menu labels and numbering (timestamp option moved).
    • Improved progress messages and per-item logging during SEO runs.
  • Tests

    • Expanded tests to cover slug capture and the new generation pathways.
  • Content

    • Updated About page title to "Who is ".

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Split SEO generation into explicit static, posts, and per-post flows; add generator factory (newSEOGenerator/runSEOGeneration) returning a *seo.Generator; add CLI/menu wiring and slug capture; refactor Generator to expose GenerateStaticPages, GeneratePosts, and GeneratePost; update tests accordingly.

Changes

Cohort / File(s) Summary
CLI entry and wiring
metal/cli/main.go
Replace single Generate() call with specific flows: generateStaticSEO(), generatePostsSEO(), generatePostSEOForSlug(...), and runSEOGeneration(...). Use newSEOGenerator() to obtain a *seo.Generator and invoke the appropriate method; add case 6 wiring and error handling.
Panel menu and slug capture
metal/cli/panel/menu.go
Add CapturePostSlug() (reads, trims, validates slug via slugPattern); update menu options text/numbering to include static SEO, posts SEO, per-slug SEO, and timestamp option.
SEO generator implementation
metal/cli/seo/generator.go
Add GenerateStaticPages() and GeneratePost(slug string); refactor GeneratePosts() to delegate per-post work to a new helper; remove the old unified Generate() behavior; switch page data population to use page-specific Title/Description fields.
Tests: generator and menu
metal/cli/seo/generator_test.go, metal/cli/panel/menu_test.go
Update tests to call GenerateStaticPages(), GeneratePosts(), and GeneratePost(...) as appropriate; add TestCapturePostSlug covering valid and invalid slugs; update assertions/messages to match new APIs.
Web metadata tweak
metal/cli/seo/web.go
Change About page title template from "About "+AuthorName to "Who is "+AuthorName.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Menu
  participant CLI as main.go
  participant Gen as seo.Generator

  User->>Menu: Choose SEO option
  Menu->>CLI: dispatch case (4/5/6)
  CLI->>CLI: runSEOGeneration / newSEOGenerator()
  CLI->>Gen: (case 4) GenerateStaticPages()
  CLI->>Gen: (case 5) GeneratePosts()
  CLI->>Gen: (case 6) GeneratePost(slug)
  Gen-->>CLI: success / error
  CLI-->>User: report result
Loading
sequenceDiagram
  autonumber
  participant OldFlow as Old: Generate()
  participant NewFlow as New: Split flows

  OldFlow->>OldFlow: Single Generate() (static + posts)
  note right of OldFlow: Mixed responsibilities

  NewFlow->>NewFlow: GenerateStaticPages()
  NewFlow->>NewFlow: GeneratePosts()
  NewFlow->>NewFlow: GeneratePost(slug) [optional]
  note right of NewFlow: Explicit, per-target generation
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

I twitch my nose and nibble code,
Three little paths in tidy row.
Static burrows, posts that hop,
One slug, one seed, one jaunty hop.
I hop, I build — the site will grow. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely describes the primary change in the pull request by indicating that the SEO generation functionality has been split into separate options for static pages and posts, matching the implemented CLI and underlying code modifications.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a3a5a9 and d38c75f.

📒 Files selected for processing (6)
  • metal/cli/main.go (2 hunks)
  • metal/cli/panel/menu.go (4 hunks)
  • metal/cli/panel/menu_test.go (1 hunks)
  • metal/cli/seo/generator.go (8 hunks)
  • metal/cli/seo/generator_test.go (1 hunks)
  • metal/cli/seo/web.go (1 hunks)

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@gocanto gocanto marked this pull request as draft October 15, 2025 02:13
@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces enhanced flexibility to the SEO generation utility by separating the process for static pages and blog posts. Previously, a single operation handled both; now, users can choose to generate SEO for each content type independently via new CLI menu options. This change improves usability and allows for more targeted updates, potentially saving time and resources when only one type of content needs SEO regeneration.

Highlights

  • Granular SEO Generation: The SEO generation process has been split, allowing users to generate SEO specifically for static pages or for blog posts independently, rather than a single combined operation.
  • CLI Menu Updates: New dedicated options have been added to the command-line interface (CLI) menu for 'Generate SEO for static pages' and 'Generate SEO for blog posts', enhancing user control.
  • Code Refactoring: The generateSEO() function in metal/cli/main.go has been refactored into generateStaticSEO() and generatePostsSEO(), with a new newSEOGenerator() helper function introduced for cleaner code.
  • SEO Generator Logic: The seo.Generator now includes distinct GenerateStaticPages() and GeneratePosts() methods, and the main Generate() method orchestrates calls to these new, more focused routines.
  • Improved Logging: Specific logging messages have been added to indicate the start and finish of both static page and blog post SEO generation pipelines, providing clearer feedback to the user.
  • Test Coverage: Existing tests for the SEO generator have been updated to reflect the new separated generation flows, ensuring the new functionality works as expected.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively splits the SEO generation process into two distinct CLI options for static pages and blog posts. The changes are well-structured across the CLI entrypoint, the SEO generator logic, and the corresponding tests. I have one suggestion to improve maintainability by reducing some code duplication in metal/cli/main.go. Overall, this is a solid improvement.

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

🧹 Nitpick comments (1)
metal/cli/main.go (1)

160-190: Consider consolidating the helper functions.

The generateStaticSEO() and generatePostsSEO() functions follow identical patterns: create generator, then call a specific method. While this is functional, you could reduce duplication with a helper that accepts the method as a parameter.

Optional refactor:

func generateStaticSEO() error {
	return generateSEOWith(func(gen *seo.Generator) error {
		return gen.GenerateStaticPages()
	})
}

func generatePostsSEO() error {
	return generateSEOWith(func(gen *seo.Generator) error {
		return gen.GeneratePosts()
	})
}

func generateSEOWith(fn func(*seo.Generator) error) error {
	gen, err := newSEOGenerator()
	if err != nil {
		return err
	}
	return fn(gen)
}

However, given the simplicity and clarity of the current approach, this refactor is entirely optional.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ec2290 and 0a3a5a9.

📒 Files selected for processing (4)
  • metal/cli/main.go (2 hunks)
  • metal/cli/panel/menu.go (1 hunks)
  • metal/cli/seo/generator.go (2 hunks)
  • metal/cli/seo/generator_test.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
metal/cli/seo/generator.go (1)
pkg/cli/message.go (1)
  • Magentaln (33-35)
metal/cli/main.go (2)
metal/cli/seo/generator.go (2)
  • Generator (30-38)
  • NewGenerator (40-94)
pkg/portal/validator.go (1)
  • GetDefaultValidator (23-33)
🔇 Additional comments (6)
metal/cli/panel/menu.go (1)

92-94: LGTM! Menu options updated correctly.

The menu text accurately reflects the split SEO generation functionality, with clear labeling for static pages (option 4) and blog posts (option 5). The new timestamp option (option 6) is appropriately placed.

metal/cli/seo/generator_test.go (1)

155-161: LGTM! Tests properly updated for two-phase generation.

The test correctly invokes both GenerateStaticPages() and GeneratePosts() in sequence, matching the new API design. Error handling and messages are appropriate for each phase.

metal/cli/seo/generator.go (3)

96-102: LGTM! Clean delegation pattern.

The Generate() method now acts as a convenience wrapper that orchestrates both static pages and blog posts generation. This maintains backward compatibility while exposing the new granular methods.


104-125: LGTM! Well-structured static page generation.

The new GenerateStaticPages() method cleanly encapsulates the static page pipeline with appropriate logging. The step-based approach with deferred completion logging is clear and maintainable.


295-298: LGTM! Consistent logging added.

The logging statements provide clear visibility into the blog posts generation lifecycle, matching the pattern used in GenerateStaticPages().

metal/cli/main.go (1)

70-82: LGTM! Case statements correctly updated.

The switch cases properly map to the new menu options, with case 4 handling static SEO generation, case 5 handling posts SEO generation, and case 6 handling timestamp printing. Error handling is consistent across all cases.

@gocanto gocanto added testing and removed codex labels Oct 15, 2025
@gocanto gocanto changed the title Split SEO generation options for static pages and posts feat: Split SEO generation options for static pages and posts Oct 15, 2025
@gocanto gocanto removed the testing label Oct 15, 2025
@gocanto gocanto force-pushed the gus/split-seo-generation-options-2025-10-15 branch from 53693f8 to d38c75f Compare October 15, 2025 04:31
@gocanto gocanto marked this pull request as ready for review October 15, 2025 04:34
@gocanto gocanto merged commit 7aac658 into main Oct 15, 2025
5 checks passed
@gocanto gocanto deleted the gus/split-seo-generation-options-2025-10-15 branch October 15, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants