mirror of
https://github.com/mrrpnya/lipu-sona.git
synced 2025-02-13 16:44:39 +00:00
updated the makefile and all that
This commit is contained in:
parent
ea486d626a
commit
33251aa098
4 changed files with 45 additions and 12 deletions
14
Makefile
14
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/*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?theme title?></title>
|
||||
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
|
||||
<script src="/scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h2><a href="/">rnd's website</a> | </h2><h3><?theme title?></h3>
|
||||
</div>
|
||||
|
@ -14,6 +15,7 @@
|
|||
<?theme body?>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Website created and updated by /dev/urandom.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
18
upload.sh
18
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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue