frontend.go 676 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "golang-fave/engine/wrapper"
  4. )
  5. type MenuItem struct {
  6. Name string
  7. Link string
  8. Active bool
  9. }
  10. type TmplData struct {
  11. MetaTitle string
  12. MetaKeywords string
  13. MetaDescription string
  14. MenuItems []MenuItem
  15. }
  16. func handleFrontEnd(e *wrapper.Wrapper) bool {
  17. return e.TmplFrontEnd("index", TmplData{
  18. MetaTitle: "Meta Title",
  19. MetaKeywords: "Meta Keywords",
  20. MetaDescription: "Meta Description",
  21. MenuItems: []MenuItem{
  22. {Name: "Home", Link: "/", Active: true},
  23. {Name: "Item 1", Link: "/#1", Active: false},
  24. {Name: "Item 2", Link: "/#2", Active: false},
  25. {Name: "Item 3", Link: "/#3", Active: false},
  26. },
  27. })
  28. }