Template
1
0
Fork 0

Made testimonials great again

This commit is contained in:
Atridad Lahiji 2024-04-12 11:31:41 -06:00
parent 0a91add585
commit 041674be8d
No known key found for this signature in database
11 changed files with 137 additions and 58 deletions

View file

@ -18,3 +18,9 @@ type CardLink struct {
Tags []string
Internal bool
}
type ButtonLink struct {
Name string
Href string
Internal bool
}

View file

@ -66,6 +66,7 @@ func main() {
e.GET("/", pages.Home)
e.GET("/projects", pages.Projects)
e.GET("/talks", pages.Talks)
e.GET("/testimonials", pages.Testimonials)
e.GET("/blog", pages.Blog)
e.GET("/post/:post", pages.Post)
e.GET("/rss", pages.RSSFeedHandler)

View file

@ -10,9 +10,7 @@ import (
type HomeProps struct {
Socials []lib.IconLink
Tech []lib.IconLink
ContractLink string
ResumeURL string
SupportLink string
ButtonsLinks []lib.ButtonLink
}
func Home(c echo.Context) error {
@ -137,16 +135,37 @@ func Home(c echo.Context) error {
},
}
buttons := []lib.ButtonLink{
{
Name: "Contract Me",
Href: "mailto:contract@atri.dad",
Internal: false,
},
{
Name: "Resumé",
Href: lib.GeneratePublicURL("Atridad_Lahiji_Resume.pdf"),
Internal: false,
},
{
Name: "Testimonials",
Href: "/testimonials",
Internal: true,
},
{
Name: "Support 🩵",
Href: "https://donate.stripe.com/8wMeVF25c78L0V2288",
Internal: false,
},
}
props := HomeProps{
Socials: socials,
Tech: tech,
ContractLink: "mailto:contract@atri.dad",
ResumeURL: lib.GeneratePublicURL("Atridad_Lahiji_Resume.pdf"),
SupportLink: "https://donate.stripe.com/8wMeVF25c78L0V2288",
ButtonsLinks: buttons,
}
// Specify the partials used by this page
partials := []string{"header", "navitems"}
partials := []string{"header", "navitems", "iconlinks", "buttonlinks"}
// Render the template
return lib.RenderTemplate(c.Response().Writer, "base", partials, props)

View file

@ -24,70 +24,26 @@ Atridad Lahiji // Root
<h2 class="mb-2 text-xl text-white sm:text-[1.5rem]">Places I exist:</h2>
<div class="flex flex-row flex-wrap items-center justify-center gap-4 text-center">
{{range .Socials}}
{{if eq .Name "Spotify"}}
<div class="indicator indicator-top indicator-end">
<div hx-ext="sse" sse-connect="/api/sse?channel=spotify" sse-swap="message">
<span class="link link-hover link-success" hx-get="/api/spotify/nowplaying" hx-trigger="load" hx-swap="self">
</span>
</div>
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
{{.Icon}}
</a>
</div>
{{else}}
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
{{.Icon}}
</a>
{{end}}
{{template "iconlinks" .}}
{{end}}
</div>
</span>
<span>
<h2 class="mb-2 text-xl text-white sm:text-[1.5rem]">Stuff I Use:</h2>
<div class="flex flex-row flex-wrap items-center justify-center gap-4 text-center">
{{range .Tech}}
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
{{.Icon}}
</a>
{{template "iconlinks" .}}
{{end}}
</div>
</span>
<div class="flex flex-row flex-wrap gap-2">
<a class="btn btn-primary btn-outline btn-md lg:btn-lg" href={{.ContractLink}} target="_blank" rel="noreferrer">
Contract Me
</a>
<a class="btn btn-primary btn-outline btn-md lg:btn-lg" href={{.ResumeURL}} target="_blank" rel="noreferrer">
Resumé
</a>
<a class="btn btn-primary btn-outline btn-md lg:btn-lg" href={{.SupportLink}} target="_blank" rel="noreferrer">
Support 🩵
</a>
{{range .ButtonsLinks}}
{{template "buttonlinks" .}}
{{end}}
</div>
<span>
<h2 class="mb-2 text-xl text-white sm:text-[1.5rem]">Things People Say About Me:</h2>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
<div>
<img class="object-cover object-center w-full max-w-full rounded-lg" src="/public/img/testimonials/1.png"
alt="Review of Atri" loading="lazy" />
</div>
<div>
<img class="object-cover object-center w-full max-w-full rounded-lg" src="/public/img/testimonials/2.png"
alt="Review of Atri" loading="lazy" />
</div>
<div>
<img class="object-cover object-center w-full max-w-full rounded-lg" src="/public/img/testimonials/3.png"
alt="Review of Atri" loading="lazy" />
</div>
</div>
</span>
{{end}}
{{define "foot"}}

View file

@ -0,0 +1,15 @@
{{define "buttonlinks"}}
{{if eq true .Internal}}
<a class="btn btn-primary btn-outline btn-md lg:btn-lg" href={{.Href}}>
{{.Name}}
</a>
{{else}}
<a class="btn btn-primary btn-outline btn-md lg:btn-lg" href={{.Href}} target="_blank" rel="noreferrer">
{{.Name}}
</a>
{{end}}
{{end}}

View file

@ -0,0 +1,18 @@
{{define "iconlinks"}}
{{if eq .Name "Spotify"}}
<div class="indicator indicator-top indicator-end">
<div hx-ext="sse" sse-connect="/api/sse?channel=spotify" sse-swap="message">
<span class="link link-hover link-success" hx-get="/api/spotify/nowplaying" hx-trigger="load" hx-swap="self">
</span>
</div>
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
{{.Icon}}
</a>
</div>
{{else}}
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
{{.Icon}}
</a>
{{end}}
{{end}}

View file

@ -14,6 +14,11 @@
Talks
</a>
</li>
<li>
<a class="no-underline" href="/testimonials">
Testimonials
</a>
</li>
<li>
<a class="no-underline" href="/tools">
Tools

View file

@ -0,0 +1,30 @@
{{define "title"}}
Atridad Lahiji // Testimonials
{{end}}
{{define "headercontent"}}
Atridad Lahiji // Testimonials
{{end}}
{{define "head"}}
<link rel="stylesheet" href="/public/css/styles.testimonials.css" />
{{end}}
{{define "main"}}
<h1 class="text-4xl font-extrabold text-white sm:text-8xl">
What People Say About Me
</h1>
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
{{range .Images}}
<div>
<img class="object-cover object-center w-full max-w-full rounded-lg" src={{.}} alt="Review of Atri"
loading="lazy" />
</div>
{{end}}
</div>
{{end}}
{{define "foot"}}
{{end}}

28
pages/testimonials.go Normal file
View file

@ -0,0 +1,28 @@
package pages
import (
"atri.dad/lib"
"github.com/labstack/echo/v4"
)
type TestimonialsProps struct {
Images []string
}
func Testimonials(c echo.Context) error {
images := []string{
"/public/img/testimonials/1.png",
"/public/img/testimonials/2.png",
"/public/img/testimonials/3.png",
}
props := TestimonialsProps{
Images: images,
}
// Specify the partials used by this page
partials := []string{"header", "navitems"}
// Render the template
return lib.RenderTemplate(c.Response().Writer, "base", partials, props)
}

File diff suppressed because one or more lines are too long

1
public/css/styles.testimonials.css vendored Normal file

File diff suppressed because one or more lines are too long