Файл "head-for-all-site"

Файл "head-for-all-site" використовується для вставки коду в тег <head> на всіх сторінках сайту.

<?php
include 'yandex-verification.php';
include 'google-analytics.php';
?>

<meta name="robots" content="noarchive"/>

<?php if($this->site->hasTrueSiteParam('noindex')): ?>
    <meta name="robots" content="noindex" />
<?php endif; ?>

<?php if($this->site->hasTrueSiteParam('googlebot-noindex')): ?>
    <meta name="googlebot" content="noindex">
<?php endif; ?>

<?php if($this->site->hasTrueSiteParam('show-meta-robots-follow-index')): ?>
    <meta name="robots" content="follow, index">
<?php endif; ?>
<?php if(!empty(getContent($page, 'metaRobots'))): ?>
    <meta name="robots" content="<?=getContent($page, 'metaRobots')?>">
<?php endif; ?>

<link rel="canonical" href="<?=$this->getCanonicalProtocol()?>://<?=$this->getCanonicalDomain()?>/<?=$page === 'home' ? $this->getCanonicalHomePath() : ($page === 'custom-301-page-instead-404' ? $this->getCanonicalHomePath() : $page)?>">

<?php if($this->site->hasTrueSiteParam('enable-amp')): ?>
    <?php
        $ampPath = $page === 'home' ? $this->site->getHomePagePath() : ($page === 'custom-301-page-instead-404' ? $this->site->getSiteParam('custom-301-page-instead-404') : $page);

        $protocol = !empty($this->site->getSiteParam('mandatory-amp-domain')) ? 'https' : $this->getMainProtocol();
        $ampUrl = $protocol . '://' . $this->getAmpDomain();
        // Check if show-main-page-amp is active
        if ($this->site->hasTrueSiteParam('show-main-page-amp')) {
            // If show-main-page-amp = true, AMP is only available on the main page, so no prefixes
            $ampUrl .= (empty($ampPath) ? '' : '/' . $ampPath);
            if (substr($ampUrl, -1) !== '/') {
                $ampUrl .= '/';
            }
        } else {
            //  show-main-page-amp = false  не ,  amp-url-префікс
            $ampUrl .= ($this->site->getAmpUrlPrefix() === 'CONST_EMPTY' || $this->site->hasTrueSiteParam('swap-amp-and-main-version') ? '' : '/' . $this->site->getAmpUrlPrefix())
                . (empty($ampPath) ? '' : '/' . $ampPath);
        }
    ?>
    <link rel="amphtml" href="<?=$ampUrl?>">
<?php endif; ?>
<?php if($page === 'custom-301-page-instead-404'): ?>
    <meta name="robots" content="noarchive">
    <meta name="robots" content="index">
    <meta name="robots" content="follow">
<?php endif; ?>

<?php if($this->site->hasTrueSiteParam('show-micro-data-organization')): ?>
    <?php if (
            $this->site->getType() === 'BR-genesha-gold'
            || $this->site->getType() === 'BR-fortune-mouse'
            || $this->site->getType() === 'BR-aviator'
            || $this->site->getType() === 'BR-mines'
    ) :?>
        <script type="application/ld+json">
            {
                "@context": "https://schema.org",
                "@type": "Organization",
                "name": "<?= $this->site->getSiteParam('micro-data-organization-name') ?? getTitle($page) ?>",
                "url": "<?=$this->getCanonicalProtocol()?>://<?=$this->getCanonicalDomain()?>/<?=$page === 'home' ? $this->getCanonicalHomePath() : ($page === 'custom-301-page-instead-404' ? $this->getCanonicalHomePath() : $page)?>",
                "logo": "<?=$this->getCanonicalProtocol()?>://<?=$this->getCanonicalDomain()?>/<?=$page === 'home' ? $this->getCanonicalHomePath() : ($page === 'custom-301-page-instead-404' ? $this->getCanonicalHomePath() : $page)?>logo.png",
                "description": "<?= getDescription($page) ?>",
                "address": {
                    "@type": "PostalAddress",
                    "addressCountry": "BR"
                }
            }
        </script>
    <?php else :?>
    <script type="application/ld+json">
            {
            "@context": "https://schema.org",
            "@type": "Organization",
            "name": "<?=$this->site->getSiteParam('micro-data-organization-name')?>",
            "url": "<?=$this->getCanonicalDomain()?>",
            "logo": "<?=$this->getCanonicalDomain()?>/img/logo.webp",
            "contactPoint": {
                "@type": "ContactPoint",
                "telephone": "0 800 509 777",
                "contactType": "customer service",
                "areaServed": "RU",
                "availableLanguage": ["Russian", "English"]
                }
            }
        </script>
    <?php endif; ?>
<?php endif; ?>