package pages
import (
"html/template"
"atri.dad/lib"
"github.com/labstack/echo/v4"
)
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: "Git",
Href: "https://git.atri.dad/atridad",
Icon: template.HTML(``),
},
{
Name: "Bluesky",
Href: "https://bsky.app/profile/atri.dad",
Icon: template.HTML(``),
},
}
tech := []lib.IconLink{
{
Name: "React",
Href: "https://react.dev",
Icon: template.HTML(``),
},
{
Name: "TypeScript",
Href: "https://typescriptlang.org",
Icon: template.HTML(``),
},
{
Name: "Node.js",
Href: "https://nodejs.org",
Icon: template.HTML(``),
},
{
Name: "Go",
Href: "https://golang.org",
Icon: template.HTML(``),
},
{
Name: "PostgreSQL",
Href: "https://postgresql.org",
Icon: template.HTML(``),
},
{
Name: "Redis",
Href: "https://redis.io",
Icon: template.HTML(``),
},
{
Name: "Docker",
Href: "https://docker.com",
Icon: template.HTML(``),
},
{
Name: "NixOS",
Href: "https://nixos.org",
Icon: template.HTML(``),
},
}
buttons := []lib.ButtonLink{
{
Name: "Resumé",
Href: "/public/files/Atridad_Lahiji_Resume.pdf",
Internal: false,
},
{
Name: "Posts",
Href: "/posts",
Internal: true,
},
}
props := HomeProps{
Title: "Hi, I'm Atridad",
Subtitle: "Researcher, Full-Stack Developer, and IT Professional.",
Socials: socials,
Tech: tech,
ButtonsLinks: buttons,
}
// Specify the partials used by this page
partials := []string{"header", "navitems", "iconlinks", "buttonlinks"}
// Render the template
return lib.RenderTemplate(c.Response().Writer, "base", partials, props)
}