theplant / containers

Better structures for building web applications
1 stars 0 forks source link

meta tags #1

Closed bodhi closed 7 years ago

bodhi commented 7 years ago

how to support setting meta tags (eg. page title)

sunfmin commented 7 years ago

implement a layout for page just like containers, but comply Layout interface:

func MainLayout(r *http.Request, body string) (html string, err error) {
    html = LayoutTemplate(body)
    return
}
@{
    import  (
    )
    var body string
}
<html>
    <head>Containers Example</head>
  <body>
      @raw(body)
  </body>
</html>
bodhi commented 7 years ago

The problem is more: can a container affect the content outside of itself. It could be done via the request context, but this becomes hidden logic...

sunfmin commented 7 years ago

No, container shouldn't affect anything outside of containers, If you want to effect layout Or many containers. You should write a middleware to setup things in Context, and config the middleware for those pages who depends on it.

bodhi commented 7 years ago

No, container shouldn't affect anything outside of containers

Seems reasonable to me. It's kinda related to #11 where you do want to affect containers ;)