@php
    $siteName = $generalSettings['site_name'] ?? '';
    $fullPageTitle = $pageTitle ?? '';
    if (empty($suppressSiteNameSuffix) && !empty($siteName)) {
        $fullPageTitle = trim($fullPageTitle) !== ''
            ? trim($fullPageTitle) . ' | ' . $siteName
            : $siteName;
    }
    $canonicalHref = $canonicalUrl ?? url('/' . ltrim(request()->path(), '/'));
    if (request()->path() === '/' || request()->path() === '') {
        $canonicalHref = url('/');
    }
    $ogLocale = mb_strtolower(app()->getLocale()) === 'ar' ? 'ar_AR' : 'en_US';
@endphp
<meta charset="utf-8">
<title>{{ $fullPageTitle }}</title>
<link rel="canonical" href="{{ $canonicalHref }}">
<meta property="og:url" content="{{ $canonicalHref }}">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">

@if(request()->is('blog*'))
    <meta name='robots' content="index, follow">
@else
    <meta name='robots' content="{{ $pageRobot ?? 'NOODP, nofollow, noindex' }}">
@endif

@if (isset($pageDescription) and !empty($pageDescription))
    <meta name="description" content="{{ $pageDescription }}">
    <meta property="og:description" content="{{ (!empty($ogDescription)) ? $ogDescription : $pageDescription }}">
    <meta name='twitter:description' content='{{ (!empty($ogDescription)) ? $ogDescription : $pageDescription }}'>
@endif

<link rel='shortcut icon' type='image/x-icon' href="{{ url(!empty($generalSettings['fav_icon']) ? $generalSettings['fav_icon'] : '') }}">
<link rel="manifest" href="/mix-manifest.json?v=4">
<meta name="theme-color" content="#FFF">
<!-- Windows Phone -->
<meta name="msapplication-starturl" content="/">
<meta name="msapplication-TileColor" content="#FFF">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-title" content="{{ !empty($generalSettings['site_name']) ? $generalSettings['site_name'] : '' }}">
<link rel="apple-touch-icon" href="{{ url(!empty($generalSettings['fav_icon']) ? $generalSettings['fav_icon'] : '') }}">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<!-- Android -->
<link rel='icon' href='{{ url(!empty($generalSettings['fav_icon']) ? $generalSettings['fav_icon'] : '') }}'>
<meta name="application-name" content="{{ !empty($generalSettings['site_name']) ? $generalSettings['site_name'] : '' }}">
<meta name="mobile-web-app-capable" content="yes">
<!-- Other -->
<meta name="layoutmode" content="fitscreen/standard">
<link rel="home" href="{{ url('') }}">

<!-- Open Graph -->
<meta property='og:title' content='{{ $fullPageTitle }}'>
<meta name='twitter:card' content='summary'>
<meta name='twitter:title' content='{{ $fullPageTitle }}'>

<meta property='og:site_name' content='{{ $siteName }}'>
@if(!isset($course->thumbnail) and !isset($forums) and !isset($topic))
    <meta property='og:image' content='{{ url(!empty($generalSettings['fav_icon']) ? $generalSettings['fav_icon'] : '') }}'>
    <meta name='twitter:image' content='{{ url(!empty($generalSettings['fav_icon']) ? $generalSettings['fav_icon'] : '') }}'>
@endif
<meta property='og:locale' content='{{ $ogLocale }}'>
<meta property='og:type' content='website'>

{!! getSeoMetas('extra_meta_tags') !!}

