Improved OG data
This commit is contained in:
@ -2,6 +2,7 @@ package layout
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
@ -9,6 +10,6 @@ import (
|
||||
// Render layout.
|
||||
func Render(ctx *aero.Context, content string) string {
|
||||
user := utils.GetUser(ctx)
|
||||
meta, _ := ctx.Data.(map[string]string)
|
||||
return components.Layout(ctx.App, ctx, user, meta, content)
|
||||
openGraph, _ := ctx.Data.(*arn.OpenGraph)
|
||||
return components.Layout(ctx.App, ctx, user, openGraph, content)
|
||||
}
|
||||
|
@ -1,14 +1,17 @@
|
||||
component Layout(app *aero.Application, ctx *aero.Context, user *arn.User, meta map[string]string, content string)
|
||||
component Layout(app *aero.Application, ctx *aero.Context, user *arn.User, openGraph *arn.OpenGraph, content string)
|
||||
html(lang="en")
|
||||
head
|
||||
title= app.Config.Title
|
||||
|
||||
|
||||
meta(name="viewport", content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes")
|
||||
meta(name="theme-color", content=app.Config.Manifest.ThemeColor)
|
||||
|
||||
if meta != nil
|
||||
for property, value := range meta
|
||||
meta(name=property, value=value)
|
||||
if openGraph != nil
|
||||
for name, value := range openGraph.Meta
|
||||
meta(name=name, content=value)
|
||||
|
||||
for property, content := range openGraph.Tags
|
||||
meta(property=property, content=content)
|
||||
|
||||
link(rel="chrome-webstore-item", href="https://chrome.google.com/webstore/detail/hajchfikckiofgilinkpifobdbiajfch")
|
||||
link(rel="manifest", href="/manifest.json")
|
||||
|
Reference in New Issue
Block a user