diff options
author | Akshay <[email protected]> | 2019-10-30 06:25:20 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2019-10-30 06:25:20 +0000 |
commit | 0122516fd6b6a40fc3b78104cb38da0da4f8eb55 (patch) | |
tree | 96191cf02b3c45d853de4f648714a0d15490dc88 /generate.sh | |
parent | e9d5f995d17137e0b70855904c3315b8a4985e6f (diff) |
remove all js
Diffstat (limited to 'generate.sh')
-rwxr-xr-x | generate.sh | 25 |
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() { | |||
10 | post_wrapper() { | 10 | post_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 |
27 | echo " | 30 | echo " |
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 | ||
44 | echo '<script>' >> docs/index.html | ||
45 | for s in ./script/*; do | ||
46 | cat "$s" >> docs/index.html | ||
47 | done | ||
48 | echo '</script> </head>' >> docs/index.html | ||
49 | |||
50 | # body | 46 | # body |
51 | echo " | 47 | echo " |
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 |