Issue #3176910 by kishor_kolekar, anmolgoyal74, hansa11, kostyashupenko, mherchel: Move Olivero's preload.twig documentation to @file and include variables passed for the template

merge-requests/25/head
Lauri Eskola 2020-10-30 14:48:18 +02:00
parent 5deb8d7ce5
commit 210802590a
No known key found for this signature in database
GPG Key ID: 382FC0F5B0DF53F8
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,11 @@
{#
Preload the fonts for the headings and normal body copy (non bold and non italic).
/**
* @file
* Preload the non-bold & non-italic fonts for the headings and the body copy.
*
* Available variables:
* - olivero_path: Returns the path to the Olivero theme.
*/
#}
<link rel="preload" href="/{{ olivero_path }}/fonts/metropolis/Metropolis-SemiBold.woff2" as="font" type="font/woff2" crossorigin>

View File

@ -19,6 +19,7 @@
* - db_offline: A flag indicating if the database is offline.
* - placeholder_token: The token for generating head, css, js and js-bottom
* placeholders.
* - olivero_path: Returns the path to an Olivero theme
*
* @see template_preprocess_html()
*/
@ -38,7 +39,7 @@
<title>{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token }}">
<js-placeholder token="{{ placeholder_token }}">
{% include '@olivero/includes/preload.twig' %}
{% include '@olivero/includes/preload.twig' with { olivero_path: olivero_path } only %}
{{ noscript_styles }}
</head>
<body{{ attributes.addClass(body_classes) }}>