Skip to content
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

SEO-related tweeks: OG and TwitterCard descriptions #480

Open
janajaeger opened this issue Jul 25, 2022 · 5 comments
Open

SEO-related tweeks: OG and TwitterCard descriptions #480

janajaeger opened this issue Jul 25, 2022 · 5 comments
Labels
cat-infra Infrastructure related issues format-html html, xhtml, html5, webhelp, jsp support prio:medium styles-2022 "suse2022-ns" styles topic-smartdocs For SmartDocs

Comments

@janajaeger
Copy link
Contributor

janajaeger commented Jul 25, 2022

Problem Description

Currently, we get suitable meta descriptions for Google by chopping of any characters beyond the 150th of the abstract. This however, isn't good enough for TwitterCards and Open Graph descripions.

Twitter supports up to 120 chars. OG only accepts up to 65 chars. We are currently getting penalized for TwitterCards and OG :(

Proposed fix

  • limit any abstract to a maximum of 150 chars (make it a validation issue!) -> use abstract as search meta description
  • chop off abstract text after 119/120 chars -> Use for TwitterCard description. Check whether stylesheets adds ... by default (I suspect it does that already.)
  • Use the title contents for OG, Twitter and page titles. Enforce chop after 55 chars -> check whether 55 is enforced currently. Recycle title string for OG description.

Related information


toms: added "related information" section

@janajaeger janajaeger added format-html html, xhtml, html5, webhelp, jsp support styles-2022 "suse2022-ns" styles prio:medium cat-infra Infrastructure related issues labels Jul 25, 2022
@janajaeger
Copy link
Contributor Author

As discussed in today's tools meeting, we need the following (roughly). Feel free to tweak this:

In the short term:

  • Make the stylesheets grab the content of the abstract element and chop it off after 119 chars plus ellipse. Use this to generate the TwitterCard and search descriptions.
  • For OpenGraph descriptions, let the stylesheets duplicate the page title.
  • For Twitter and meta titles, check whether the current limit of 55 chars is enforced and enforce it if it isn't.

In the mid/long term:

  • Create a new element called something like "seo-abstract" that is sourced to generate TwitterCard and search descriptions. Limit this to 150 chars and implement the above mentioned 119-chars-chop for Twitter.
  • rest as above

Also, in the long term, maybe consider to create a Smart Docs extension for Geekodoc for things that we need on top of the standard Geekodoc and that maybe enforces a few more things. Smart Docs will need to contain a few more meta tags than the legacy XML files.

@tomschr
Copy link
Collaborator

tomschr commented Aug 4, 2022

Ahh, that's interesting! Just found the following paragraph in the Twitter developer's guide (emphasize by me):

When using Open Graph protocol to describe data on a page, it is easy to generate a Twitter card without duplicating tags and data. When the Twitter card processor looks for tags on a page, it first checks for the Twitter-specific property, and if not present, falls back to the supported Open Graph property. This allows for both to be defined on the page independently, and minimizes the amount of duplicate markup required to describe content and experience.

They give the following example:

A mix of Twitter and Open Graph tags to define a summary card
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@nytimesbits" />
<meta name="twitter:creator" content="@nickbilton" />
<meta property="og:url" content="http://bits.blogs.nytimes.com/2011/12/08/a-twitter-for-my-sister/" />
<meta property="og:title" content="A Twitter for My Sister" />
<meta property="og:description" content="In the early days, Twitter grew so quickly that it was almost impossible to add new features because engineers spent their time trying to keep the rocket ship from stalling." />
<meta property="og:image" content="http://graphics8.nytimes.com/images/2011/12/08/technology/bits-newtwitter/bits-newtwitter-tmagArticle.jpg" />

Maybe that helps us to minimize the markup?

@janajaeger
Copy link
Contributor Author

Nope, it won't. Notice that the OG description is far too long. Would have been nice, though.

@tomschr
Copy link
Collaborator

tomschr commented Aug 8, 2022

Right, the OG description is too long. However, if we cut it to the minimum, it would work, right.

I don't understand why this procedure is recommended in the Twitter development guide if it doesn't work? It's an official guide at least!

@tomschr tomschr added the topic-smartdocs For SmartDocs label Nov 28, 2022
@tomschr
Copy link
Collaborator

tomschr commented Nov 28, 2022

The XSLT stylesheets should match to these elements in https://github.com/SUSE/doc-modular/blob/jjaeger_template-overhaul/templates/xml/assembly.xml#L60-L62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat-infra Infrastructure related issues format-html html, xhtml, html5, webhelp, jsp support prio:medium styles-2022 "suse2022-ns" styles topic-smartdocs For SmartDocs
Projects
None yet
Development

No branches or pull requests

2 participants