openSUSE / suse-xsl

DocBook XSL Stylesheets for SUSE branding
Other
11 stars 10 forks source link

SEO-related tweeks: OG and TwitterCard descriptions #480

Open janajaeger opened 2 years ago

janajaeger commented 2 years ago

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

Related information


toms: added "related information" section

janajaeger commented 2 years ago

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

In the short term:

In the mid/long term:

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 commented 2 years ago

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 ```html ```

Maybe that helps us to minimize the markup?

janajaeger commented 2 years ago

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

tomschr commented 2 years ago

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 commented 1 year ago

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