Commit c8173150 authored by Jae's avatar Jae
Browse files

Add gallery

parent 37699688
......@@ -123,6 +123,27 @@ func main() {
})
})
// Gallery
r.GET("/gallery", func(c *gin.Context) {
var images []string
files, err := ioutil.ReadDir("./static/images")
if err != nil {
log.Fatal(err)
}
for _, file := range files {
if file.Name() != ".gitkeep" {
images = append(images, file.Name())
}
}
c.HTML(http.StatusOK, "home/gallery.tmpl", gin.H{
"title": "Gallery",
"images": images,
})
})
// Regular announcements list
r.GET("/announcements", func(c *gin.Context) {
var posts []string
......
......@@ -116,21 +116,29 @@ th {
.webring {
border: 15px solid #fff;
padding: 1rem;
display: grid;
grid-template-columns: 1fr 4fr 1fr;
grid-gap: 1rem;
text-align: center;
font: 100% system-ui, sans-serif;
}
.icon {
}
.icon {
font-size: 100px;
}
.webring a {
}
.webring a {
color: #f5a500;
}
\ No newline at end of file
}
.gallery {
display: grid;
grid-template-columns: repeat(8, 1fr);
grid-template-rows: repeat(8, 5vw);
grid-gap: 15px;
}
\ No newline at end of file
......@@ -48,6 +48,7 @@
<ul class="nav">
<li><a href="/">About</a></li>
<li><a href="/announcements/">Announcements</a></li>
<li><a href="/gallery/">Gallery</a></li>
</ul>
</header>
<hr />
......
{{ define "home/gallery.tmpl" }}
{{ template "globals/header.tmpl" .}}
<div role="main" id="main">
<h3 id="aboutTitle">Gallery</h3>
<div id="presentation" class="prestext">
<p id="generalPresentation">
Gallery of images made by Jae.
<div class="gallery">
{{ range .images }}
<figure class="gallery__item">
<a href="/assets/images/{{ . }}"><img src="/assets/images/{{ . }}" /></a>
</figure>
{{ end }}
</div>
</p>
</div>
</div>
{{ template "globals/footer.tmpl" .}}
{{ end }}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment