Use string-extra.ellipsis to truncate descriptions
continuous-integration/drone/push Build is passing Details

This commit is contained in:
3wc 2021-07-20 13:50:30 +02:00
parent f53b4555cf
commit 468f7e1055
2 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,7 @@
"elm/regex": "1.0.0", "elm/regex": "1.0.0",
"elm/url": "1.0.0", "elm/url": "1.0.0",
"elm-community/json-extra": "4.3.0", "elm-community/json-extra": "4.3.0",
"elm-community/string-extra": "4.0.1",
"pablohirafuji/elm-markdown": "2.0.5" "pablohirafuji/elm-markdown": "2.0.5"
}, },
"indirect": { "indirect": {

View File

@ -11,6 +11,7 @@ import Spa.Document exposing (Document)
import Spa.Generated.Route as Route import Spa.Generated.Route as Route
import Spa.Page as Page exposing (Page) import Spa.Page as Page exposing (Page)
import Spa.Url as Url exposing (Url) import Spa.Url as Url exposing (Url)
import String.Extra exposing (ellipsis)
import Util exposing (Direction(..), andThen, by) import Util exposing (Direction(..), andThen, by)
@ -183,7 +184,7 @@ viewApp app =
, div [ class "card-body" ] , div [ class "card-body" ]
[ h5 [ class "card-title" ] [ h5 [ class "card-title" ]
[ a [ href app_href ] [ text app.name ] ] [ a [ href app_href ] [ text app.name ] ]
, p [] [ text (withDefault "" app.description) ] , p [] [ text (ellipsis 100 (withDefault "" app.description)) ]
, repository_link , repository_link
, website_link , website_link
, a [ class "card-link", href app_href ] , a [ class "card-link", href app_href ]