diff --git a/api/trending.go b/api/trending.go index f6f38a0..b69a345 100644 --- a/api/trending.go +++ b/api/trending.go @@ -4,7 +4,6 @@ import ( "fmt" "io" "net/http" - "os" "strings" "sync" @@ -69,7 +68,6 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e return []Submission{}, err } - os.Stdout.Write(body) data := gjson.Parse(string(body)) wg := sync.WaitGroup{} @@ -105,7 +103,5 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e wg.Wait() client.Cache.Set(fmt.Sprintf("trending-%s-%s-%s", section, sort, page), posts, cache.DefaultExpiration) - // TODO: Cache trending - // client.Cache.Set(tag+sort+page+"-tag", tagData, cache.DefaultExpiration) return posts, nil } diff --git a/views/trending.hbs b/views/trending.hbs index 476e2e1..f460175 100644 --- a/views/trending.hbs +++ b/views/trending.hbs @@ -18,22 +18,42 @@

Trending

-
- {{#equal section "hot"}} - Hot - New - Top - {{/equal}} - {{#equal section "new"}} - Hot - New - Top - {{/equal}} - {{#equal section "top"}} - Hot - New - Top - {{/equal}} +
+
+ {{#equal section "hot"}} + Hot + New + Top + {{/equal}} + {{#equal section "new"}} + Hot + New + Top + {{/equal}} + {{#equal section "top"}} + Hot + New + Top + {{/equal}} +
+
+
+ {{#equal sort "popular"}} + Popular + Newest + Best + {{/equal}} + {{#equal sort "newest"}} + Popular + Newest + Best + {{/equal}} + {{#equal sort "best"}} + Popular + Newest + Best + {{/equal}} +