Add descriptions to user and club pages

This commit is contained in:
Celestora 2022-06-18 14:44:06 +03:00
parent bcfeedb7b3
commit 7d8ae7dab1
4 changed files with 35 additions and 0 deletions

View file

@ -2,6 +2,21 @@
{block title}{$club->getName()}{/block}
{block headIncludes}
{if !empty($club->getDescriptionHtml())}
<meta name="description" content="{$club->getName()} ♠ {tr('participants', $club->getFollowersCount())} ♠ {strip_tags($club->getDescriptionHtml())}" />
{else}
<meta name="description" content="{$club->getName()} ♠ {tr('participants', $club->getFollowersCount())} ♠ {_default_club_seo_cfa}" />
{/if}
<!-- openGraph -->
<meta property="og:title" content="{$club->getName()}" />
<meta property="og:url" content="http://{$_SERVER['HTTP_HOST']}{$club->getURL()}" />
<meta property="og:image" content="{$club->getAvatarUrl('normal')}" />
<meta property="og:type" content="profile" />
<meta n:if="!is_null($club->getShortcode())" property="og:username" content="{$club->getShortcode()}" />
{/block}
{block header}
{$club->getName()}

View file

@ -4,6 +4,16 @@
{block headIncludes}
{if $user->getPrivacyPermission('page.read', $thisUser ?? NULL)}
{if $user->isBanned()}
<meta name="description" content="{tr('banned_user_seo_description', $user->getCanonicalName())}" />
{elseif !is_null($user->getDescription())}
<meta name="description" content="{$user->getCanonicalName()} ♠ {tr('friends', $user->getFriendsCount())} ♠ {tr('followers', $user->getFollowersCount())} ♠ {$user->getDescription()}" />
{else}
{var $instance_name = OPENVK_ROOT_CONF['openvk']['appearance']['name']}
<meta name="description"
content="{$user->getCanonicalName()} @ {$instance_name} ♠ {tr('friends', $user->getFriendsCount())} ♠ {tr('followers', $user->getFollowersCount())} ♠ {_default_user_seo_cfa}" />
{/if}
<!-- openGraph -->
<meta property="og:title" content="{$user->getCanonicalName()}" />
<meta property="og:url" content="http://{$_SERVER['HTTP_HOST']}{$user->getURL()}" />

View file

@ -1002,3 +1002,8 @@
"cookies_popup_content" = "All kids love cookie, so this website uses Cookies to identify your session and nothing more. Check <a href='/privacy'>our privacy policy</a> for more information.";
"cookies_popup_agree" = "Accept";
/* SEO */
"banned_user_seo_description" = "Blocked page, that once belonged to $1.";
"default_user_seo_cfa" = "Join this and many other users in this social network :3";
"default_club_seo_cfa" = "Join this and many other clubs in this social network :3";

View file

@ -1057,3 +1057,8 @@
"cookies_popup_content" = "Все дети любят печенье, поэтому этот веб-сайт использует Cookies для того, чтобы идентифицировать вашу сессию и ничего более. Ознакомьтесь с нашей <a href='/privacy'>политикой конфиденциальности</a> для получения дополнительной информации.";
"cookies_popup_agree" = "Согласен";
/* SEO */
"banned_user_seo_description" = "Заблокированная страница пользователя $1";
"default_user_seo_cfa" = "Присоединяйтесь к этому и другим пользователям данной соцсети :3";
"default_club_seo_cfa" = "Присоединяйтесь к этому и другим сообществам в данной соцсети :3";