diff --git a/Makefile b/Makefile index f9528e3..e0d1701 100644 --- a/Makefile +++ b/Makefile @@ -11,23 +11,27 @@ PNGS = $(patsubst $(PAGEDIR)/%,$(OUTDIR)/%,$(_PNGS)) _PAGES = $(shell find $(PAGEDIR) -name \*.md) PAGES_HTML = $(patsubst $(PAGEDIR)/%.md,$(OUTDIR)/%.html,$(_PAGES)) +_DIRECTORIES = $(shell find $(PAGEDIR)/* -type d) +DIRECTORIES = $(patsubst $(PAGEDIR)/, $(OUTDIR)/, $(_PAGES)) + _STATIC = $(shell find static/ -name \*) OUT_STATIC = $(patsubst static/%,out/%,$(_STATIC)) - .SUFFIXES: .PHONY: all upload all: $(PAGES_HTML) $(OUT_STATIC) -$(OUTDIR)/%.html: $(PAGEDIR)/%.md $(TPLDIR)/default.tpl $(OUTDIR) +upload: + ./upload.sh + +$(OUTDIR)/%.html: $(PAGEDIR)/%.md $(TPLDIR)/default.tpl + @mkdir -p $(@D) theme -t $(TPLDIR)/default.tpl -o $@ $< $(OUTDIR)/%: static/% + @mkdir -p $(@D) cp -r $< $@ -$(OUTDIR): - mkdir -p $(OUTDIR) - clean: rm -rf out/* diff --git a/static/style.css b/static/style.css index 3962d84..644316b 100644 --- a/static/style.css +++ b/static/style.css @@ -38,8 +38,20 @@ body a:visited { .footer { background: #d3d7cf; color: #555753; - font-family: sans-serif: + font-family: sans-serif; font-size: 0.8em; + padding: 12pt 6pt; +} + +.content { + margin: 0 6pt; + color: #2e3436; +} + +.info, .warning, .error { + margin: 6pt; + padding: 6pt; + font-family: sans-serif; } .info { @@ -62,4 +74,9 @@ body a:visited { color: white; } - +.spoiler { + border-left: 4px solid #2e3436; + background: #d3d7cf; + color: #2e3436; + visibility: hidden; +} diff --git a/tpl/default.tpl b/tpl/default.tpl index 0b85241..af36eaf 100644 --- a/tpl/default.tpl +++ b/tpl/default.tpl @@ -5,8 +5,9 @@ <?theme title?> + - +

rnd's website |

@@ -14,6 +15,7 @@ diff --git a/upload.sh b/upload.sh index 2609021..6c7c571 100755 --- a/upload.sh +++ b/upload.sh @@ -12,19 +12,29 @@ source ./upload.pwd LASTUPLOAD=`stat -c %Y upload.lasttime 2>/dev/null` if [[ -z $LASTUPLOAD ]]; then LASTUPLOAD=0; fi -echo "Last upload at $LASTUPLOAD" +#echo "Last upload at $LASTUPLOAD" FILES=`find out/ -type f` +UPFILES=() +UPARGS=() + for f in $FILES; do MTIME=`stat -c %Y $f` #echo "MTIME for $f: $MTIME" if [[ $MTIME -gt $LASTUPLOAD ]]; then REMOTENAME="${f#out/}" - echo "Uploading $REMOTENAME..." - curl -F "$REMOTENAME=@$f" "https://$N_USER:$N_PWD@neocities.org/api/upload" + echo "File $REMOTENAME needs uploading" + UPFILES+=("$REMOTENAME") + UPARGS+=("-F" "$REMOTENAME=@$f") + #curl -F "$REMOTENAME=@$f" "https://$N_USER:$N_PWD@neocities.org/api/upload" fi done -touch upload.lasttime +if [[ ${#UPARGS[@]} -gt 0 ]]; then + curl ${UPARGS[@]} "https://$N_USER:$N_PWD@neocities.org/api/upload" && touch upload.lasttime + else + echo "No files need to be uploaded." +fi +