JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
use sha1 instead of mtimes for images
authorJason Woofenden <jason@jasonwoof.com>
Mon, 18 May 2015 21:49:52 +0000 (17:49 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Mon, 18 May 2015 21:49:52 +0000 (17:49 -0400)
.gitignore
Makefile
styl.styl

index a3236b1..49668b8 100644 (file)
@@ -4,4 +4,4 @@
 /files
 /tags
 /style.css
-/.image-mtimes.styl
+/.sha1sums.styl
index dcea8ba..5787916 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,22 +3,22 @@ generated_images= $(svgs:.svg=.png)
 images=
 images += $(generated_images)
 
-objects= $(generated_images) .image-mtimes.styl style.css tags
+objects= $(generated_images) .sha1sums.styl style.css tags
 
 all: $(objects)
 
 clean:
        rm -f $(objects)
 
-style.css: styl.styl .image-mtimes.styl
+style.css: styl.styl .sha1sums.styl
        compile-stylus $<
 
-.image-mtimes.styl: $(images)
+.sha1sums.styl: $(images)
        ( \
                echo -n 'mtimes = {'; \
                div=' '; \
                for x in $^; do \
-                       echo -n "$$div '$$x': \"$$x?m=$$(stat -c '%Y' $$x)\""; \
+                       echo -n "$$div '$$x': \"$$x?m=$$(sha1sum < $$x | head -c 10)\""; \
                        div=,; \
                done; \
                echo " }"; \
index 7cf26f6..8537dfb 100644 (file)
--- a/styl.styl
+++ b/styl.styl
@@ -1,5 +1,5 @@
 @require 'inc/wfpl/stylus-helpers.styl'
-@require '.image-mtimes.styl'
+@require '.sha1sums.styl'
 
 // dimensions
 site-width = 934px // inside the shadow