summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorVincent Douillet <vincent@vdouillet.fr>2022-05-26 18:49:59 +0200
committerVincent Douillet <vincent@vdouillet.fr>2022-05-26 18:49:59 +0200
commit5490f1fd18fcc445f0c48a1ed830678e0f69ac0f (patch)
treeab8b5aac10b5d8f441f73ddad29817ddee4263ad /Makefile
parentd1f761415a8598b1acc162b4c7665ed8c6ad2c3e (diff)
switch to perl script to make the site
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 8 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 3e4c1e3..c87940d 100644
--- a/Makefile
+++ b/Makefile
@@ -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/*