Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
HIFIS
software.hifis.net
Commits
bfeab8ab
Commit
bfeab8ab
authored
Oct 23, 2019
by
Huste, Tobias (FWCC) - 111645
Committed by
Erxleben, Fredo
Oct 23, 2019
Browse files
Display elements only if content is defined in frontpage templates
parent
89279aba
Pipeline
#17343
passed with stages
in 10 minutes and 28 seconds
Changes
3
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
_includes/frontpage/event-card.html
View file @
bfeab8ab
{% assign event = include.event %}
{% assign location = site.data.hifis_organizations[event.location.campus] %}
{% if event %}
<div
class=
"frontpage-card"
>
<div
class=
"card-body"
>
{% if event.start.date %}
<span
class=
"badge badge-danger"
>
<i
class=
"fas fa-calendar-day"
aria-hidden=
"true"
></i>
{{ event.start.date | date_to_string }}
</span>
{% endif %}
{% if event.type %}
<span
class=
"badge badge-secondary"
>
<i
class=
"fas fa-flag"
aria-hidden=
"true"
></i>
{{ event.type | capitalize }}
</span>
{% endif %}
{% if location.city %}
<span
class=
"badge badge-primary"
>
<i
class=
"fas fa-location-arrow"
aria-hidden=
"true"
></i>
{{ location.city }}
</span>
{% endif %}
{% if event.title %}
<h3
class=
"card-title"
>
<a
href=
"{{ event.url | relative_url }}"
>
{{ event.title }}
</a>
</h3>
<p
class=
"card-text"
>
{{ event.excerpt | strip_html | slice: 0, 150 }}
</p>
{% else %}
<!--
WARNING: event has no title defined
-->
{% endif %}
{% if event.excerpt %}
<p
class=
"card-text"
>
{{ event.excerpt | strip_html | slice: 0, 150 }}
</p>
{% endif %}
<a
href=
"{{ event.url | relative_url }}"
class=
"btn btn-primary"
>
<i
class=
"fas fa-info-circle"
aria-hidden=
"true"
></i>
More
</a>
</div>
</div>
{% else %}
<!--
WARNING: frontpage/event-card.html was included,
but no event object was defined
-->
{% endif %}
_includes/frontpage/image-card.html
View file @
bfeab8ab
...
...
@@ -2,9 +2,20 @@
{% assign url = include.url %}
{% assign caption = include.caption %}
<div
class=
"frontpage-image-card"
>
{% if image_path %}
<img
src=
"{{ image_path | relative_url }}"
class=
"card-img"
alt=
"{{ caption }}"
>
{% else %}
<!--
WARNING: frontpage/image-card.html was included but now image was
defined
-->
{% endif %}
<div
class=
"card-img-overlay"
>
{% if caption %}
<h3
class=
"card-title"
>
{{ caption }}
</h3>
{% endif %}
{% if url %}
<a
href=
"{{ url | relative_url }}"
class=
"btn btn-outline-light"
>
Learn more
</a>
{% endif %}
</div>
</div>
_includes/frontpage/post-card.html
View file @
bfeab8ab
{% assign post = include.post %}
<div
class=
"frontpage-card"
>
<div
class=
"card-body"
>
{% if post.title %}
<a
href=
"{{ post.url | relative_url }}"
>
<h3
class=
"card-title"
>
{{ post.title }}
</h3>
</a>
{% else %}
<!--
WARNING: frontpage/post-card.html was include, but no post title
is defined.
-->
{% endif %}
{% if post.date %}
<div>
<i
class=
"fas fa-calendar-day"
aria-hidden=
"true"
></i>
{{ post.date | date_to_string }}
</div>
{% endif %}
<div>
{% for category in post.categories %}
<span
class=
"badge badge-secondary"
aria-hidden=
"true"
>
{{ category | upcase }}
</span>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment