slider for blog details

This commit is contained in:
Sebastian Frank 2019-03-11 16:38:44 +01:00
parent 2f2454ee54
commit 6c3f985d1f
Signed by: apairon
GPG Key ID: 7270D06DDA7FE8C3
9 changed files with 27 additions and 6 deletions

View File

@ -44,7 +44,7 @@ func cleanUpMapValue(v interface{}) interface{} {
return cleanUpInterfaceArray(v)
case map[interface{}]interface{}:
return cleanUpInterfaceMap(v)
case string:
case string, bool, int, int8, int16, int32, int64, float32, float64:
return v
default:
return fmt.Sprintf("%v", v)

View File

@ -1,6 +1,6 @@
GET https://mark2web.basiscms.de/api/collections/get/mark2webBlog
?sort[date]=-1
&limit=1
&limit=101
&token=89ff216524093123bf7a0a10f7b273
###

View File

@ -11,6 +11,6 @@ Markdown:
ChromaStyle: monokai
Data:
debug: True
debug: False
matomoSiteId: 89
token: 89ff216524093123bf7a0a10f7b273 # cockpit api token

View File

@ -1,5 +1,6 @@
---
Data:
background: /img/folder.jpg
slider:
- img: /img/folder.jpg

View File

@ -1,5 +1,6 @@
---
Data:
background: /img/wire.jpg
slider:
- img: /img/wire.jpg

View File

@ -1,5 +1,6 @@
---
Data:
background: /img/write.jpg
slider:
- img: /img/write.jpg

View File

@ -1,5 +1,6 @@
---
Data:
background: /img/design.jpg
slider:
- img: /img/design.jpg

View File

@ -31,11 +31,11 @@
<header id="header">
<div class="container">
<div class="logo" {% if not Data.slider %}style="max-width: 400px;"{% endif %}>
<div class="logo" {% if not Data.slider and not Data.details.slider %}style="max-width: 400px;"{% endif %}>
<a href="{{ "/"|relative_path }}">
<picture>
<source media="(max-width: 768px)" srcset="project-files/img/logo_text.png">
<img src="project-files/img/logo{% if not Data.slider %}_text{% endif %}.png" alt="mark2web Logo">
<img src="project-files/img/logo{% if not Data.slider and not Data.details.slider %}_text{% endif %}.png" alt="mark2web Logo">
</picture>
</a>
</div>
@ -52,6 +52,7 @@
<!-- ========== Slider ========== -->
<section class="slider white_arrows" data-dots="true" data-arrows="true">
{% block slider %}
{% for sl in Data.slider %}
<div class="slide">
<img
@ -62,6 +63,7 @@
alt="{{ sl.alt }}" style="opacity:{{ sl.opacity|default:1 }}">
</div>
{% endfor %}
{% endblock slider %}
</section>
<!-- ========== Navigation ========== -->
@ -124,7 +126,7 @@
<pre>{{ Data|json:"pretty" }}</pre>
<h3>NavMap</h3>
<pre>{{ NavMap|json: "pretty" }}</pre>
<pre>{{ NavMap|json:"pretty" }}</pre>
{% endif %}

View File

@ -6,6 +6,21 @@
<meta name="keywords" content="{{ Meta.Keywords }}" />
{% endblock meta %}
{% if Data.details.slider %}
{% block slider %}
{% for sl in Data.details.slider %}
<div class="slide">
<img
src="{{ "https://mark2web.basiscms.de"|add:sl.path|image_process:"p=fill,w=1440,h=600,q=60" }}"
srcset="{{ "https://mark2web.basiscms.de"|add:sl.path|image_process:"p=fill,w=768,h=384,q=60" }} 768w,
{{ "https://mark2web.basiscms.de"|add:sl.path|image_process:"p=fill,w=1440,h=600,q=60" }} 1440w,
{{ "https://mark2web.basiscms.de"|add:sl.path|image_process:"p=fill,w=1920,h=800,q=60" }} 1920w"
alt="{{ sl.meta.title }}">
</div>
{% endfor %}
{% endblock slider %}
{% endif %}
{% block part0 %}
<h1>
{{ Data.details.title }}