diff options
author | NerdyPepper <[email protected]> | 2019-07-31 06:45:11 +0100 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-07-31 06:45:11 +0100 |
commit | 502f7102495cf7919b3be67d1bec43a7f3591ee1 (patch) | |
tree | b7e4691923af77ac1110d48eb51fb641e89ac6c5 | |
parent | 6b84f1f763df20e86f054eabecedd98db3ed4a30 (diff) |
first post is always maximized
-rw-r--r-- | docs/index.html | 4 | ||||
-rw-r--r-- | docs/style.css | 3 | ||||
-rwxr-xr-x | generate.sh | 15 |
3 files changed, 18 insertions, 4 deletions
diff --git a/docs/index.html b/docs/index.html index 8e4f8b7..70fd4c8 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -20,13 +20,15 @@ function showPost(id) { | |||
20 | 20 | ||
21 | <body> | 21 | <body> |
22 | <h1 class="heading">n</h1> | 22 | <h1 class="heading">n</h1> |
23 | |||
24 | |||
23 | <div class="posts"> | 25 | <div class="posts"> |
24 | 26 | ||
25 | 27 | ||
26 | <div class="post"> | 28 | <div class="post"> |
27 | <div class="date">30/07 2019</div> | 29 | <div class="date">30/07 2019</div> |
28 | <a href="#hold_position!.md" class="post-link" onClick="showPost('hold_position!.md')">Hold Position!</a> | 30 | <a href="#hold_position!.md" class="post-link" onClick="showPost('hold_position!.md')">Hold Position!</a> |
29 | <div id="hold_position!.md" class="post-text" style="display: none"> | 31 | <div id="hold_position!.md" class="post-text" style="display: block"> |
30 | <p>Often times, when I run a vim command that makes “big” changes to a file (a | 32 | <p>Often times, when I run a vim command that makes “big” changes to a file (a |
31 | macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> | 33 | macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> |
32 | 34 | ||
diff --git a/docs/style.css b/docs/style.css index 3baf889..591c916 100644 --- a/docs/style.css +++ b/docs/style.css | |||
@@ -105,7 +105,8 @@ a:hover, a:active { | |||
105 | text-decoration-skip: objects edges box-decoration; | 105 | text-decoration-skip: objects edges box-decoration; |
106 | } | 106 | } |
107 | 107 | ||
108 | .post-end-link, .post-end-link:hover, .post-end-link:visited, .post-end-link:active { | 108 | .post-end-link, .post-end-link:hover, .post-end-link:visited, .post-end-link:active |
109 | { | ||
109 | text-decoration: none; | 110 | text-decoration: none; |
110 | color: var(--light-black); | 111 | color: var(--light-black); |
111 | text-shadow: none; | 112 | text-shadow: none; |
diff --git a/generate.sh b/generate.sh index 103c4a5..3386198 100755 --- a/generate.sh +++ b/generate.sh | |||
@@ -11,11 +11,15 @@ 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 | ||
14 | echo -ne " | 18 | echo -ne " |
15 | <div class=\"post\"> | 19 | <div class=\"post\"> |
16 | <div class=\"date\">$3</div> | 20 | <div class=\"date\">$3</div> |
17 | <a href=\"#$1\" class=\"post-link\" onClick=\"showPost('$1')\">$title</a> | 21 | <a href=\"#$1\" class=\"post-link\" onClick=\"showPost('$1')\">$title</a> |
18 | <div id=\"$1\" class=\"post-text\" style=\"display: none\"> | 22 | <div id=\"$1\" class=\"post-text\" style=\"display: $d\"> |
19 | $2 | 23 | $2 |
20 | <a href=\"#$1\" class=\"post-end-link\" onClick=\"showPost('$1')\">↑ Collapse</a> | 24 | <a href=\"#$1\" class=\"post-end-link\" onClick=\"showPost('$1')\">↑ Collapse</a> |
21 | <div class="separator"></div> | 25 | <div class="separator"></div> |
@@ -44,19 +48,26 @@ echo '</script> </head>' >> docs/index.html | |||
44 | echo " | 48 | echo " |
45 | <body> | 49 | <body> |
46 | <h1 class=\"heading\">n</h1> | 50 | <h1 class=\"heading\">n</h1> |
51 | " >> docs/index.html | ||
52 | |||
53 | |||
54 | # begin posts | ||
55 | echo " | ||
47 | <div class=\"posts\"> | 56 | <div class=\"posts\"> |
48 | " >> docs/index.html | 57 | " >> docs/index.html |
49 | 58 | ||
50 | # posts | 59 | # posts |
51 | posts=$(ls -t ./posts); | 60 | posts=$(ls -t ./posts); |
61 | first_visible="1" | ||
52 | for f in $posts; do | 62 | for f in $posts; do |
53 | file="./posts/"$f | 63 | file="./posts/"$f |
54 | echo "generating post $file" | 64 | echo "generating post $file" |
55 | id="${file##*/}" # ill name my posts just fine | 65 | id="${file##*/}" # ill name my posts just fine |
56 | html=$(lowdown "$file") | 66 | html=$(lowdown "$file") |
57 | post_date=$(date -r "$file" "+%d/%m %Y") | 67 | post_date=$(date -r "$file" "+%d/%m %Y") |
58 | post_div=$(post_wrapper "$id" "$html" "$post_date") | 68 | post_div=$(post_wrapper "$id" "$html" "$post_date" "$first_visible") |
59 | echo -ne "$post_div" >> docs/index.html | 69 | echo -ne "$post_div" >> docs/index.html |
70 | first_visible="0" | ||
60 | done | 71 | done |
61 | 72 | ||
62 | echo " | 73 | echo " |