aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-26 18:52:10 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-26 18:52:10 -0700
commit76df41816c4e57a6c8ada845a2ead90d4d3b5b97 (patch)
tree127796152c38bd89a0eafc2d92ca4ee231d5ce09
parentee570cab6af160bd50262f81f0e1f17e988b6e45 (diff)
Have index.html on web page redirect to latest version.
-rw-r--r--Makefile14
-rw-r--r--spec.redirect.in11
2 files changed, 17 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2c293d1..c2899ea 100644
--- a/Makefile
+++ b/Makefile
@@ -89,27 +89,25 @@ fuzztest:
for i in `seq 1 10`; do \
time cat /dev/urandom | head -c 100000 | iconv -f latin1 -t utf-8 | $(PROG) >/dev/null; done
-index.md: _site/$(SPECVERSION)/index.html
- echo "% CommonMark Spec\n" > $@
- for vers in $(shell cd _site; ls -d -t 0.*) ; do \
- echo "- [Version $$vers](/$$vers/)" >> $@ ; done
+_site/spec.html: spec.redirect.in
+ perl -pe 's/VERSION/$(SPECVERSION)/g' $< > $@
-_site/index.html: index.md
- pandoc --template template.html -S -s -t html5 -o $@ $<
+_site/index.html: _site/spec.html
+ cp $< $@
_site/$(SPECVERSION)/index.html: spec.html
mkdir -p _site/$(SPECVERSION)
cp $< $@
cd _site; git add $(SPECVERSION)/index.html; git commit -a -m "Added version $(SPECVERSION) of spec"; cd ..
-update-site: spec.html js/commonmark.js _site/index.html _site/$(SPECVERSION)/index.html
+update-site: spec.html js/commonmark.js _site/index.html _site/$(SPECVERSION)/index.html _site/spec.html
cp js/index.html _site/js/
cp js/commonmark.js _site/js/
cp js/LICENSE _site/js/
(cd _site ; git pull ; git commit -a -m "Updated site for latest spec, js" ; git push; cd ..)
clean:
- -rm -f test $(SRCDIR)/*.o $(SRCDIR)/scanners.c $(SRCDIR)/html/*.o libcmark.so index.md
+ -rm -f test $(SRCDIR)/*.o $(SRCDIR)/scanners.c $(SRCDIR)/html/*.o libcmark.so
-rm js/commonmark.js
-rm -rf *.dSYM
-rm -f README.html
diff --git a/spec.redirect.in b/spec.redirect.in
new file mode 100644
index 0000000..1727497
--- /dev/null
+++ b/spec.redirect.in
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CommonMark Spec</title>
+ <meta http-equiv="refresh" content="0;URL='http://spec.commonmark.org/VERSION/" >
+ </head>
+ <body>
+ <p>The most recent version of the CommonMark Spec can be found
+at <a href="http://spec.commonmark.org/VERSION/">http://spec.commonmark.org/VERSION/</a>.</p>
+ </body>
+</html>