blob: 7538476338b718063b21b7db91b5aba4ff52098b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/sh
blogfile="./blogs"
outfile="./blogs/output"
index="./blogs/output/index.html"
mkdir -p $outfile
rm -rf outfile/*.html
echo """
<h1 id=blogtitle>Thing1's blogs!</h1>
<link rel=\"stylesheet\" href=\"style.css\">
<br>
<br>
<br>
<br>
""" > $index
blogs=$(ls $blogfile/*.blog)
for i in $blogs; do
out=$(echo $i | rev | cut -d '/' -f 1 | cut -d '.' -f 2- | rev)
echo """
<title>${out}</title>
<body>
<h1 id=blogtitle>$out</h1>
<a id=bloglink href=index.html>Home<a>
""" > $outfile/$out.html
cat $i | ./blogtohtml >> $outfile/$out.html
echo """
</body>
""" >> $outfile/$out.html
echo "<a id=bloglink href=${out}.html>${out}</a>" >> $index
done
|