slider for blog details

This commit is contained in:
Sebastian Frank
2019-03-11 16:38:44 +01:00
parent 2f2454ee54
commit 6c3f985d1f
9 changed files with 27 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,6 +6,21 @@
<meta name="keywords" content="{{ Meta.Keywords }}" /> <meta name="keywords" content="{{ Meta.Keywords }}" />
{% endblock meta %} {% 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 %} {% block part0 %}
<h1> <h1>
{{ Data.details.title }} {{ Data.details.title }}