Made testimonials great again
This commit is contained in:
parent
0a91add585
commit
041674be8d
11 changed files with 137 additions and 58 deletions
|
@ -18,3 +18,9 @@ type CardLink struct {
|
|||
Tags []string
|
||||
Internal bool
|
||||
}
|
||||
|
||||
type ButtonLink struct {
|
||||
Name string
|
||||
Href string
|
||||
Internal bool
|
||||
}
|
||||
|
|
1
main.go
1
main.go
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"}}
|
||||
|
|
15
pages/templates/partials/buttonlinks.html
Normal file
15
pages/templates/partials/buttonlinks.html
Normal 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}}
|
18
pages/templates/partials/iconlinks.html
Normal file
18
pages/templates/partials/iconlinks.html
Normal 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}}
|
|
@ -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
|
||||
|
|
30
pages/templates/testimonials.html
Normal file
30
pages/templates/testimonials.html
Normal 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
28
pages/testimonials.go
Normal 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)
|
||||
}
|
2
public/css/styles.home.css
vendored
2
public/css/styles.home.css
vendored
File diff suppressed because one or more lines are too long
1
public/css/styles.testimonials.css
vendored
Normal file
1
public/css/styles.testimonials.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue