package pages import ( "html/template" "github.com/labstack/echo/v4" "goth.stack/lib" ) type HomeProps struct { Title template.HTML Subtitle template.HTML Socials []lib.IconLink Tech []lib.IconLink ButtonsLinks []lib.ButtonLink } func Home(c echo.Context) error { socials := []lib.IconLink{ { Name: "Email", Href: "mailto:me@atri.dad", Icon: template.HTML(``), }, { Name: "RSS", Href: "/api/rss", Icon: template.HTML(``), }, { Name: "Github", Href: "https://github.com/atridadl/goth.stack", Icon: template.HTML(``), }, } tech := []lib.IconLink{ { Name: "Go", Href: "https://golang.org", Icon: template.HTML(`Go`), }, { Name: "Docker", Href: "https://docker.com", Icon: template.HTML(`Docker`), }, } buttons := []lib.ButtonLink{ { Name: "API Documentation", Href: "/api/swagger/index.html", Internal: false, }, { Name: "Posts", Href: "/posts", Internal: true, }, } props := HomeProps{ Title: "GOTH Stack", Subtitle: "A Modern Web Application Stack: Go + HTMX + Tailwind", Socials: socials, Tech: tech, ButtonsLinks: buttons, } partials := []string{"header", "navitems", "iconlinks", "buttonlinks"} return lib.RenderTemplate(c.Response().Writer, "base", partials, props) }