SEO

// init/seo.go
package appinit

import (
	"context"

	"golazy.dev/lazyseo"
)

func SEO(ctx context.Context) []lazyseo.Option {
	return []lazyseo.Option{
		lazyseo.SiteName("Sample App"),
		lazyseo.Description("A small GoLazy application."),
		lazyseo.Language("en"),
		lazyseo.Locale("en_US"),
		lazyseo.Type("website"),
	}
}
// init/app.go
package appinit

func App() *lazyapp.App {
	return lazyapp.New(lazyapp.Config{
		Name:         "sample_app",
		Drawer:       Draw,
		Public:       app.Public,
		Views:        app.Views,
		Dependencies: Dependencies,
		SEO:          SEO,
	})
}
{{/* app/views/layouts/app.html.tpl */}}
<!doctype html>
<html lang="{{seo_lang}}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {{seo}}
    {{stylesheet "/styles.css"}}
  </head>
  <body>{{.content}}</body>
</html>
// app/controllers/post_controller/postcontroller.go
package postcontroller

func (c *PostsController) Show(post *Post) error {
	c.Title(post.Title)
	c.Description(post.Summary)
	c.Canonical("https://example.com/posts/" + post.Slug)
	c.Set("post", post)
	return nil
}