-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
43 lines (32 loc) · 1.46 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
all:
@echo "update"
@echo "upload"
#update: tagebuch update_site originals quotes tidy_html minify_css
update: update_site originals tidy_html minify_css
# Update Tagebuch from Pad
tagebuch:
head -n 11 source/tagebuch.md > tmp.md
curl https://niels.piratenpad.de/ep/pad/export/ro.BRzE5G5k9v12Iz/latest?format=txt >> tmp.md
mv tmp.md source/tagebuch.md
originals:
-for SOURCEFILE in `ls -1 source/_posts/*.md`; do cp -v $$SOURCEFILE www/`echo $$SOURCEFILE | sed 's/source\/_posts\///' | sed 's/-//;s/-//;s/-/\//'`; done
update_site:
@cd source ; jekyll build
@rm -fr www
@cp -Rp source/_site www
# seems not to work too well
quotes:
-for HTMLFILE in `find www/* | grep .html`; do gsed -i 's/\“/\„/g;s/\”/\“/g' $$HTMLFILE; done
tidy_html:
-for HTMLFILE in `find www/* | grep .html`; do echo "Processing $$HTMLFILE"; tools/tidy-html5/bin/tidy -indent -wrap 0 -modify -quiet --drop-empty-elements false $$HTMLFILE; done
@echo
minify_css:
-for CSSFILE in `find www/assets/themes/tldr/* | grep .css`; do echo "Processing $$CSSFILE"; java -jar tools/yuicompressor-2.4.7/build/yuicompressor-2.4.7.jar $$CSSFILE > $$CSSFILE~; mv $$CSSFILE~ $$CSSFILE; done
# see http://nb.nathanamy.org/2012/04/rsyncing-jekyll/
upload:
rm -fr www/build www/serve
rsync --compress --recursive --checksum --delete --itemize-changes -e ssh www/ [email protected]:/projects/blog.nlohmann.me/www
serve:
@cd source ; jekyll serve --watch
clean:
rm -fr www/* source/_site