adobe / theblog

Apache License 2.0
7 stars 14 forks source link

JP articles do not have a description #648

Closed kptdobe closed 3 years ago

kptdobe commented 3 years ago

Open https://theblog--adobe.hlx.page/jp/publish/2021/03/18/cc-design-adobefonts-font-day-2021 view source Look for og:description - missing.

Open any EN article, you see the description there.

kptdobe commented 3 years ago

https://github.com/adobe/helix-pages/issues/844 fixed the issue.

The rule was: use the first paragraph with a least 10 words as description. Problem is in Japanese and in Javascript, computing the number of words did not work as expected, the latin "whitespaces" are not handled the same in Japanese. For the above page, expected description was: 4月10日「フォントの日」のスペシャル番組。今年はフォントの機能や活⽤のポイントを解説、エンターテインメント的な要素も盛り沢山で、楽しみながらフォントを学んでいただける時間です。. In Javascript, this string contains no "whitespaces". The code now also considers the length of each "word", if one word contains more than 25 characters, the paragraph will be used as a description. This seems to fix the JP pages I have tested.