feat: truncate description

This commit is contained in:
2025-06-15 17:42:02 +02:00
parent 623ca8bc0a
commit 89e001bd17
2 changed files with 4 additions and 1 deletions

View File

@@ -19,3 +19,6 @@ function geojson_to_searchable_string(location) {
return ifdef(location.properties.name, "", ", ") + ifdef(location.properties.street, "", ifdef(location.properties.housenumber, " ",", ")) + ifdef(location.properties.city, "", ", ") + ifdef(location.properties.country, "", "")
}
function truncate(str, n, url){
return (str.length > n) ? str.slice(0, n-1) + '<a href="' + url + '">&hellip;</a>' : str;
};

View File

@@ -161,7 +161,7 @@
<div class="column">
<strong><a class="is-size-7" href="${url}">${title}</a></strong><br>
<span><strong>{% translate 'Ort' %}</strong>: ${location_hr}</span><br>
<p class="is-size-7">${description}</p>r
<p class="is-size-7">${truncate(description, 80, url)}</p>
</div>
<div class="column">
<figure class="image is-128x128">