diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 46 |
1 files changed, 8 insertions, 38 deletions
@@ -26,51 +26,21 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -MD=Markdown.pl -.SUFFIXES: .md .html -articles!=ls *.md -articles_html = ${articles:.md=.html} +PERL5LIB=/home/vincent/perl5/lib/perl5 -site : index about $(articles_html) +site : + @PERL5LIB=$(PERL5LIB) ./makesite.pl @echo "Copying static resources" @cp static/favicon.ico output/ @mkdir -p output/static @cp static/passthrough/* output/static @echo "done" -index : - @echo "Building $@" - @cat template/header.html > output/$@.html - @sed -i "s/\$$title/blog\.vdouillet\.fr/g" output/$@.html - @echo '<body>' >> output/$@.html - @cat template/index.html >> output/$@.html - @echo '</body>' >> output/$@.html - @cat template/footer.html >> output/$@.html - @gzip -k output/$@.html - -about : - @echo "Building $@" - @cat template/header.html > output/$@.html - @sed -i "s/\$$title/About/g" output/$@.html - @echo '<body>' >> output/$@.html - @$(MD) static/$@.md >> output/$@.html - @echo '</body>' >> output/$@.html - @cat template/footer.html >> output/$@.html - @gzip -k output/$@.html - -# compile each article -.md.html: - @echo "Processing $<" - @cat template/header.html > tmp.html - @ARTICLE_TITLE=`head -n1 $< | cut -d'#' -f2` ; \ - sed -i "s/\$$title/$$ARTICLE_TITLE/g" tmp.html - @echo '<article>' >> tmp.html - @$(MD) $< >> tmp.html - @cat template/back.html >> tmp.html - @cat template/footer.html >> tmp.html - @echo '</article>' >> tmp.html - @mv tmp.html output/`echo $@ | cut -d'-' -f2- -` - @gzip -k output/`echo $@ | cut -d'-' -f2- -` +setup : + mkdir -p output + PERL5LIB=$(PERL5LIB) perl -MCPAN -e"install File::Cat" + PERL5LIB=$(PERL5LIB) perl -MCPAN -e"install File::Slurp" + PERL5LIB=$(PERL5LIB) perl -MCPAN -e"install Text::Markdown" clean : rm -rf output/* |