aboutsummaryrefslogtreecommitdiff
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
parent8bb5ee06ad1670c34bf767cce48aaf94a5804881 (diff)
fix typos, dont expand posts
-rw-r--r--docs/index.html16
-rwxr-xr-xgenerate.sh9
-rw-r--r--posts/bash_harder_with_vim.md12
3 files changed, 21 insertions, 16 deletions
diff --git a/docs/index.html b/docs/index.html
index cba94e8..200faef 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -28,12 +28,16 @@ function showPost(id) {
28 <div class="post"> 28 <div class="post">
29 <div class="date">31/07 2019</div> 29 <div class="date">31/07 2019</div>
30 <a href="#bash_harder_with_vim.md" class="post-link" onClick="showPost('bash_harder_with_vim.md')">Bash Harder With Vim</a> 30 <a href="#bash_harder_with_vim.md" class="post-link" onClick="showPost('bash_harder_with_vim.md')">Bash Harder With Vim</a>
31 <div id="bash_harder_with_vim.md" class="post-text" style="display: block"> 31 <div id="bash_harder_with_vim.md" class="post-text" style="display: none">
32 <p>Bash is tricky, don&#8217;t let your editor get in your way. Here&#8217;s a couple of neat 32 <p>Bash is tricky, don&#8217;t let your editor get in your way. Here&#8217;s a couple of neat
33addtions you could make to your <code>vimrc</code> for a better shell programming 33additions you could make to your <code>vimrc</code> for a better shell programming
34experience.</p> 34experience.</p>
35 35
36<p><strong>Man pages inside vim</strong>. Source this script to get started: </p> 36<hr/>
37
38<h4 id="Man%20pages%20inside%20vim">Man pages inside vim</h4>
39
40<p>Source this script to get started: </p>
37 41
38<pre><code>runtime ftplugin/man.vim 42<pre><code>runtime ftplugin/man.vim
39</code></pre> 43</code></pre>
@@ -46,7 +50,11 @@ and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.
46<pre><code>let g:ft_man_open_mode = &#39;tab&#39; 50<pre><code>let g:ft_man_open_mode = &#39;tab&#39;
47</code></pre> 51</code></pre>
48 52
49<p><strong>Scratchpad to test your commands</strong>. I often test my <code>sed</code> substitutions, here is 53<hr/>
54
55<h4 id="Scratchpad%20to%20test%20your%20commands">Scratchpad to test your commands</h4>
56
57<p>I often test my <code>sed</code> substitutions, here is
50a sample from the script used to generate this site: </p> 58a sample from the script used to generate this site: </p>
51 59
52<pre><code># a substitution to convert snake_case to Title Case With Spaces 60<pre><code># a substitution to convert snake_case to Title Case With Spaces
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
diff --git a/posts/bash_harder_with_vim.md b/posts/bash_harder_with_vim.md
index 15933bf..4d60831 100644
--- a/posts/bash_harder_with_vim.md
+++ b/posts/bash_harder_with_vim.md
@@ -1,8 +1,9 @@
1Bash is tricky, don't let your editor get in your way. Here's a couple of neat 1Bash is tricky, don't let your editor get in your way. Here's a couple of neat
2addtions you could make to your `vimrc` for a better shell programming 2additions you could make to your `vimrc` for a better shell programming
3experience. 3experience.
4 4* * *
5**Man pages inside vim**. Source this script to get started: 5#### Man pages inside vim
6 Source this script to get started:
6 7
7``` 8```
8runtime ftplugin/man.vim 9runtime ftplugin/man.vim
@@ -15,9 +16,10 @@ By default, the manpage is opened in a horizontal split, I prefer using a new ta
15``` 16```
16let g:ft_man_open_mode = 'tab' 17let g:ft_man_open_mode = 'tab'
17``` 18```
19* * *
18 20
19 21#### Scratchpad to test your commands
20**Scratchpad to test your commands**. I often test my `sed` substitutions, here is 22I often test my `sed` substitutions, here is
21a sample from the script used to generate this site: 23a sample from the script used to generate this site:
22 24
23``` 25```