diff --git a/imgarchive.nim b/imgarchive.nim new file mode 100644 index 0000000..a4d6940 --- /dev/null +++ b/imgarchive.nim @@ -0,0 +1,30 @@ +import emerald, os, streams + +proc getItems(): seq[string] = + result = newSeq[string]() + + for kind, path in walkDir("."): + result.add(path) + +proc indexTemplate(files: seq[string]) {.html_templ.} = + html(lang = "en"): + head: + title: "Image Archive" + + body: + h1: "Image Archive" + + 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) + myTempl = newIndexTemplate() + + myTempl.files = files + myTempl.render(fs) diff --git a/imgarchive.nimble b/imgarchive.nimble new file mode 100644 index 0000000..d2e7ec9 --- /dev/null +++ b/imgarchive.nimble @@ -0,0 +1,12 @@ +# Package + +version = "0.1.0" +author = "Christine Dodrill" +description = "Tools for generating static sites for image archives" +license = "MIT" +bin = @["imgarchive"] + +# Dependencies + +requires "nim >= 0.13.0", "emerald" + diff --git a/in/XjScp8a.png b/in/XjScp8a.png new file mode 100644 index 0000000..a9ec6df Binary files /dev/null and b/in/XjScp8a.png differ diff --git a/in/index.html b/in/index.html new file mode 100644 index 0000000..56a7e94 --- /dev/null +++ b/in/index.html @@ -0,0 +1,24 @@ + + + + Image Archive + + +

Image Archive

+ + + + + + + + + + + + + + + + + diff --git a/in/lB4ICS3.png b/in/lB4ICS3.png new file mode 100644 index 0000000..850bf28 Binary files /dev/null and b/in/lB4ICS3.png differ diff --git a/in/oaw79y9.jpg b/in/oaw79y9.jpg new file mode 100644 index 0000000..2ab4cb9 Binary files /dev/null and b/in/oaw79y9.jpg differ diff --git a/in/thumbs/XjScp8a.png.thumb.png b/in/thumbs/XjScp8a.png.thumb.png new file mode 100644 index 0000000..9aad464 Binary files /dev/null and b/in/thumbs/XjScp8a.png.thumb.png differ diff --git a/in/thumbs/lB4ICS3.png.thumb.png b/in/thumbs/lB4ICS3.png.thumb.png new file mode 100644 index 0000000..8116ce6 Binary files /dev/null and b/in/thumbs/lB4ICS3.png.thumb.png differ diff --git a/in/thumbs/oaw79y9.jpg.thumb.png b/in/thumbs/oaw79y9.jpg.thumb.png new file mode 100644 index 0000000..c4f4286 Binary files /dev/null and b/in/thumbs/oaw79y9.jpg.thumb.png differ