square images only
This commit is contained in:
parent
dd4a4268e0
commit
9ff9e59a8c
213 changed files with 3 additions and 45 deletions
|
|
@ -1,18 +1,4 @@
|
|||
package html
|
||||
import "strings"
|
||||
func stripSize(path string) string {
|
||||
if strings.Contains(path, "landscape") {
|
||||
return "landscape"
|
||||
}
|
||||
if strings.Contains(path, "portrait") {
|
||||
return "portrait"
|
||||
}
|
||||
if strings.Contains(path, "large") {
|
||||
return "large"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
templ Portfolio(images []string, activePage string, pages []string) {
|
||||
@layout("portfolio") {
|
||||
<main>
|
||||
|
|
@ -20,7 +6,7 @@ templ Portfolio(images []string, activePage string, pages []string) {
|
|||
<section>
|
||||
<div id="portfolio-grid">
|
||||
for _, img := range images {
|
||||
<div class={stripSize(img)}>
|
||||
<div>
|
||||
@AvifImage("portfolio/"+img, "portfolio")
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue