Upgraded to latest aero version

This commit is contained in:
2019-06-01 13:55:49 +09:00
parent ae591e5e7e
commit 28db818c37
196 changed files with 645 additions and 593 deletions

View File

@ -4,15 +4,16 @@ import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
"github.com/animenotifier/notify.moe/middleware"
"github.com/animenotifier/notify.moe/utils"
)
// Render layout.
func Render(ctx *aero.Context, content string) string {
func Render(ctx aero.Context, content string) string {
user := utils.GetUser(ctx)
openGraph, _ := ctx.Data.(*arn.OpenGraph)
customCtx := ctx.(*middleware.OpenGraphContext)
openGraph := customCtx.OpenGraph
// Make output order deterministic to profit from Aero caching.
// To do this, we need to create slices and sort the tags.

View File

@ -1,4 +1,4 @@
component Layout(ctx *aero.Context, user *arn.User, openGraph *arn.OpenGraph, meta, tags []string, content string)
component Layout(ctx aero.Context, user *arn.User, openGraph *arn.OpenGraph, meta, tags []string, content string)
html(lang="en")
head
link(rel="stylesheet", href="/styles", importance="high")
@ -6,7 +6,7 @@ component Layout(ctx *aero.Context, user *arn.User, openGraph *arn.OpenGraph, me
if openGraph != nil
title= openGraph.Tags["og:title"]
else
title= ctx.App.Config.Title
title= assets.Manifest.Name
//- Viewport
meta(name="viewport", content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes")