Skip to content

Refactor SEO meta tag processors and update help texts for ui #7665

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

Merged
merged 6 commits into from
Aug 8, 2025

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Aug 6, 2025

What type of PR is this?

/area core
/kind improvement
/milestone 2.21.x

What this PR does / why we need it:

This PR optimizes SEO tag generation with the following changes:

  1. Site description and keywords settings now only apply to the homepage and are no longer inserted on other pages.
  2. Added meta description tags for category archive pages, using the category description as content.
  3. Improved the help text descriptions for SEO options in system settings.

Which issue(s) this PR fixes:

Fixes #7662

Does this PR introduce a user-facing change?

优化页面的 SEO 标签的生成

Copy link

codecov bot commented Aug 6, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.54%. Comparing base (42c374d) to head (b5e030d).
⚠️ Report is 121 commits behind head on main.

Files with missing lines Patch % Lines
.../run/halo/app/theme/dialect/IndexSeoProcessor.java 88.23% 0 Missing and 2 partials ⚠️
...eme/router/factories/CategoryPostRouteFactory.java 0.00% 2 Missing ⚠️
api/src/main/java/run/halo/app/theme/Constant.java 0.00% 1 Missing ⚠️
...run/halo/app/theme/dialect/GlobalSeoProcessor.java 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7665      +/-   ##
============================================
- Coverage     59.55%   59.54%   -0.02%     
+ Complexity     3812     3801      -11     
============================================
  Files           677      678       +1     
  Lines         23248    23230      -18     
  Branches       1500     1491       -9     
============================================
- Hits          13846    13832      -14     
+ Misses         8764     8757       -7     
- Partials        638      641       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ruibaby ruibaby requested a review from Copilot August 6, 2025 08:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors SEO meta tag generation to be more targeted and improves user interface help text clarity. The changes optimize SEO tags by restricting site-level metadata to homepage only and adding category-specific descriptions.

Key changes:

  • Moved site description and keywords from global to index-only scope
  • Added meta description tags for category archive pages using category descriptions
  • Updated help text in UI locales to clarify SEO functionality and usage

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
IndexSeoProcessor.java New processor that handles SEO meta tags specifically for the homepage
GlobalSeoProcessor.java Refactored to only handle robots meta tag for blocking search engines
CategorySeoProcessor.java New processor that adds meta description tags for category pages
system-setting.yaml Updated help text for SEO settings to clarify their scope and usage
zh-CN.yaml, zh-TW.yaml, en.yaml Corrected help text translations and added SEO-related descriptions
HaloProcessorDialectTest.java Updated test to reflect new SEO processor structure

@ruibaby ruibaby requested a review from JohnNiang August 7, 2025 04:20
@ruibaby ruibaby added the area/core Issues or PRs related to the Halo Core label Aug 7, 2025
@ruibaby ruibaby added this to the 2.21.x milestone Aug 7, 2025
@JohnNiang
Copy link
Member

JohnNiang commented Aug 8, 2025

I suggest defining a specification about how to set meta description in Halo core or in plugins. For example, we can resolve a variable name seoMetaDescription in GlobalSEOProcessor, so that other endpoints can define its own meta description respectively.

Copy link

sonarqubecloud bot commented Aug 8, 2025

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Aug 8, 2025
Copy link

f2c-ci-robot bot commented Aug 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 8, 2025
@f2c-ci-robot f2c-ci-robot bot merged commit 59030f8 into halo-dev:main Aug 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/core Issues or PRs related to the Halo Core lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize page description tag content
2 participants