3
# +----------------------------------------------------------------------------+
4
# | Content Management Bash v0.1 |
5
# +----------------------------------------------------------------------------+
6
# | The CMB is licensed under GPLv3 - Copyright (C) 2010 Flavio Waechter |
8
# | This program is free software; you can redistribute it and/or modify it |
9
# | under the terms of the GNU General Public License as published by the |
10
# | Free Software Foundation; either version 3 of the License, or |
11
# | (at your option) any later version. |
13
# | This program is distributed in the hope that it will be useful, |
14
# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16
# | See the GNU General Public License for more details. |
18
# | You should have received a copy of the GNU General Public License along |
19
# | with this program; if not, see <http://www.gnu.org/licenses/>. |
20
# +----------------------------------------------------------------------------+
24
TEMPLATEFILES=$(ls -1 template)
28
CONTENTFILES=$(ls -1 content)
32
echo -ne "</div>" > template/navigation.tpl
34
echo -ne "<div id=\"navigation\">" >> template/navigation.tpl
35
echo -ne "<ul>" >> template/navigation.tpl
39
SOURCEFILENAME=$(echo $FILE | cut -d "/" -f 2)
41
echo -ne "<li><a href=\"$SOURCEFILENAME.html\">$SOURCEFILENAME</a></li>" >> template/navigation.tpl
44
echo -ne "</ul>" >> template/navigation.tpl
45
echo -ne "</div>" >> template/navigation.tpl
49
TEMPLATEHEADER=$(cat template/header.tpl)
50
TEMPLATENAVIGATION=$(cat template/navigation.tpl)
51
TEMPLATEFOOTER=$(cat template/footer.tpl)
55
CONTENTCONTENT=$(cat $FILE)
56
SOURCEFILENAME=$(echo $FILE | cut -d "/" -f 2)
58
DESTFILENAME=$(echo web/$SOURCEFILENAME.html)
61
echo "$TEMPLATEHEADER" > $DESTFILENAME
62
echo "$CONTENTCONTENT" >> $DESTFILENAME
63
echo "$TEMPLATENAVIGATION" >> $DESTFILENAME
64
echo "$TEMPLATEFOOTER" >> $DESTFILENAME