During yesterday's outage there are confirmed reports that some comments in Issues or Merge Requests as well as Issues and Merge Requests themselves were not saved properly. We are currently investigating the cause and will take appropriate countermeasures. Please excuse the inconvenience.

Commit fcbb30c0 authored by Erxleben, Fredo (FWCC) - 136987's avatar Erxleben, Fredo (FWCC) - 136987
Browse files

Make title image configurable via Markdown option

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.

To achieve this, the file "_config.yml" has introduced which holds basic
configuration which applies to the whole site as to avoid magic strings.
parent 7655fd5e
# Here comes the global website configuration
# Directory paths
directory:
css: /assets/css/
images: /assets/img/
javascript: /assets/js/
# Defaults
default:
title-image: hifis_page_title_background.jpg
......@@ -21,12 +21,28 @@
<main>
{% comment %}
Big white title with backdrop image
TODO get image from markdown properties and default to black-ish
background color or 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"
style="background-image:url('/assets/img/hifis_page_title_background.jpg')">
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>
......
......@@ -8,6 +8,7 @@
@import "mixins";
@import "breakpoints";
@import "colors";
.title-image{
@include font-heading;
......@@ -20,7 +21,8 @@
padding-bottom: 5rem;
}
color: white;;
color: white;
background-color: $color-helmholtz-blue;
font-size: 4.25em;
background-size: cover;
word-wrap: break-word;
......
---
title: HIFIS
title-image: none
title-image: default
layout: default
author: none
---
......
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