aboutsummaryrefslogtreecommitdiff
path: root/generate.sh
diff options
context:
space:
mode:
authorAkshay <[email protected]>2019-10-30 06:25:20 +0000
committerAkshay <[email protected]>2019-10-30 06:25:20 +0000
commit0122516fd6b6a40fc3b78104cb38da0da4f8eb55 (patch)
tree96191cf02b3c45d853de4f648714a0d15490dc88 /generate.sh
parente9d5f995d17137e0b70855904c3315b8a4985e6f (diff)
remove all js
Diffstat (limited to 'generate.sh')
-rwxr-xr-xgenerate.sh25
1 files changed, 12 insertions, 13 deletions
diff --git a/generate.sh b/generate.sh
index 2d92b78..fbf5a4d 100755
--- a/generate.sh
+++ b/generate.sh
@@ -10,19 +10,22 @@ post_title() {
10post_wrapper() { 10post_wrapper() {
11 # 1 - post id 11 # 1 - post id
12 # 2 - post content 12 # 2 - post content
13 # 3 - date
13 title="$( post_title $1 )" 14 title="$( post_title $1 )"
14 echo -ne " 15 echo -ne "
15 <div class=\"post\"> 16 <details class=\"post\">
16 <div class=\"date\">$3</div> 17 <summary>
17 <a id=\"post-$1\" class=\"post-link\" onClick=\"showPost('$1')\" >$title</a> 18 <div class=\"date\">$3</div>
18 <div id=\"$1\" class=\"post-text\" style=\"display: none\"> 19 <span class=\"post-link\">$title</span>
20 </summary>
21 <div class=\"post-text\">
19 $2 22 $2
20 <a href=\"#$1\" class=\"post-end-link\" onClick=\"showPost('$1')\">↑ Collapse</a>
21 <div class="separator"></div> 23 <div class="separator"></div>
22 </div> 24 </div>
23 </div> 25 </details>
24 " 26 "
25} 27}
28
26# meta 29# meta
27echo " 30echo "
28<!DOCTYPE html> 31<!DOCTYPE html>
@@ -40,13 +43,6 @@ echo "
40<title>n</title> 43<title>n</title>
41" > ./docs/index.html 44" > ./docs/index.html
42 45
43# script
44echo '<script>' >> docs/index.html
45for s in ./script/*; do
46 cat "$s" >> docs/index.html
47done
48echo '</script> </head>' >> docs/index.html
49
50# body 46# body
51echo " 47echo "
52<body onload=\"gotoId()\"> 48<body onload=\"gotoId()\">
@@ -65,7 +61,10 @@ for f in $posts; do
65 file="./posts/"$f 61 file="./posts/"$f
66 echo "generating post $file" 62 echo "generating post $file"
67 id="${file##*/}" # ill name my posts just fine 63 id="${file##*/}" # ill name my posts just fine
64
68 html=$(lowdown "$file") 65 html=$(lowdown "$file")
66
67 # generate posts
69 post_date=$(date -r "$file" "+%d/%m %Y") 68 post_date=$(date -r "$file" "+%d/%m %Y")
70 post_div=$(post_wrapper "$id" "$html" "$post_date") 69 post_div=$(post_wrapper "$id" "$html" "$post_date")
71 echo -ne "$post_div" >> docs/index.html 70 echo -ne "$post_div" >> docs/index.html