Skip to content

Nice to have: add excerpts to postspages if available#22287

Merged
leonidasmi merged 9 commits intotrunkfrom
579-nice-to-have-add-excerpts-to-postspages-if-available
May 28, 2025
Merged

Nice to have: add excerpts to postspages if available#22287
leonidasmi merged 9 commits intotrunkfrom
579-nice-to-have-add-excerpts-to-postspages-if-available

Conversation

@thijsoo
Copy link
Copy Markdown
Contributor

@thijsoo thijsoo commented May 20, 2025

Context

  • We want to add a description to links when they are possible.

Summary

This PR can be summarized in the following changelog entry:

  • Adds descriptions for the posts listed in the llms.txt file, using their excerpts when those are explicitly set.

Relevant technical choices:

  • It's only added for posts since tags and pages do not have excerpts.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • With this PR, check which posts are in your llms.txt file and edit one of the posts.
  • Add a custom excerpt to that post and save.
  • For another post, have no excerpt but make sure to have some content.
  • For another post, have no excerpt and no content either.
  • Regenerate your llms.txt with the cron job or by toggeling the feature of and on. and make sure that for all posts with a custom excerpt there is a : <text> part after its link. For posts that have no custom excerpt, there's no : <text> part, even for those that have content.
  • After checking this remove the excerpt from your post and make regenerate the file again. Make sure the excerpt is gone in the file and the : is also gone.
  • Which means that for posts that have an explicit excerpt set, the link items look like this:
- [Link title](https://link_url): Optional link details
  • And for posts that have not an explicit excerpt set, the link items look like this:
- [Link title](https://link_url)

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@thijsoo thijsoo added this to the feature/llms-txt milestone May 20, 2025
@thijsoo thijsoo added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label May 20, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented May 20, 2025

Pull Request Test Coverage Report for Build ccbd1e1cab42cb6a9251607a490144f960c575cb

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 25 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 52.288%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/llms-txt/domain/markdown/items/link.php 0 9 0.0%
src/llms-txt/infrastructure/markdown-services/content-types-collector.php 0 16 0.0%
Totals Coverage Status
Change from base Build d51584948daa306f55e437e459c53f16647f62be: -0.002%
Covered Lines: 29181
Relevant Lines: 56965

💛 - Coveralls

thijsoo added 2 commits May 20, 2025 13:53
…before-writing-to-file' of github.com:Yoast/wordpress-seo into 579-nice-to-have-add-excerpts-to-postspages-if-available
@thijsoo thijsoo changed the base branch from feature/llms-txt to 577-sanitize-and-deal-with-special-markdown-characters-before-writing-to-file May 21, 2025 06:48
@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@leonidasmi leonidasmi mentioned this pull request May 21, 2025
18 tasks
Base automatically changed from 577-sanitize-and-deal-with-special-markdown-characters-before-writing-to-file to feature/llms-txt May 21, 2025 09:11
Base automatically changed from feature/llms-txt to trunk May 21, 2025 09:32
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR: 🏗️

Comment thread src/llms-txt/domain/markdown/items/link.php Outdated
Comment thread src/llms-txt/infrastructure/markdown-services/content-types-collector.php Outdated
Comment thread src/llms-txt/infrastructure/markdown-services/content-types-collector.php Outdated
…to-have-add-excerpts-to-postspages-if-available

# Conflicts:
#	src/llms-txt/domain/markdown/items/link.php
@leonidasmi leonidasmi removed this from the feature/llms-txt milestone May 28, 2025
@leonidasmi leonidasmi added changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog and removed changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels May 28, 2025
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR: 🏗️ A final thing to be addressed.

Comment thread src/llms-txt/domain/markdown/items/link.php
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

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

CR and acceptance is ✅

(I pushed a small change about the type of the $description property in its docs.

(And another one, where I removed the now-redundant string helper from the content types collector)

(I tested after those changes)

@leonidasmi leonidasmi added this to the 25.4 milestone May 28, 2025
@leonidasmi leonidasmi merged commit 567450c into trunk May 28, 2025
25 checks passed
@leonidasmi leonidasmi deleted the 579-nice-to-have-add-excerpts-to-postspages-if-available branch May 28, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants