Pubs
This commit is contained in:
parent
61c969c9de
commit
8d29cc2b1a
11 changed files with 121 additions and 11 deletions
|
@ -14,5 +14,5 @@ This is my personal website!
|
|||
1. Run ```go get```
|
||||
2. Duplicate the .env.example file and call it .env
|
||||
3. Fill out the required .env values
|
||||
4. Run ```go install github.com/cosmtrek/air@latest``` to download Air for live reload
|
||||
4. Run ```go install github.com/air-verse/air@latest``` to download Air for live reload
|
||||
5. Run ```air``` to start the dev server (macOS and Linux only)
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
|||
module atri.dad
|
||||
|
||||
go 1.23.1
|
||||
go 1.23
|
||||
|
||||
require (
|
||||
github.com/alecthomas/chroma/v2 v2.14.0
|
||||
|
|
1
main.go
1
main.go
|
@ -51,6 +51,7 @@ func main() {
|
|||
e.GET("/", pages.Home)
|
||||
e.GET("/projects", pages.Projects)
|
||||
e.GET("/talks", pages.Talks)
|
||||
e.GET("/pubs", pages.Pubs)
|
||||
e.GET("/posts", pages.Posts)
|
||||
e.GET("/posts/:post", pages.Post)
|
||||
e.GET("/tools", pages.Tools)
|
||||
|
|
24
pages/pubs.go
Normal file
24
pages/pubs.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package pages
|
||||
|
||||
import (
|
||||
"atri.dad/lib"
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type PubProps struct {
|
||||
Pubs []lib.CardLink
|
||||
}
|
||||
|
||||
func Pubs(c echo.Context) error {
|
||||
pubs := []lib.CardLink{}
|
||||
|
||||
props := PubProps{
|
||||
Pubs: pubs,
|
||||
}
|
||||
|
||||
// Specify the partials used by this page
|
||||
partials := []string{"header", "navitems", "cardlinks"}
|
||||
|
||||
// Render the template
|
||||
return lib.RenderTemplate(c.Response().Writer, "base", partials, props)
|
||||
}
|
|
@ -5,6 +5,9 @@
|
|||
<li>
|
||||
<a class="no-underline" href="/projects"> Projects </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/pubs"> Publications </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/talks"> Talks </a>
|
||||
</li>
|
||||
|
|
|
@ -11,6 +11,8 @@ Atridad Lahiji // Blog
|
|||
{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
|
||||
{{if .Posts}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
{{range .Posts}}
|
||||
{{template "cardlinks" .}}
|
||||
|
@ -18,5 +20,15 @@ Atridad Lahiji // Blog
|
|||
</section>
|
||||
{{end}}
|
||||
|
||||
{{if not .Posts}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
<h2 class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]">
|
||||
Nothing to see here (yet)!
|
||||
</h2>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
{{end}}
|
|
@ -11,12 +11,24 @@ Atridad Lahiji // Projects
|
|||
{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
|
||||
{{if .Projects}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
{{range .Projects}}
|
||||
{{template "cardlinks" .}}
|
||||
{{end}}
|
||||
{{range .Projects}}
|
||||
{{template "cardlinks" .}}
|
||||
{{end}}
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{if not .Projects}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
<h2 class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]">
|
||||
Nothing to see here (yet)!
|
||||
</h2>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
{{end}}
|
||||
|
|
34
pages/templates/pubs.html
Normal file
34
pages/templates/pubs.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
{{define "title"}}
|
||||
Atridad Lahiji // Publications
|
||||
{{end}}
|
||||
|
||||
{{define "headercontent"}}
|
||||
Atridad Lahiji // Publications
|
||||
{{end}}
|
||||
|
||||
{{define "head"}}
|
||||
<link rel="stylesheet" href="/public/css/styles.css" />
|
||||
{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
|
||||
{{if .Pubs}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
{{range .Pubs}}
|
||||
{{template "cardlinks" .}}
|
||||
{{end}}
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{if not .Pubs}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
<h2 class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]">
|
||||
Nothing to see here (yet)!
|
||||
</h2>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
{{end}}
|
|
@ -11,6 +11,8 @@ Atridad Lahiji // Talks
|
|||
{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
|
||||
{{if .Talks}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
{{range .Talks}}
|
||||
{{template "cardlinks" .}}
|
||||
|
@ -18,5 +20,15 @@ Atridad Lahiji // Talks
|
|||
</section>
|
||||
{{end}}
|
||||
|
||||
{{if not .Talks}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
<h2 class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]">
|
||||
Nothing to see here (yet)!
|
||||
</h2>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
{{end}}
|
||||
|
|
|
@ -11,12 +11,24 @@ Atridad Lahiji // Tools
|
|||
{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
|
||||
{{if .Tools}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
{{range .Tools}}
|
||||
{{template "cardlinks" .}}
|
||||
{{end}}
|
||||
{{range .Tools}}
|
||||
{{template "cardlinks" .}}
|
||||
{{end}}
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{if not .Tools}}
|
||||
<section class="flex flex-row flex-wrap gap-2 justify-center align-middle">
|
||||
<h2 class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]">
|
||||
Nothing to see here (yet)!
|
||||
</h2>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{define "foot"}}
|
||||
{{end}}
|
2
public/css/styles.css
vendored
2
public/css/styles.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue