@@ -10,13 +10,15 @@ $(error "No hq on the PATH? https://github.com/ludovicianul/hq/releases/tag/hq-1
1010endif
1111
1212SOURCES := $(wildcard ../lib/importer/assets/docs/* .html)
13+ IMAGES := $(wildcard ../lib/importer/assets/docs/* .png)
1314OBJECTS := $(subst ../lib/importer/assets/docs/,./,${SOURCES})
1415
1516# Create a list of all of the assets the pages need, by looking at the scripts
1617# and stylesheets they intended to download.
1718assets.txt : ${SOURCES}
1819 (echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r ' [data-plugin-only]' -f INPUT -a src ' script[src]' ; \
19- echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r ' [data-plugin-only]' -f INPUT -a href ' link[rel=stylesheet]' ) | \
20+ echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r ' [data-plugin-only]' -f INPUT -a href ' link[rel=stylesheet]' ; \
21+ echo ${IMAGES} | xargs -n1 | sed 's_\.\./lib/importer/assets/docs/_./_') | \
2022 sort -u | grep . > $@
2123
2224# Now build a Makefile dependency include, specifying the correct download
@@ -41,7 +43,7 @@ include assets.mk
4143# We can generate the .gitignore from all of the things we know we are going to
4244# end up with in the root dir.
4345.gitignore : assets.txt
44- (cat $^; printf ' %s\n' ${OBJECTS} ; echo assets.mk) | xargs -n1 basename > $@
46+ (cat $^; printf ' %s\n' ${OBJECTS} ; echo assets.mk; echo assets.txt ) | xargs -n1 basename > $@
4547all : .gitignore
4648
4749# Download the page and remove any elements marked only for plugin use.
@@ -52,7 +54,7 @@ all: .gitignore
5254# Download the asset. This is the easiest way to get the real thing, as some of
5355# them (e.g. application.css) are generated by the Prototype Kit and can't just
5456# be copied from the disk.
55- % .css % .js :
57+ % .css % .js % .png :
5658 curl --fail-with-body -o $@ -sL http://localhost:3000${SRC} || cat $@
5759
5860.PHONY : clean
0 commit comments