From 75ffbb322612cc65e81bbbfb5f62a650c9fb26ec Mon Sep 17 00:00:00 2001 From: Cadey Dodrill Date: Sat, 6 Aug 2016 09:28:55 -0700 Subject: [PATCH] center and theme things --- imgarchive.nim | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/imgarchive.nim b/imgarchive.nim index a4d6940..960847f 100644 --- a/imgarchive.nim +++ b/imgarchive.nim @@ -1,26 +1,33 @@ -import emerald, os, streams +import emerald, os, streams, strutils proc getItems(): seq[string] = result = newSeq[string]() for kind, path in walkDir("."): + if (path.endsWith "thumbs") or (path.endsWith "index.html"): + continue + result.add(path) proc indexTemplate(files: seq[string]) {.html_templ.} = html(lang = "en"): head: title: "Image Archive" + link(rel="stylesheet", `type`="text/css", href="/css/solarized-dark.min.css") body: h1: "Image Archive" - for path in files.items(): - a(href=path): - img(src="thumbs/" & path & ".thumb.png") + a(href=".."): "Go back" + + br(); br(); br() + + d(style="text-align: center"): + for path in files.items(): + a(href=path): + img(src="thumbs/" & path & ".thumb.png") when isMainModule: - setCurrentDir "/home/xena/pictures/derpi" - var files = getItems() fs = newFileStream("index.html", fmWrite)