diff options
| author | tdro <tdro@noreply.example.com> | 2022-05-26 16:44:14 -0400 |
|---|---|---|
| committer | tdro <tdro@noreply.example.com> | 2022-05-26 16:44:14 -0400 |
| commit | 3d8a3b0f52a55e706187b83dafa292999fec8295 (patch) | |
| tree | 8dbcb6c5a55542b2bed750ee7f92fe515e80b376 | |
| parent | f4fc7fcc6228cb5bdf69fe7a3d2c75070a7a7fb4 (diff) | |
| download | canory-3d8a3b0f52a55e706187b83dafa292999fec8295.tar.gz canory-3d8a3b0f52a55e706187b83dafa292999fec8295.tar.bz2 canory-3d8a3b0f52a55e706187b83dafa292999fec8295.zip | |
themes/default/layouts/partials/feeds-generate: Get longest text length
Between source title and description.
| -rw-r--r-- | themes/default/layouts/partials/feeds-generate.html | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/themes/default/layouts/partials/feeds-generate.html b/themes/default/layouts/partials/feeds-generate.html index 2f0e0bd..d66427c 100644 --- a/themes/default/layouts/partials/feeds-generate.html +++ b/themes/default/layouts/partials/feeds-generate.html @@ -104,12 +104,18 @@ {{ $template := resources.Get "templates/markdown-feed.yaml" }} {{ $name := urlize (replace .FeedTitle "/" "-") }} {{ $path := print "/data/generates/content/" $author.user "/feeds/" $name ".md" }} + + {{ $entitle := .FeedSourceTitle }} + {{ if gt (len .FeedSourceDescription) (len .FeedSourceTitle) }} + {{ $entitle = .FeedSourceDescription }} + {{ end }} + {{ $markdown := resources.ExecuteAsTemplate $path (dict "content" (print (or .FeedDescription .FeedTitle) ".") "date" .FeedDateTime - "description" .FeedSourceTitle + "description" $entitle "domain" .FeedSourceDomain "link" .FeedLink "name" .FeedName |
