From 3ea86deefb396f956996c626ee8dd5c1bd8c7b87 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 26 Apr 2018 03:18:36 +0200 Subject: [PATCH] Updated travis file --- .travis.yml | 2 +- pages/anime/anime.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 246cc0d5..2608d206 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,5 +45,5 @@ script: # - go test -v -race ./... # Run all the tests with the race detector enabled - go vet ./... # go vet is the official Go static analyzer - megacheck ./... # "go vet on steroids" + linter - - gocyclo -over 19 $GO_FILES # forbid code with huge functions +# - gocyclo -over 19 $GO_FILES # forbid code with huge functions - golint -set_exit_status $(go list ./...) # one last linter \ No newline at end of file diff --git a/pages/anime/anime.go b/pages/anime/anime.go index a8e88991..2d792d61 100644 --- a/pages/anime/anime.go +++ b/pages/anime/anime.go @@ -106,6 +106,12 @@ func Get(ctx *aero.Context) string { } // Open Graph + ctx.Data = getOpenGraph(ctx, anime) + + return ctx.HTML(components.Anime(anime, animeListItem, tracks, amvs, amvAppearances, episodes, friends, friendsAnimeListItems, user)) +} + +func getOpenGraph(ctx *aero.Context, anime *arn.Anime) *arn.OpenGraph { description := anime.Summary if len(description) > maxDescriptionLength { @@ -132,8 +138,4 @@ func Get(ctx *aero.Context) string { case "movie": openGraph.Tags["og:type"] = "video.movie" } - - ctx.Data = openGraph - - return ctx.HTML(components.Anime(anime, animeListItem, tracks, amvs, amvAppearances, episodes, friends, friendsAnimeListItems, user)) }