-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a40e0d3
commit 955b760
Showing
46 changed files
with
580 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package pages | ||
package cache | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package components | ||
|
||
import ( | ||
"html/template" | ||
) | ||
|
||
type Props struct { | ||
Ascii [][]string | ||
} | ||
|
||
func (props Props) Component(t *template.Template) error { | ||
name := "ascii" | ||
|
||
filepath := "cmd/webserver/components/" + name + "/" + name + ".tmpl" | ||
|
||
if _, err := t.New(name + "-component").ParseFiles(filepath); err != nil { | ||
return err | ||
} else { | ||
return nil | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package components | ||
|
||
import ( | ||
"html/template" | ||
) | ||
|
||
type Props struct{} | ||
|
||
func (props Props) Component(t *template.Template) error { | ||
name := "footer" | ||
|
||
filepath := "cmd/webserver/components/" + name + "/" + name + ".tmpl" | ||
|
||
if _, err := t.New(name + "-component").ParseFiles(filepath); err != nil { | ||
return err | ||
} else { | ||
return nil | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,9 @@ header { | |
} | ||
} | ||
} | ||
|
||
.divider { | ||
border-block-start: var(--space-3xs) solid var(--clr-high); | ||
width: 100%; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package components | ||
|
||
import ( | ||
"html/template" | ||
|
||
ascii "personal-website/cmd/webserver/components/ascii" | ||
nav "personal-website/cmd/webserver/components/nav" | ||
) | ||
|
||
type Props struct { | ||
Ascii [][]string | ||
PageCurrent string | ||
Pages []string | ||
} | ||
|
||
func (props Props) Component(t *template.Template) error { | ||
name := "header" | ||
|
||
filepath := "cmd/webserver/components/" + name + "/" + name + ".tmpl" | ||
|
||
if err := (ascii.Props{ | ||
Ascii: props.Ascii, | ||
}.Component(t)); err != nil { | ||
return err | ||
} | ||
|
||
if err := (nav.Props{ | ||
PageCurrent: props.PageCurrent, | ||
Pages: props.Pages, | ||
}.Component(t)); err != nil { | ||
return err | ||
} | ||
|
||
if _, err := t.New(name + "-component").ParseFiles(filepath); err != nil { | ||
return err | ||
} else { | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{ define "header" }} | ||
<header> | ||
{{ template "ascii" . }} | ||
{{ template "nav" . }} | ||
<div class="divider"></div> | ||
</header> | ||
{{ end }} | ||
|
||
{{ define "header-oob" }} | ||
{{ template "nav-oob" . }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#nav { | ||
width: 100%; | ||
|
||
& a.selected { | ||
font-weight: 700; | ||
text-decoration: underline; | ||
} | ||
|
||
& ul { | ||
display: flex; | ||
justify-content: space-evenly; | ||
list-style-type: none; | ||
text-align: center; | ||
|
||
& li { | ||
flex: 1; | ||
|
||
& a { | ||
display: block; | ||
padding-block: var(--space-2xs); | ||
padding-inline: var(--space-xs); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package components | ||
|
||
import ( | ||
"html/template" | ||
) | ||
|
||
type Props struct { | ||
PageCurrent string | ||
Pages []string | ||
} | ||
|
||
func (props Props) Component(t *template.Template) error { | ||
name := "nav" | ||
|
||
filepath := "cmd/webserver/components/" + name + "/" + name + ".tmpl" | ||
|
||
if _, err := t.New(name + "-component").ParseFiles(filepath); err != nil { | ||
return err | ||
} else { | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package components | ||
|
||
import ( | ||
"html/template" | ||
) | ||
|
||
type Props struct{} | ||
|
||
func (props Props) Component(t *template.Template) error { | ||
name := "spacer" | ||
|
||
filepath := "cmd/webserver/components/" + name + "/" + name + ".tmpl" | ||
|
||
if _, err := t.New(name + "-component").ParseFiles(filepath); err != nil { | ||
return err | ||
} else { | ||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{ define "spacer" }} | ||
<span class="spacer">-</span> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package layouts | ||
|
||
import ( | ||
"html/template" | ||
|
||
// Components | ||
footer "personal-website/cmd/webserver/components/footer" | ||
header "personal-website/cmd/webserver/components/header" | ||
) | ||
|
||
type BaseLayout struct { | ||
Ascii [][]string | ||
Pages []string | ||
PageCurrent string | ||
} | ||
|
||
func (props BaseLayout) Layout(t *template.Template) error { | ||
name := "base" | ||
|
||
filepath := "cmd/webserver/layouts/" + name + ".tmpl" | ||
|
||
if _, err := t.New(name + "-layout").ParseFiles(filepath); err != nil { | ||
return err | ||
} | ||
|
||
// Components | ||
if err := (footer.Props{}.Component(t)); err != nil { | ||
return err | ||
} | ||
|
||
if err := (header.Props{ | ||
Ascii: props.Ascii, | ||
PageCurrent: props.PageCurrent, | ||
Pages: props.Pages, | ||
}.Component(t)); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{ define "base-layout" }} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content="Ethan Thoma's personal website" /> | ||
|
||
<script type="text/javascript" src="/static/js/htmx.min.js" defer></script> | ||
|
||
<link rel="stylesheet" type="text/css" href="/static/styles/main.css"> | ||
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon/favicon-32x32.png"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon/favicon-16x16.png"> | ||
<link rel="manifest" href="/static/favicon/site.webmanifest"> | ||
</head> | ||
<body> | ||
{{ template "header" . }} | ||
<main> | ||
{{ template "content" . }} | ||
</main> | ||
{{ template "footer" . }} | ||
</body> | ||
</html> | ||
{{ end }} |
Oops, something went wrong.