Skip to content

Conversation

@adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Aug 29, 2024

Question Answer
JIRA Ticket N/A
Versions master, 4.6
Edition N/A

Enhance main.py cards function to handle more title and description extraction cases.

While www.ibexa.co uses Open Graph, doc.ibexa.co doesn't but uses "regular" title and description metadata.
Open Graph metadata stays the favorite as made for sharing, but if absent, <title>…</title> and <meta name="description" content="…"> are the potential fallbacks.

Test

Successfully tested locally with the following in editions.md:

[[= cards([
"ibexa_products/headless",
"ibexa_products/experience",
"https://www.ibexa.co/products/ibexa-commerce",
"https://doc.ibexa.co/projects/connect/en/latest/general/ibexa_connect/",
"https://doc.ibexa.co/en/latest/tutorials/beginner_tutorial/beginner_tutorial/"
], columns=3) =]]

cards-test

(https://doc.ibexa.co/projects/connect/en/latest/general/ibexa_connect/ doesn't have any description whatever format/syntax. And Connect doc has the same page title everywhere.)

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

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

Thanks!

@adriendupuis adriendupuis merged commit 8ef0111 into master Sep 4, 2024
@adriendupuis adriendupuis deleted the cards-external-url branch September 4, 2024 12:15
adriendupuis added a commit that referenced this pull request Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants