diff options
Diffstat (limited to 'themes/default/layouts/partials/feeds-generate.html')
-rw-r--r-- | themes/default/layouts/partials/feeds-generate.html | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/themes/default/layouts/partials/feeds-generate.html b/themes/default/layouts/partials/feeds-generate.html index cec17d8..24ed9a8 100644 --- a/themes/default/layouts/partials/feeds-generate.html +++ b/themes/default/layouts/partials/feeds-generate.html @@ -81,16 +81,18 @@ {{ $feeds = $feeds | append (dict - "FeedTitle" ($title | plainify | htmlUnescape) - "FeedLink" ($link | plainify | htmlUnescape) - "FeedDescription" (delimit ($description | plainify | htmlUnescape | findRE "^([^.|:|?|!]+)") " ") "FeedContent" ($content | plainify | htmlUnescape) - "FeedSourceTitle" ($sourceTitle | plainify | htmlUnescape) - "FeedSourceLink" ($sourceLink | plainify | htmlUnescape) - "FeedSourceDescription" ($sourceDescription | plainify | htmlUnescape) "FeedDate" ($date | plainify | htmlUnescape | time.Format "January 2, 2006") "FeedDateTime" ($dateTime | plainify | htmlUnescape | time.Format "2006-01-02T15:04:05Z") "FeedDateTitle" ($dateTitle | plainify | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST") + "FeedDescription" (delimit ($description | plainify | htmlUnescape | findRE "^([^.|:|?|!]+)") " ") + "FeedLink" ($link | plainify | htmlUnescape) + "FeedName" (delimit ((delimit (first 3 (split ($sourceTitle | plainify | htmlUnescape) " ")) " ") | findRE "^([^.|:|?|!]+)") " " | replaceRE "[^a-zA-Z ]" "") + "FeedSourceDescription" ($sourceDescription | plainify | htmlUnescape) + "FeedSourceLink" ($sourceLink | plainify | htmlUnescape) + "FeedSourceTitle" ($sourceTitle | plainify | htmlUnescape) + "FeedTitle" ($title | plainify | htmlUnescape) + "FeedSourceDomain" ($sourceLink | plainify | htmlUnescape | replaceRE "^https?://([^/]+).*" "$1") ) }} @@ -100,13 +102,19 @@ {{ range $feeds }} {{ $template := resources.Get "templates/markdown.yaml" }} + {{ $name := urlize (replace .FeedTitle "/" "-") }} + {{ $path := print "/data/generates/content/" $author.user "/feeds/" $name ".md" }} {{ $markdown := resources.ExecuteAsTemplate - (print "/data/generators/content/" $author.user "/feeds/" (urlize (replace .FeedTitle "/" "-")) ".md") + $path (dict - "content" (print (or .FeedDescription .FeedTitle) ".") - "tags" "[rss]" - "rss" true - "date" .FeedDateTime + "content" (print (or .FeedDescription .FeedTitle) ".") + "date" .FeedDateTime + "tags" "[rss]" + "feedName" .FeedName + "feedDomain" .FeedSourceDomain + "feedLink" .FeedLink + "feedSelf" (print $author.user "/feeds/" $name "/") + "feedRaw" (strings.TrimLeft "/" $path) ) $template }} @@ -116,7 +124,7 @@ <web-ring> <h1>Web Ring</h1> <aside> - {{ range first 3 (sort $feeds "FeedDateTime" "desc") }} + {{ range first 4 (sort $feeds "FeedDateTime" "desc") }} <web-ring-item> <header> <a |