<!doctype HTML>
<html lang="<%= req.locale || defaultLang %>" dir="<%= htmlDir %>" class="theme-<%= preferredTheme %>">
<head>
    <meta charset="utf-8">
    
    <title><%= title || "Page" %> - Discord Extreme List</title>

    <link href="<%= defaultWebURL %>/img/lgbt.png" type="image/png" rel="shortcut-icon">
    <link href="<%= defaultWebURL %>/img/lgbt.png" type="image/png" rel="icon">
    <link href="<%= defaultWebURL %>/css/theme/<%= preferredTheme %>/standard.css?v=<%= cssVersion %>" media="screen, print" rel="stylesheet">
    <script async src="https://arc.io/widget.min.js#ctdPkpZZ"></script>
    <% if (pageType.bot === true) { 
        let color = "#b114ff"
        if(req.user) color = req.user.db.preferences.defaultColour
        if(bot.theme && bot.theme.useCustomColour) color = bot.theme.colour
    %>
    <style>
        .has-text-default { color: <% if (req.user) { %><%= color %><% } else { %>#b114ff<% } %> !important; }
        .has-text-default:hover { color: <% if (req.user) { %><%= colour(`${req.user.db.preferences.defaultColour}`).darken(0.1) || colour("#b114ff").darken(0.1) %><% } else { %><%= colour("#b114ff").darken(0.1) %><% } %>; }
        .has-background-default { background-color: <% if (req.user) { %><%= color %><% } else { %>#b114ff<% } %>; color: <% if (req.user) { %><%= req.user.db.preferences.defaultForegroundColour || "#ffffff" %><% } else { %>#ffffff<% } %>; }
        ::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:<%= siteThemeColour %>}::-webkit-scrollbar-thumb{background:<% if (req.user) { %><%= color %><% } else { %>#b114ff<% } %>}::-webkit-scrollbar-thumb:hover{background:<% if (req.user) { %><%= color %><% } else { %>#b114ff<% } %>}
    </style>
    <% } else { %>
        <style>
            .has-text-default { color: <% if (req.user) { %><%= req.user.db.preferences.defaultColour || "#b114ff" %><% } else { %>#b114ff<% } %> !important; }
            .has-text-default:hover { color: <% if (req.user) { %><%= colour(`${req.user.db.preferences.defaultColour}`).darken(0.1) || colour("#b114ff").darken(0.1) %><% } else { %><%= colour("#b114ff").darken(0.1) %><% } %>; }
            .has-background-default { background-color: <% if (req.user) { %><%= req.user.db.preferences.defaultColour || "#b114ff" %><% } else { %>#b114ff<% } %>; color: <% if (req.user) { %><%= req.user.db.preferences.defaultForegroundColour || "#ffffff" %><% } else { %>#ffffff<% } %>; }
            ::-webkit-scrollbar{width:10px}::-webkit-scrollbar-track{background:<%= siteThemeColour %>}::-webkit-scrollbar-thumb{background:<% if (req.user) { %><%= req.user.db.preferences.defaultColour || "#b114ff" %><% } else { %>#b114ff<% } %>}::-webkit-scrollbar-thumb:hover{background:<% if (req.user) { %><%= req.user.db.preferences.defaultColour || "#b114ff" %><% } else { %>#b114ff<% } %>}
            <% if (req.user) { %>.editorBackdrop { filter: drop-shadow(0px 1px 2px <%= req.user.db.preferences.defaultColour || "#b114ff" %>) }<% } %>
        </style>
    <% } %>
    <% if (req.user) { %><style><%= req.user.db.preferences.customGlobalCss %></style><% } %>

    <link href="https://fonts.googleapis.com/css?family=Lexend+Deca&display=swap" media="screen" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">

    <link href="<%= defaultWebURL %>/fonts/fa/css/all.css?v=<%= cssVersion %>" media="screen" rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'">
    <link rel="preload" href="<%= defaultWebURL %>/fonts/fa/webfonts/fa-solid-900.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="<%= defaultWebURL %>/fonts/fa/webfonts/fa-brands-400.woff2" as="font" type="font/woff2" crossorigin>
    <link rel="preload" href="<%= defaultWebURL %>/fonts/fa/webfonts/fa-duotone-900.woff2" as="font" type="font/woff2" crossorigin>

    <link rel="manifest" href="/manifest.json">
    <link rel="search" title="Search" href="<%= linkPrefix %>/search">
    <link rel="preconnect" href="https://cdn.discordapp.com">
    <link rel="preconnect" href="https://cdn.jsdelivr.net">
    <link rel="preconnect" href="https://twemoji.maxcdn.com">

    <%- include("./locales.ejs") %>
    
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Discord Extreme List, Discord Bots, Discord Bot List, Discord Servers, Discord Templates, Discord Template List, Discord Server List">
    <meta name="robots" content="index,follow">
    <meta name="distribution" content="global">
    <meta name="revisit-after" content="1 day">

    <meta name="theme-color" content="<%= (pageType.bot === true && bot.theme && bot.theme.useCustomColour) ? bot.theme.colour : req.user ? req.user.db.preferences.defaultColour || "#b114ff" : "#b114ff" %>">

    <% if (dev === true) { %>
        <meta name="robots" content="noindex">
    <% } %> 


    <% if (pageType.bot === true) { %>
        <meta name="description" content="<%= bot.shortDesc %>">

        <link rel="canonical" href="<%= baseURL %><%= linkPrefix %>/bots/<%= bot.vanityUrl || bot._id %>">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:site" content="@ExtremeList">
        <meta name="twitter:creator" content="@ExtremeList">
        <meta name="twitter:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta name="twitter:description" content="<%= bot.shortDesc %>">
        <meta property="twitter:image" content="<%= bot.avatar.url %>.png">
        <meta property="twitter:image:alt" content="DEL's Logo">

        <meta property="og:type" content="website">
        <meta property="og:site_name" content="Discord Extreme List">
        <meta property="og:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta property="og:url" content="<%= baseURL %><%= linkPrefix %>/bots/<%= bot.vanityUrl || bot._id %>">
        <meta property="og:description" content="<%= bot.shortDesc %>">
        <meta property="og:image" content="<%= bot.avatar.url %>.png">
        <meta property="og:image:alt" content="DEL's Logo">

        <meta itemprop="name" content="<%= title || "Page" %> | Discord Extreme List">
        <meta itemprop="description" content="<%= bot.shortDesc %>">
        <meta itemprop="image" content="<%= bot.avatar.url %>.png">
    
        <meta name="author" content="<%= botOwner.fullUsername %>">
        <meta name="copyright" content="Cairo Mitchell-Acason, John Burke, Advaith Jagathesan">
    <% } else if (pageType.server === true || pageType.template === true) { %>
        <%
            let listing;
            let listingOwner;
            let folder;

            if (pageType.server === true) {
                listing = server;
                listingOwner = serverOwner;
                folder = 'servers';
            } else if (pageType.template === true) {
                listing = template;
                listingOwner = templateOwner;
                folder = 'templates';
            }
            
            
        %>
        <meta name="description" content="<%= listing.shortDesc %>">

        <link rel="canonical" href="<%= baseURL %><%= linkPrefix %>/<%= folder %>/<%= listing._id %>">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:site" content="@ExtremeList">
        <meta name="twitter:creator" content="@ExtremeList">
        <meta name="twitter:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta name="twitter:description" content="<%= listing.shortDesc %>">
        <meta property="twitter:image" content="<%= listing.icon.url %>.png">
        <meta property="twitter:image:alt" content="DEL's Logo">

        <meta property="og:type" content="website">
        <meta property="og:site_name" content="Discord Extreme List">
        <meta property="og:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta property="og:url" content="<%= baseURL %><%= linkPrefix %>/<%= folder %>/<%= listing._id %>">
        <meta property="og:description" content="<%= listing.shortDesc %>">
        <meta property="og:image" content="<%= listing.icon.url %>.png">
        <meta property="og:image:alt" content="DEL's Logo">

        <meta itemprop="name" content="<%= title || "Page" %> | Discord Extreme List">
        <meta itemprop="description" content="<%= listing.shortDesc %>">
        <meta itemprop="image" content="<%= listing.icon.url %>.png">
    
        <meta name="author" content="<%= listingOwner ? listingOwner.fullUsername : 'Unknown' %>">
        <meta name="copyright" content="Cairo Mitchell-Acason, John Burke, Advaith Jagathesan">
    <% } else { %>
        <meta name="description" content="<%= subtitle || "Discord Extreme List, Discord's unbiased list, giving Discord bots and Discord servers of all sizes an extreme chance!" %>">

        <meta name="twitter:card" content="summary">
        <meta name="twitter:site" content="@ExtremeList">
        <meta name="twitter:creator" content="@ExtremeList">
        <meta name="twitter:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta name="twitter:description" content="<%= subtitle || "Discord Extreme List, Discord's unbiased list, giving Discord bots and Discord servers of all sizes an extreme chance!" %>">
        <meta property="twitter:image" content="<%= defaultWebURL %>/img/lgbt.png">
        <meta property="twitter:image:alt" content="DEL's Logo">

        <meta property="og:type" content="website">
        <meta property="og:site_name" content="Discord Extreme List">
        <meta property="og:title" content="<%= title || "Page" %> | Discord Extreme List">
        <meta property="og:url" content="<%= defaultWebURL %>">
        <meta property="og:description" content="<%= subtitle || "Discord Extreme List, Discord's unbiased list, giving Discord bots and Discord servers of all sizes an extreme chance!" %>">
        <meta property="og:image" content="<%= defaultWebURL %>/img/lgbt.png">
        <meta property="og:image:alt" content="DEL's Logo">

        <meta itemprop="name" content="<%= title || "Page" %> | Discord Extreme List">
        <meta itemprop="description" content="<%= subtitle || "Discord Extreme List, Discord's unbiased list, giving Discord bots and Discord servers of all sizes an extreme chance!" %>">
        <meta itemprop="image" content="<%= defaultWebURL %>/img/lgbt.png">
    
        <meta name="author" content="Cairo Mitchell-Acason, John Burke, Advaith Jagathesan">
        <meta name="copyright" content="Cairo Mitchell-Acason, John Burke, Advaith Jagathesan">
    <% } %>

    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Discord Extreme List">
    <link rel="apple-touch-icon" href="/img/logo-192px.png">

    <meta name="msapplication-TileColor" content="#0a0a0a">
    <meta name="msapplication-TileImage" content="/img/logo-144px.png">
    <meta name="msapplication-config" content="/browserconfig.xml">

    <% if (htmlDir === "rtl") { %><%- include("./rtl.ejs") %><% } %>
    
    <script type="application/ld+json">
        {
            "@context": "http://schema.org",
            "@type": "WebSite",
            "url": "<%= defaultWebURL %>/",
            "potentialAction": {
                "@type": "SearchAction",
                "target": "<%= defaultWebURL %>/search?q={query}",
                "query-input": "required name=query"
            }
        }
    </script>

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=<%= gaID %>"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', '<%= gaID %>');
    </script>
</head>
