summaryrefslogtreecommitdiff
path: root/pages/blogposts.sh
blob: c910bd065767f20826dbc6b2e8f3293448a36be0 (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
#!/bin/sh

. ~/.config/b4rcms/basics.sh 


blogposts_database.sh

#compile the blogposts
for LINE in $( tac $DB/blogposts.txt ) ; do
	DATE=$(date -d @$(echo $LINE | cut -c -10) "+%d %b %Y, %a")
	FILE=$(echo $LINE| cut -c 12-)
	mkdir -p $SOURCE/blogposts
	echo "$(
	header $FILE;
	echo "<p> $DATE </p> <hr style=\"max-width: 11em ;margin-left:1em;\" align=\"left\"> "  ;
	cat $ROOT/blogposts/$FILE;
	footer)" >| $SOURCE/blogposts/$FILE
done
#compile the blogpost.html

printf "$(

header blogposts.html;

printf \ "
<h1> Here is all the blogposts i have posted about</h1>
<ul> 
";

for FILE in $( tac $DB/blogposts.txt | cut -c 12- ) ; do
	echo "<li> <a href="blogposts/$FILE">$FILE</a> </li>"
done

footer

)" >| $SOURCE/blogposts.html