Added structured data
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package fullpage
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"sort"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
@ -9,6 +11,17 @@ import (
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
var organization map[string]interface{}
|
||||
var organizationString string
|
||||
|
||||
func init() {
|
||||
// Load structured data
|
||||
organizationBytes, _ := ioutil.ReadFile("organization.json")
|
||||
json.Unmarshal(organizationBytes, &organization)
|
||||
organizationBytes, _ = json.Marshal(organization)
|
||||
organizationString = string(organizationBytes)
|
||||
}
|
||||
|
||||
// Render layout.
|
||||
func Render(ctx *aero.Context, content string) string {
|
||||
user := utils.GetUser(ctx)
|
||||
@ -33,5 +46,5 @@ func Render(ctx *aero.Context, content string) string {
|
||||
sort.Strings(tags)
|
||||
}
|
||||
|
||||
return components.Layout(ctx.App, ctx, user, openGraph, meta, tags, content)
|
||||
return components.Layout(ctx.App, ctx, user, openGraph, meta, tags, organizationString, content)
|
||||
}
|
||||
|
Reference in New Issue
Block a user