summaryrefslogtreecommitdiffstats
path: root/front_end/templates/serp.rs.html
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2019-08-24 11:11:11 +0100
committerKornel <kornel@geekhood.net>2019-08-24 11:12:33 +0100
commitf2fed82d7a8b7d4ac575ae194947d2a5a3538a5e (patch)
tree411dbc06af2efc8a9c5bc31c99c64f006741a063 /front_end/templates/serp.rs.html
parentae8dc3d82d6db529dd0a1a3c54cdb50371a9a753 (diff)
Trim long descriptions
Diffstat (limited to 'front_end/templates/serp.rs.html')
-rw-r--r--front_end/templates/serp.rs.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/front_end/templates/serp.rs.html b/front_end/templates/serp.rs.html
index 243cdfe..fa63f95 100644
--- a/front_end/templates/serp.rs.html
+++ b/front_end/templates/serp.rs.html
@@ -1,5 +1,6 @@
@use crate::templates::base;
@use crate::Urler;
+@use crate::limit_text_len;
@use crate::SearchPage;
@use crate::SearchKind;
@use rich_crate::Origin;
@@ -74,7 +75,7 @@
<li>
<a href="@url.crate_by_origin(&c.origin)"><div class=h>
<h4>@if let Some((repo, _)) = c.origin.repo() {@repo.owner/}@c.crate_name</h4>
- <p class=desc>@p.render_markdown_str(&c.description)</p>
+ <p class=desc>@p.render_markdown_str(&limit_text_len(&c.description, 180, 220))</p>
</div>
<div class=meta>
<span class="version @p.version_class(&c.version)"><span>@if let Origin::GitHub{..} = c.origin {GitHub } else {v}</span>@c.version</span>