GitLab 13.10 is here 🚀 Learn what's new.

Externalize title image html

Since this may be repeated once different layouts are created, and the
default layout got quite convoluted, the title image section was put
into its own file.
parent fcbb30c0
{% comment %}
Big white title with backdrop image
The image is determined by the "title-image" option in the
front-matter of the markdown file. It can either be the keyword
"default" or the name of an image file. The image file is expected
to be found in the image directory (c.f. _config.yml).
Should the option be unset or the image not be found the blue
background color as set in title-image.css will be used instead.
{% endcomment %}
<div
class="title-image"
{% if page.title-image %}
{% if page.title-image == 'default' %}
{% assign image-url =
site.directory.images
| append: site.default.title-image %}
{% else %}
{% assign image-url =
site.directory.images
| append: page.title-image %}
{% endif %}
style="background-image: url('{{ image-url | strip }}');"
{% endif %}
>
<h1 class="width"> {{ page.title }} </h1>
</div>
\ No newline at end of file
......@@ -19,32 +19,7 @@
{% include header.html %}
<main>
{% comment %}
Big white title with backdrop image
The image is determined by the "title-image" option in the
front-matter of the markdown file. It can either be the keyword
"default" or the name of an image file. The image file is expected
to be found in the image directory (c.f. _config.yml).
Should the option be unset or the image not be found the blue
background color as set in title-image.css will be used instead.
{% endcomment %}
<div
class="title-image"
{% if page.title-image %}
{% if page.title-image == 'default' %}
{% assign image-url =
site.directory.images
| append: site.default.title-image %}
{% else %}
{% assign image-url =
site.directory.images
| append: page.title-image %}
{% endif %}
style="background-image: url('{{ image-url | strip }}');"
{% endif %}
>
<h1 class="width"> {{ page.title }} </h1>
</div>
{% include title_image.html%}
<section>
<div class="transition">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment