html.html.twig 1.81 KB
Newer Older
1
2
3
4
5
6
{#
/**
 * @file
 * Default theme implementation for the basic structure of a single Drupal page.
 *
 * Variables:
7
8
9
 * - logged_in: A flag indicating if user is logged in.
 * - root_path: The root path of the current page (e.g., node, admin, user).
 * - node_type: The content type for the current node, if the page is a node.
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 * - css: A list of CSS files for the current page.
 * - head: Markup for the HEAD element (including meta tags, keyword tags, and
 *   so on).
 * - head_title: A modified version of the page title, for use in the TITLE tag.
 * - head_title_array: List of text elements that make up the head_title
 *   variable. May contain or more of the following:
 *   - title: The title of the page.
 *   - name: The name of the site.
 *   - slogan: The slogan of the site.
 * - page_top: Initial rendered markup. This should be printed before 'page'.
 * - page: The rendered page markup.
 * - page_bottom: Closing rendered markup. This variable should be printed after
 *   'page'.
 * - styles: Style tags necessary to import all necessary CSS files in the head.
 * - scripts: Script tags necessary to load the JavaScript files and settings
 *   in the head.
 *
 * @see template_preprocess_html()
 *
 * @ingroup themeable
 */
#}
32
33
34
35
36
37
38
{%
  set body_classes = [
    logged_in ? 'user-logged-in',
    not root_path ? 'path-frontpage' : 'path-' ~ root_path|clean_class,
    node_type ? 'node--type-' ~ node_type|clean_class,
  ]
%}
39
40
41
<!DOCTYPE html>
<html{{ html_attributes }}>
  <head>
42
    {{ head }}
43
    <title>{{ head_title }}</title>
44
45
    {{ styles }}
    {{ scripts }}
46
  </head>
47
  <body{{ attributes.addClass(body_classes) }}>
48
49
50
    <a href="#main-content" class="visually-hidden focusable skip-link">
      {{ 'Skip to main content'|t }}
    </a>
51
    {{ page_top }}
52
    {{ page }}
53
    {{ page_bottom }}
54
    {{ scripts_bottom }}
55
56
  </body>
</html>