Mercurial > dottes
annotate makeWeb.sh @ 45:689026e2de0c
Web. Add download links for book.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sun, 04 Mar 2012 13:07:50 +0000 |
parents | d92717f8130c |
children | a63e39fc3410 |
rev | line source |
---|---|
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
1 #!/bin/bash |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
2 # |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
3 # Build the website. The common items and the web items are assumed |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
4 # to be already built. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
5 # |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
6 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
7 if [ $# != 1 ]; then |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
8 echo "Usage: makeWeb.sh <book dir name>" |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
9 exit 1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
10 fi |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
11 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
12 dir=`pwd` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
13 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
14 booke=$dir/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
15 webdir=$dir/web/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
16 graphicsdir=$dir/graphics/$1 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
17 output=index.html |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
18 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
19 buildno=`cat buildno.txt` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
20 subtitle= |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
21 intro= |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
22 if [ -r $booke/subtitle.txt ]; then |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
23 subtitle=`cat $booke/subtitle.txt` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
24 fi |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
25 if [ -r $booke/intro.txt ]; then |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
26 intro=`cat $booke/intro.txt` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
27 fi |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
28 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
29 mkdir -p $webdir |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
30 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
31 sed -e "s/@BUILD@/$buildno/" -e "s/@SUBTITLE@/$subtitle/" \ |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
32 -e "s/@INTRO@/$intro/" -e "s/@BOOK@/$1/" dottes.html.header > $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
33 |
45
689026e2de0c
Web. Add download links for book.
Jim Hague <jim.hague@laicatc.com>
parents:
43
diff
changeset
|
34 cp $1.pdf $1-booklet.pdf $webdir |
689026e2de0c
Web. Add download links for book.
Jim Hague <jim.hague@laicatc.com>
parents:
43
diff
changeset
|
35 |
43
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
36 # Now, for each tune, make the tune graphic and sound. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
37 find $booke -name "*.abc" | sort | |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
38 while read filename |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
39 do |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
40 title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
41 name=`basename $filename .abc` |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
42 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
43 # Copy tune PDF from common graphics. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
44 cp $graphicsdir/${name}.pdf $webdir |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
45 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
46 # And copy the ABC. |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
47 cp $filename $webdir |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
48 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
49 echo "<tr>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
50 echo "<td>${title}</td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
51 echo "<td><a href=\"${name}.jpg\">JPG</a></td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
52 echo "<td><a href=\"${name}.pdf\">PDF</a></td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
53 echo "<td><a href=\"${name}.mid\">MIDI</a></td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
54 echo "<td><a href=\"${name}.mp3\">MP3</a></td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
55 echo "<td><a href=\"${name}.abc\">ABC</a></td>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
56 echo "</tr>" >> $webdir/$output |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
57 done |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
58 |
d92717f8130c
First go at producing a very simple website.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
59 cat dottes.html.footer >> $webdir/$output |