ditches git archive method for rsync
authorDaniel <thefekete@gmail.com>
Tue, 23 Jun 2020 00:23:38 +0000 (02:23 +0200)
committerDaniel <thefekete@gmail.com>
Tue, 23 Jun 2020 00:24:01 +0000 (02:24 +0200)
.gitattributes [deleted file]
.gitignore
Makefile

diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644 (file)
index 0f54211..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile export-ignore
-.gitattributes export-ignore
-.gitignore export-ignore
index 0b84df0..d163863 100644 (file)
@@ -1 +1 @@
-*.html
\ No newline at end of file
+build/
\ No newline at end of file
index a2f747b..202b9e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,18 @@
 M=$(wildcard *.md)
-H=$(patsubst %.md,%.html,$M)
+H=$(patsubst %.md,build/%.html,$M)
+L=img/
 
 all: $H
 
-%.html: %.md
+build/:
+       mkdir -p $@
+
+build/%.html: %.md build/
        markdown $< >$@
+       cp -a $L build/
 
 view:
-       xdg-open index.html
+       xdg-open build/index.html
 
 publish: all
        @git diff-index --quiet HEAD -- && test -z "$(git ls-files --others)" || ( \
@@ -15,10 +20,9 @@ publish: all
                git status; \
                exit 1; \
        )
-       git archive --format=tgz HEAD \
-               | ssh root@thefekete.net "cd /var/www/thefekete.net && tar zxvf -"
+       rsync -vha --delete build/ root@thefekete.net:/var/www/thefekete.net/
 
 clean:
-       rm -f $H
+       rm -rfv build/
 
 .PHONY: all publish view clean