<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <link rel="me" href="https://mstdn.social/@MostDiscussed">
    <link rel="me" href="https://mastodon.social/@MostDiscussed">

    <title>{{ config('app.name', 'Laravel') }}
		@if( ("index" != Request::route()->getName()) && ("show" != Request::route()->getName()) )
			 - {{ ucwords(Request::route()->getName()) }} Articles
		@elseif ( "show" == Request::route()->getName() )
			 - {{ ucwords( $page_title) }}
		@endif
    </title>

    <!-- Scripts -->
    <script src="{{ asset('js/app.js') }}" defer></script>

    <!-- Fonts -->
<style>
	/* cyrillic-ext */
	@font-face {
	  font-family: 'Nunito';
	  font-style: normal;
	  font-weight: 400;
	  src: url(/fonts/Nunito.normal.400.U+0460-052F.U+1C80-1C88.U+20B4.U+2DE0-2DFF.U+A640-A69F.U+FE2E-FE2F.woff2) format('woff2');
	  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
	}
	/* cyrillic */
	@font-face {
	  font-family: 'Nunito';
	  font-style: normal;
	  font-weight: 400;
	  src: url(/fonts/Nunito.normal.400.U+0301.U+0400-045F.U+0490-0491.U+04B0-04B1.U+2116.woff2) format('woff2');
	  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
	}
	/* vietnamese */
	@font-face {
	  font-family: 'Nunito';
	  font-style: normal;
	  font-weight: 400;
	  src: url(/fonts/Nunito.normal.400.U+0102-0103.U+0110-0111.U+0128-0129.U+0168-0169.U+01A0-01A1.U+01AF-01B0.U+1EA0-1EF9.U+20AB.woff2) format('woff2');
	  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
	}
	/* latin-ext */
	@font-face {
	  font-family: 'Nunito';
	  font-style: normal;
	  font-weight: 400;
	  src: url(/fonts/Nunito.normal.400.U+0100-024F.U+0259.U+1E00-1EFF.U+2020.U+20A0-20AB.U+20AD-20CF.U+2113.U+2C60-2C7F.U+A720-A7FF.woff2) format('woff2');
	  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
	}
	/* latin */
	@font-face {
	  font-family: 'Nunito';
	  font-style: normal;
	  font-weight: 400;
	  src: url(/fonts/Nunito.normal.400.U+0000-00FF.U+0131.U+0152-0153.U+02BB-02BC.U+02C6.U+02DA.U+02DC.U+2000-206F.U+2074.U+20AC.U+2122.U+2191.U+2193.U+2212.U+2215.U+FEFF.U+FFFD.woff2) format('woff2');
	  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
	}
</style>

    <!-- Styles -->
    <link href="{{ asset('css/app.css') }}" rel="stylesheet">

    <style>
    @yield('styles')
    </style>
    @if ( "new" == Request::route()->getName() || "popular" == Request::route()->getName() )
	    {!! Rumenx\Feed\Feed::link( url('feed/' . Request::route()->getName()), 'atom', 'RSS-Feed for ' . Request::route()->getName() . ' Articles'); !!}
    @endif

@if ( "" != env( "MATOMO_ID" ) )
<script type="text/javascript">
  var _paq = window._paq || [];
    /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
      (function() {
    var u="{{ env("MATOMO_URL") }}";
    _paq.push(['setTrackerUrl', u+'/jsx/']);
    _paq.push(['setSiteId', '{{env( "MATOMO_ID" )}}']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'/jsx/'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="{{ env("MATOMO_URL") }}/jsx/?idsite={{ env("MATOMO_ID") }}&amp;rec=1" style="border:0;" alt="" /></p></noscript>
@endif

</head>
<body class="d-flex flex-column h-100">
    <div id="app">
        <nav class="navbar navbar-expand-md navbar-dark shadow-sm">
            <div class="container">
                <a class="navbar-brand" href="{{ url('/') }}">
                    {{ config('app.name', 'Laravel') }}
                </a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <!-- Left Side Of Navbar -->
                    <ul class="navbar-nav mr-auto">

                    </ul>

                    <!-- Right Side Of Navbar -->
                    <ul class="navbar-nav ml-auto">
                        <!-- Authentication Links -->
                        @guest
                            @if (Route::has('login'))
                            <li class="nav-item">
                                <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
                            </li>
                            @endif
                            @if (Route::has('register'))
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
                                </li>
                            @endif
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('new') }}">{{ __('New') }}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('popular') }}">{{ __('Popular') }}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('popular_topics') }}">{{ __('Topics') }}</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ route('random') }}">{{ __('Random') }}</a>
                                </li>
                        @else
                            <li class="nav-item dropdown">
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
                                    {{ Auth::user()->name }} <span class="caret"></span>
                                </a>

                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
                                    <a class="dropdown-item" href="{{ route('logout') }}"
                                       onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                                        {{ __('Logout') }}
                                    </a>

                                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
                                        @csrf
                                    </form>
                                </div>
                            </li>
                        @endguest
			<form class="form-inline mt-2 mt-md-0 navbar-searchform" action="{{ route('search') }}">
				<input name="q" class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search" required>
				<button class="btn btn-outline-primary my-2 my-sm-0" type="submit">Search</button>
			</form>
                    </ul>
                </div>
            </div>
        </nav>

        <main class="">
            @yield('content')
        </main>
	@yield('footer')
    </div>
</body>
</html>
