aboutsummaryrefslogtreecommitdiff
path: root/generate.sh
diff options
context:
space:
mode:
authorNerdyPepper <[email protected]>2019-07-31 17:18:00 +0100
committerNerdyPepper <[email protected]>2019-07-31 17:18:00 +0100
commit05bdbd020afaf1574a1fb5c8a1c7238a2cddb091 (patch)
tree1779f2cd27d0efb4de60981d74fcfa93a4f26b66 /generate.sh
parent8bb5ee06ad1670c34bf767cce48aaf94a5804881 (diff)
fix typos, dont expand posts
Diffstat (limited to 'generate.sh')
-rwxr-xr-xgenerate.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/generate.sh b/generate.sh
index 3386198..86f6f05 100755
--- a/generate.sh
+++ b/generate.sh
@@ -11,15 +11,11 @@ post_wrapper() {
11 # 1 - post id 11 # 1 - post id
12 # 2 - post content 12 # 2 - post content
13 title="$( post_title $1 )" 13 title="$( post_title $1 )"
14 d="none";
15 if [ "$4" = "1" ]; then
16 d="block"
17 fi
18 echo -ne " 14 echo -ne "
19 <div class=\"post\"> 15 <div class=\"post\">
20 <div class=\"date\">$3</div> 16 <div class=\"date\">$3</div>
21 <a href=\"#$1\" class=\"post-link\" onClick=\"showPost('$1')\">$title</a> 17 <a href=\"#$1\" class=\"post-link\" onClick=\"showPost('$1')\">$title</a>
22 <div id=\"$1\" class=\"post-text\" style=\"display: $d\"> 18 <div id=\"$1\" class=\"post-text\" style=\"display: none\">
23 $2 19 $2
24 <a href=\"#$1\" class=\"post-end-link\" onClick=\"showPost('$1')\">↑ Collapse</a> 20 <a href=\"#$1\" class=\"post-end-link\" onClick=\"showPost('$1')\">↑ Collapse</a>
25 <div class="separator"></div> 21 <div class="separator"></div>
@@ -58,14 +54,13 @@ echo "
58 54
59# posts 55# posts
60posts=$(ls -t ./posts); 56posts=$(ls -t ./posts);
61first_visible="1"
62for f in $posts; do 57for f in $posts; do
63 file="./posts/"$f 58 file="./posts/"$f
64 echo "generating post $file" 59 echo "generating post $file"
65 id="${file##*/}" # ill name my posts just fine 60 id="${file##*/}" # ill name my posts just fine
66 html=$(lowdown "$file") 61 html=$(lowdown "$file")
67 post_date=$(date -r "$file" "+%d/%m %Y") 62 post_date=$(date -r "$file" "+%d/%m %Y")
68 post_div=$(post_wrapper "$id" "$html" "$post_date" "$first_visible") 63 post_div=$(post_wrapper "$id" "$html" "$post_date")
69 echo -ne "$post_div" >> docs/index.html 64 echo -ne "$post_div" >> docs/index.html
70 first_visible="0" 65 first_visible="0"
71done 66done