blob: e9cb6fc1e380db245c3cec08207a8518e8ae5d42 (
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
39
40
41
42
43
44
|
#!/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>
<a id=bloglink href=rss.xml>rss!<a>
<a id=bloglink href=seacrossedlovers.xyz>Main page<a>
<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>
<a id=bloglink href=rss.xml>rss!<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
|