You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kbin-core/templates/base.html.twig

84 lines
4.3 KiB
Twig

<!DOCTYPE html>
<html lang="{{ app.request.locale }}"
style="font-size: {{ app.request.cookies.has(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_FONT_SIZE'))
? app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_FONT_SIZE'))~'%'
: '100%' }}">
<head>
<title>{%- block title -%}{{ kbin_meta_title() }}{%- endblock -%}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="{{ kbin_meta_keywords() }}">
<meta name="description" content="{% block description %}{{ kbin_meta_description() }}{% endblock %}">
<meta property="og:url" content="{{ app.request.uri }}">
<meta property="og:type" content="article">
<meta property="og:title" content="{{ block('title')|trim }}">
<meta property="og:description" content="{{ block('description')|trim }}">
<meta property="og:image" content="{% block image %}{{ absolute_url(asset('kbin-og.png')) }}{% endblock %}">
<link rel="shortcut icon" href="{{ asset('favicon.ico') }}">
<link rel="icon" href="{{ asset('favicon.ico') }}" sizes="any">
<link rel="icon" href="{{ asset('favicon.svg') }}" type="image/svg+xml">
<link rel="manifest" href="{{ asset('manifest.json') }}"/>
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
<script type="application/json" id="mercure-url">{{ mercure()|raw }}</script>
<script>
window.KBIN_USER = "{{ app.user ? app.user.username : null }}";
window.KBIN_MAGAZINE = "{{ magazine is defined and magazine ? magazine.name : null }}"
window.KBIN_ENTRY_ID = "{{ entry is defined and entry ? entry.id : null }}"
window.KBIN_POST_ID = "{{ post is defined and post ? post.id : null }}"
</script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(
'/sw.js'
);
}
</script>
{% endblock %}
{% if magazine is defined and magazine %}
<style>
{{ magazine.customCss }}
</style>
{% endif %}
</head>
<body class="{{ html_classes(app.request.cookies.has(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_THEME'))
? 'theme--'~app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_THEME'))
: 'theme--default', {
'rounded-edges': app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_GENERAL_ROUNDED_EDGES')) is same as 'true',
'topbar': app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_GENERAL_TOPBAR')) is same as 'true',
'fixed-navbar': app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_GENERAL_FIXED_NAVBAR')) is same as 'true',
'sidebar-left': app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_GENERAL_SIDEBAR_POSITION')) is same as constant('App\\Controller\\User\\ThemeSettingsController::LEFT'),
}) }}" data-controller="kbin notifications">
{% include 'layout/_header.html.twig' with {header_nav: block('header_nav')} %}
<div id="middle" class="{%- block mainClass -%}page{%- endblock %}">
<div class="kbin-container">
<main id="main"
data-controller="lightbox timeago"
class="{{ html_classes({'view-compact': app.request.cookies.get(constant('App\\Controller\\User\\ThemeSettingsController::KBIN_ENTRIES_VIEW')) is same as constant('App\\Controller\\User\\ThemeSettingsController::COMPACT')}) }}">
{% block body %}{% endblock %}
</main>
<aside id="sidebar">
{% block sidebar %}
{% include 'layout/_sidebar.html.twig' with {sidebar_top: block('sidebar_top'), header_nav: block('header_nav')} %}
{% endblock %}
</aside>
</div>
</div>
{% include 'layout/_footer.html.twig' %}
{% include 'layout/_topbar.html.twig' %}
<div id="popover" class="popover js-popover section section--small" role="dialog"></div>
<div id="scroll-top" data-controller="scroll-top" style="display: none;" data-action="click->scroll-top#scrollTop">
<i class="fa-solid fa-arrow-up"></i> <small class="hidden">0</small>
</div>
</body>
</html>