Add news and audio shortcode

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2024-04-26 12:03:40 +02:00
parent 462244bd1b
commit 8b710bf7e5
8 changed files with 63 additions and 10 deletions

View file

@ -0,0 +1,7 @@
---
title: "We''re also happy that we make our users happy 🙃"
date: 2024-04-26T09:20:10+00:00
slug: "we-re-also-happy-that-we-make-our-users-happy"
---
We're also happy that we make our users happy 🙃

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -0,0 +1,37 @@
---
title: "Travel with Organic Maps song"
date: 2024-04-26T09:23:52+00:00
slug: "travel-with-organic-maps-song"
---
One of [our users](https://t.me/OrganicMapsZH/95) has generated a song about Organic Maps. How does it sound to you? 😄
### Travel with Organic Maps song
{{ audio(title="Travel with Organic Maps", url="/news/2024-04-26/travel-with-organic-maps-song/Travel with Organic Maps.mp3") }}
<pre>
(Verse 1)
Beneath the twinkling stars, I stroll hand in hand,
With Organic Maps, exploring enchanted lands.
From Eiffel's gentle glow to Iceland's black sand shore,
Every step a melody, every sight, pure amore.
(Verse 2)
Through Rome's timeless Colosseum, echoes of history's might,
And Egypt's majestic pyramids, kissing the sun's light.
Organic Maps, a faithful guide, whispers tales of yore,
In its embrace, I find solace, forevermore.
(Chorus)
Travel with Organic Maps, a symphony of peace,
From OpenStreetMap's embrace, all worries cease.
Crafted with love, by volunteers' tender care,
Every destination, a moment rare.
(Outro)
So let's dance along, in this magical flight,
With Organic Maps, our hearts take flight.
In every corner of this earth we roam,
With Organic Maps, we'll always find home.
</pre>

View file

@ -0,0 +1,5 @@
---
date: 2024-04-26
sort_by: date
template: news/date_section.html
---

View file

@ -23,7 +23,7 @@
{# Display wide images below the text instead of to the right. #}
{% set_global noflex = '' %}
{% for photo in page.assets %}
{% if photo is not ending_with(".mp4") %}
{% if photo is not matching("\.mp[34]$") %}
{% set meta = get_image_metadata(path=photo) %}
{% if meta.width > meta.height %}
{% set_global noflex = '_noflex' %}
@ -38,7 +38,7 @@
<span class="news_images">
{% for photo in page.assets | sort %}
{% if photo is not ending_with(".mp4") %}
{% if photo is not matching("\.mp[34]$") %}
{% set meta = get_image_metadata(path=photo) %}
<img class="news_image{% if meta.width > meta.height %}_landscape{% endif %}" src="{{ page.path | safe }}{{ photo | split(pat='/') | last }}" />
{% endif %}

View file

@ -9,14 +9,14 @@
</div>
{% for media in resource.assets | sort %}
{% if media is not ending_with(".mp4") %}
{% set meta = get_image_metadata(path=media) %}
<img class="news_image{% if meta.width > meta.height %}_landscape{% endif %}" src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" />
{% else %}
<video class="news_video" controls autoplay muted>
<source src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" type="video/mp4">
</video>
{% if media is ending_with(".mp4") %}
<video class="news_video" controls autoplay muted>
<source src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" type="video/mp4">
</video>
{% elif media is ending_with(".mp3") %}
{% else %} {# Match remaining file types as images #}
{% set meta = get_image_metadata(path=media) %}
<img class="news_image{% if meta.width > meta.height %}_landscape{% endif %}" src="{{ resource_path | safe }}{{ media | split(pat='/') | last }}" />
{% endif %}
{% endfor %}

View file

@ -0,0 +1,4 @@
<figure>
<audio controls src="{{ url }}"></audio>
<figcaption><a href="{{ url }}">{{ title }}</a></figcaption>
</figure>