diff options
author | Akshay <[email protected]> | 2020-01-25 13:46:36 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2020-01-25 13:46:36 +0000 |
commit | 071ad3b4cb371e864316a821120ea1b63e6bf213 (patch) | |
tree | c86a4221935ff37a0bf9cfa9e1a0f423997e0ae2 | |
parent | 39d2766689801f8cd1f0ee93d231c9561687d95f (diff) |
site layout; use esh
-rw-r--r-- | docs/posts/WPA_woes.html | 68 | ||||
-rw-r--r-- | docs/posts/bash_harder_with_vim.html | 84 | ||||
-rw-r--r-- | docs/posts/bye_bye_BDFs.html | 51 | ||||
-rw-r--r-- | docs/posts/color_conundrum.html | 62 | ||||
-rw-r--r-- | docs/posts/get_better_at_yanking_and_putting_in_vim.html | 48 | ||||
-rw-r--r-- | docs/posts/hold_position!.html | 47 | ||||
-rw-r--r-- | docs/posts/my_setup.html | 52 | ||||
-rw-r--r-- | docs/posts/onivim_sucks.html | 53 | ||||
-rw-r--r-- | docs/posts/static_sites_with_bash.html | 74 | ||||
-rwxr-xr-x | generate.sh | 38 |
10 files changed, 558 insertions, 19 deletions
diff --git a/docs/posts/WPA_woes.html b/docs/posts/WPA_woes.html new file mode 100644 index 0000000..f4f8d8e --- /dev/null +++ b/docs/posts/WPA_woes.html | |||
@@ -0,0 +1,68 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">12/10 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | WPA Woes | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>I finally got around to installing Void GNU/Linux on my main | ||
21 | computer. Rolling release, non-systemd, need I say more?</p> | ||
22 | |||
23 | <p>As with all GNU/Linux distributions, wireless networks had | ||
24 | me in a fix. If you can see this post, it means I’ve managed | ||
25 | to get online. It turns out, <code>wpa_supplicant</code> was detecting the | ||
26 | wrong interface by default (does it ever select the right | ||
27 | one?). Let us fix that:</p> | ||
28 | |||
29 | <pre><code>$ sudo rm -r /var/service/wpa_supplicant | ||
30 | $ sudo killall dhcpcd | ||
31 | </code></pre> | ||
32 | |||
33 | <p>What is the right interface though?</p> | ||
34 | |||
35 | <pre><code>$ iw dev | ||
36 | ... | ||
37 | Interface wlp2s0 | ||
38 | ... | ||
39 | </code></pre> | ||
40 | |||
41 | <p>Aha! Let us run <code>wpa_supplicant</code> on that interface, as a | ||
42 | background process:</p> | ||
43 | |||
44 | <pre><code>$ sudo wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf | ||
45 | $ sudo dhcpcd -B wlp2s0 | ||
46 | $ ping google.com | ||
47 | PING ... | ||
48 | </code></pre> | ||
49 | |||
50 | <p>Yay! Make those changes perpetual by enabling the service:</p> | ||
51 | |||
52 | <pre><code>------------------------------------------------------ | ||
53 | # Add these to /etc/wpa_supplicant/wpa_supplicant.conf | ||
54 | OPTS="-B" | ||
55 | WPA_INTERFACE="wlp2s0" | ||
56 | ------------------------------------------------------ | ||
57 | $ sudo ln -s /etc/sv/wpa_supplicant /var/service/ | ||
58 | $ sudo ln -s /etc/sv/dhcpcd /var/service/ | ||
59 | $ sudo sv restart wpa_supplicant | ||
60 | $ sudo sv restart dhcpcd | ||
61 | </code></pre> | ||
62 | |||
63 | </div> | ||
64 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
65 | <div class="separator"></div> | ||
66 | </div> | ||
67 | </body> | ||
68 | </html> | ||
diff --git a/docs/posts/bash_harder_with_vim.html b/docs/posts/bash_harder_with_vim.html new file mode 100644 index 0000000..6e0f9bd --- /dev/null +++ b/docs/posts/bash_harder_with_vim.html | |||
@@ -0,0 +1,84 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">31/07 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Bash Harder With Vim | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>Bash is tricky, don’t let your editor get in your way. Here’s a couple of neat | ||
21 | additions you could make to your <code>vimrc</code> for a better shell programming | ||
22 | experience.</p> | ||
23 | |||
24 | <hr/> | ||
25 | |||
26 | <h4 id="Man%20pages%20inside%20vim">Man pages inside vim</h4> | ||
27 | |||
28 | <p>Source this script to get started: </p> | ||
29 | |||
30 | <pre><code>runtime ftplugin/man.vim | ||
31 | </code></pre> | ||
32 | |||
33 | <p>Now, you can open manpages inside vim with <code>:Man</code>! It adds nicer syntax highlighting | ||
34 | and the ability to jump around with <code>Ctrl-]</code> and <code>Ctrl-T</code>.</p> | ||
35 | |||
36 | <p>By default, the manpage is opened in a horizontal split, I prefer using a new tab:</p> | ||
37 | |||
38 | <pre><code>let g:ft_man_open_mode = 'tab' | ||
39 | </code></pre> | ||
40 | |||
41 | <hr/> | ||
42 | |||
43 | <h4 id="Scratchpad%20to%20test%20your%20commands">Scratchpad to test your commands</h4> | ||
44 | |||
45 | <p>I often test my <code>sed</code> substitutions, here is | ||
46 | a sample from the script used to generate this site: </p> | ||
47 | |||
48 | <pre><code># a substitution to convert snake_case to Title Case With Spaces | ||
49 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" | ||
50 | </code></pre> | ||
51 | |||
52 | <p>Instead of dropping into a new shell, just test it out directly from vim!</p> | ||
53 | |||
54 | <ul> | ||
55 | <li><p>Yank the line into a register:</p> | ||
56 | |||
57 | <pre><code>yy | ||
58 | </code></pre></li> | ||
59 | <li><p>Paste it into the command-line window:</p> | ||
60 | |||
61 | <pre><code>q:p | ||
62 | </code></pre></li> | ||
63 | <li><p>Make edits as required:</p> | ||
64 | |||
65 | <pre><code>syntax off # previously run commands | ||
66 | edit index.html # in a buffer! | ||
67 | w | so % | ||
68 | !echo "new_post.md" | sed -E -e "s/\..+$//g" --snip-- | ||
69 | ^--- note the use of '!' | ||
70 | </code></pre></li> | ||
71 | <li><p>Hit enter with the cursor on the line containing your command!</p> | ||
72 | |||
73 | <pre><code>$ vim | ||
74 | New Post # output | ||
75 | Press ENTER or type command to continue | ||
76 | </code></pre></li> | ||
77 | </ul> | ||
78 | |||
79 | </div> | ||
80 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
81 | <div class="separator"></div> | ||
82 | </div> | ||
83 | </body> | ||
84 | </html> | ||
diff --git a/docs/posts/bye_bye_BDFs.html b/docs/posts/bye_bye_BDFs.html new file mode 100644 index 0000000..e323c9d --- /dev/null +++ b/docs/posts/bye_bye_BDFs.html | |||
@@ -0,0 +1,51 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">07/08 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Bye Bye BDFs | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>Glyph Bitmap Distribution Format is no more, as the creators of | ||
21 | <a href="https://pango.org">Pango</a>, one of the most widely used text rendering | ||
22 | libraries, | ||
23 | <a href="https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/">announced</a> | ||
24 | their plans for Pango 1.44.</p> | ||
25 | |||
26 | <p>Until recently, Pango used FreeType to draw fonts. They will be moving over | ||
27 | to <a href="https://harfbuzz.org">Harfbuzz</a>, an evolution of FreeType.</p> | ||
28 | |||
29 | <p><em>Why?</em></p> | ||
30 | |||
31 | <p>In short, FreeType was hard to work with. It required complex logic, and | ||
32 | provided no advantage over Harfbuzz (other than being able to fetch | ||
33 | opentype metrics with ease).</p> | ||
34 | |||
35 | <p>Upgrading to Pango v1.44 will break your GTK applications (if you use a | ||
36 | <code>bdf</code>/<code>pcf</code> bitmap font). Harfbuzz <em>does</em> support bitmap-only OpenType fonts, | ||
37 | <code>otb</code>s. Convert your existing fonts over to <code>otb</code>s using | ||
38 | <a href="https://fontforge.github.io">FontForge</a>. It is to be noted that applications | ||
39 | such as <code>xterm</code> and <code>rxvt</code> use <code>xft</code> (X FreeType) to render fonts, and will | ||
40 | remain unaffected by the update.</p> | ||
41 | |||
42 | <p>Both <a href="https://github.com/nerdypepper/scientifica">scientifica</a> and | ||
43 | <a href="https://github.com/nerdypepper/curie">curie</a> will soon ship with bitmap-only | ||
44 | OpenType font formats.</p> | ||
45 | |||
46 | </div> | ||
47 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
48 | <div class="separator"></div> | ||
49 | </div> | ||
50 | </body> | ||
51 | </html> | ||
diff --git a/docs/posts/color_conundrum.html b/docs/posts/color_conundrum.html new file mode 100644 index 0000000..979dc9c --- /dev/null +++ b/docs/posts/color_conundrum.html | |||
@@ -0,0 +1,62 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">31/12 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Color Conundrum | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>This piece aims to highlight (pun intended) some of the | ||
21 | reasons behind my <a href="https://files.nerdypepper.tech/bF.png">color | ||
22 | free</a> editor setup.</p> | ||
23 | |||
24 | <p>Imagine highlighting an entire book because <em>all</em> of it is | ||
25 | important. That is exactly what (most) syntax highlighting | ||
26 | does. It is difficult for the human eye to filter out noise | ||
27 | in rainbow barf. Use color to draw attention, not diverge | ||
28 | it.</p> | ||
29 | |||
30 | <p>At the same time, a book devoid of color is <em>boring!</em> What | ||
31 | is the takeaway from this 10 line paragraph? What are the | ||
32 | technical terms used?</p> | ||
33 | |||
34 | <p>Prose and code are certainly different, but the fickle | ||
35 | minded human eye is the same. The eye constantly looks for a | ||
36 | frame of reference, a focal point. It grows tired when it | ||
37 | can’t find one.</p> | ||
38 | |||
39 | <p>The following comparison does a better job of explaining | ||
40 | (none, ample and over-the-top highlighting, from left to | ||
41 | right):</p> | ||
42 | |||
43 | <p><a href="https://files.nerdypepper.tech/lt.png"><img src="https://files.nerdypepper.tech/lt.png" alt="hi.png" /></a></p> | ||
44 | |||
45 | <p>Without highlighting (far left), it is hard to differentiate | ||
46 | between comments and code! The florid color scheme (far | ||
47 | right) is no good either, it contains too many attention | ||
48 | grabbers. The center sample is a healthy balance of both. | ||
49 | Function calls and constants stand out, and repetitive | ||
50 | keywords and other noise (<code>let</code>, <code>as</code>) are mildly dimmed | ||
51 | out. Comments and non-code text (sign column, status text) | ||
52 | are dimmed further.</p> | ||
53 | |||
54 | <p>I’ll stop myself before I rant about color contrast and | ||
55 | combinations.</p> | ||
56 | |||
57 | </div> | ||
58 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
59 | <div class="separator"></div> | ||
60 | </div> | ||
61 | </body> | ||
62 | </html> | ||
diff --git a/docs/posts/get_better_at_yanking_and_putting_in_vim.html b/docs/posts/get_better_at_yanking_and_putting_in_vim.html new file mode 100644 index 0000000..82b283f --- /dev/null +++ b/docs/posts/get_better_at_yanking_and_putting_in_vim.html | |||
@@ -0,0 +1,48 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">29/07 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Get Better At Yanking And Putting In Vim | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <ol start="1"> | ||
21 | <li><p>reselecting previously selected text (i use this to fix botched selections):</p> | ||
22 | |||
23 | <pre><code>gv " :h gv for more | ||
24 | " you can use `o` in visual mode to go to the `Other` end of the selection | ||
25 | " use a motion to fix the selection | ||
26 | </code></pre></li> | ||
27 | <li><p>reselecting previously yanked text:</p> | ||
28 | |||
29 | <pre><code>`[v`] | ||
30 | `[ " marks the beginning of the previously yanked text :h `[ | ||
31 | `] " marks the end :h `] | ||
32 | v " visual select everything in between | ||
33 | |||
34 | nnoremap gb `[v`] " "a quick map to perform the above | ||
35 | </code></pre></li> | ||
36 | <li><p>pasting and indenting text (in one go):</p> | ||
37 | |||
38 | <pre><code>]p " put (p) and adjust indent to current line | ||
39 | ]P " put the text before the cursor (P) and adjust indent to current line | ||
40 | </code></pre></li> | ||
41 | </ol> | ||
42 | |||
43 | </div> | ||
44 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
45 | <div class="separator"></div> | ||
46 | </div> | ||
47 | </body> | ||
48 | </html> | ||
diff --git a/docs/posts/hold_position!.html b/docs/posts/hold_position!.html new file mode 100644 index 0000000..a0f3fdf --- /dev/null +++ b/docs/posts/hold_position!.html | |||
@@ -0,0 +1,47 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">30/07 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Hold Position! | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>Often times, when I run a vim command that makes “big” changes to a file (a | ||
21 | macro or a <code>:vimgrep</code> command) I lose my original position and feel disoriented.</p> | ||
22 | |||
23 | <p><em>Save position with <code>winsaveview()</code>!</em></p> | ||
24 | |||
25 | <p>The <code>winsaveview()</code> command returns a <code>Dictionary</code> that contains information | ||
26 | about the view of the current window. This includes the cursor line number, | ||
27 | cursor coloumn, the top most line in the window and a couple of other values, | ||
28 | none of which concern us.</p> | ||
29 | |||
30 | <p>Before running our command (one that jumps around the buffer, a lot), we save | ||
31 | our view, and restore it once its done, with <code>winrestview</code>.</p> | ||
32 | |||
33 | <pre><code>let view = winsaveview() | ||
34 | s/\s\+$//gc " find and (confirm) replace trailing blanks | ||
35 | winrestview(view) " restore our original view! | ||
36 | </code></pre> | ||
37 | |||
38 | <p>It might seem a little overkill in the above example, just use “ (double | ||
39 | backticks) instead, but it comes in handy when you run your file through | ||
40 | heavier filtering.</p> | ||
41 | |||
42 | </div> | ||
43 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
44 | <div class="separator"></div> | ||
45 | </div> | ||
46 | </body> | ||
47 | </html> | ||
diff --git a/docs/posts/my_setup.html b/docs/posts/my_setup.html new file mode 100644 index 0000000..4eb6605 --- /dev/null +++ b/docs/posts/my_setup.html | |||
@@ -0,0 +1,52 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">07/11 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | My Setup | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>Decided to do one of these because everyone does one of | ||
21 | these.</p> | ||
22 | |||
23 | <p><img src="https://files.nerdypepper.tech/Hb.png" alt="scrot" /></p> | ||
24 | |||
25 | <p>My entire setup is managed with GNU <code>stow</code>, making it easier | ||
26 | to replicate on fresh installations. You can find my | ||
27 | configuration files on <a href="https://github.com/nerdypepper">GitHub</a>.</p> | ||
28 | |||
29 | <p>I run Void Linux (glibc) on my | ||
30 | <a href="https://store.hp.com/us/en/mdp/laptops/envy-13">HP Envy 13" (2018)</a>. | ||
31 | To keep things simple, I run a raw X session with <code>2bwm</code> as my | ||
32 | window manager, along with <code>dunst</code> (notification daemon) and | ||
33 | Sam’s <a href="https://github.com/sdhand/compton"><code>compton</code></a> | ||
34 | (compositor) fork.</p> | ||
35 | |||
36 | <p>I am a fan of GNU tools, so I use <code>bash</code> as my shell, and | ||
37 | <code>coreutils</code> to manage files, archives, strings, paths etc. I | ||
38 | edit files with <code>vim</code>, chat with <code>weechat</code>, listen to music | ||
39 | with <code>cmus</code>, monitor processes with <code>htop</code>, manage sessions | ||
40 | with <code>tmux</code>, read pdfs in <code>zathura</code>. I rarely ever leave | ||
41 | the comfort of my terminal emulator, <code>urxvt</code>.</p> | ||
42 | |||
43 | <p>Most of my academic typesetting is done with TeX, and | ||
44 | compiled with <code>xelatex</code>. Other <em>fun</em> documents are made with | ||
45 | GIMP :).</p> | ||
46 | |||
47 | </div> | ||
48 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
49 | <div class="separator"></div> | ||
50 | </div> | ||
51 | </body> | ||
52 | </html> | ||
diff --git a/docs/posts/onivim_sucks.html b/docs/posts/onivim_sucks.html new file mode 100644 index 0000000..ea621c4 --- /dev/null +++ b/docs/posts/onivim_sucks.html | |||
@@ -0,0 +1,53 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">02/08 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Onivim Sucks | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p><a href="https://v2.onivim.io">Onivim</a> is a ‘modern modal editor’, combining fancy | ||
21 | interface and language features with vim-style modal editing. What’s wrong you | ||
22 | ask?</p> | ||
23 | |||
24 | <p>Apart from <a href="https://github.com/onivim/oni2/issues/550">buggy syntax highlighting</a>, | ||
25 | <a href="https://github.com/onivim/oni2/issues/519">broken scrolling</a> and | ||
26 | <a href="https://github.com/onivim/oni2/issues?q=is%3Aissue+label%3A%22daily+editor+blocker%22+is%3Aopen">others</a>, | ||
27 | Onivim is <strong>proprietary</strong> software. It is licensed under a commercial | ||
28 | <a href="https://github.com/onivim/oni1/blob/master/Outrun-Labs-EULA-v1.1.md">end user agreement license</a>, | ||
29 | which prohibits redistribution in both object code and source code formats.</p> | ||
30 | |||
31 | <p>Onivim’s core editor logic (bits that belong to vim), have been separated from | ||
32 | the interface, into <a href="https://github.com/onivim/libvim">libvim</a>. libvim is | ||
33 | licensed under MIT, which means, this ‘extension’ of vim is perfectly in | ||
34 | adherence to <a href="http://vimdoc.sourceforge.net/htmldoc/uganda.html#license">vim’s license text</a>! | ||
35 | Outrun Labs are exploiting this loophole (distributing vim as a library) to | ||
36 | commercialize Onivim.</p> | ||
37 | |||
38 | <p>Onivim’s source code is available on <a href="https://github.com/onivim/oni2">GitHub</a>. | ||
39 | They do mention that the source code trickles down to the | ||
40 | <a href="https://github.com/onivim/oni2-mit">oni2-mit</a> repository, which (not yet) contains | ||
41 | MIT-licensed code, <strong>18 months</strong> after each commit to the original repository.</p> | ||
42 | |||
43 | <p>Want to contribute to Onivim? Don’t. They make a profit out of your contributions. | ||
44 | Currently, Onivim is priced at $19.99, ‘pre-alpha’ pricing which is 80% off the | ||
45 | final price! If you are on the lookout for an editor, I would suggest using | ||
46 | <a href="https://vim.org">Vim</a>, charity ware that actually works, and costs $100 lesser.</p> | ||
47 | |||
48 | </div> | ||
49 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
50 | <div class="separator"></div> | ||
51 | </div> | ||
52 | </body> | ||
53 | </html> | ||
diff --git a/docs/posts/static_sites_with_bash.html b/docs/posts/static_sites_with_bash.html new file mode 100644 index 0000000..70eda1a --- /dev/null +++ b/docs/posts/static_sites_with_bash.html | |||
@@ -0,0 +1,74 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <html lang="en"> | ||
3 | <head> | ||
4 | <link rel="stylesheet" href="/style.css"> | ||
5 | <meta charset="UTF-8"> | ||
6 | <meta name="viewport" content="initial-scale=1"> | ||
7 | <meta content="#ffffff" name="theme-color"> | ||
8 | <meta name="HandheldFriendly" content="true"> | ||
9 | <meta property="og:title" content="nerdypepper"> | ||
10 | <meta property="og:type" content="website"> | ||
11 | <meta property="og:description" content="a static site {for, by, about} me "> | ||
12 | <meta property="og:url" content="https://nerdypepper.tech"> | ||
13 | <body> | ||
14 | <div class="post posts"> | ||
15 | <div class="date">23/11 2019</div> | ||
16 | <span style="font-size: 2rem; font-weight: 600"> | ||
17 | Static Sites With Bash | ||
18 | </span> | ||
19 | <div class="post-text"> | ||
20 | <p>After going through a bunch of static site generators | ||
21 | (<a href="https://blog.getpelican.com/">pelican</a>, | ||
22 | <a href="https://gohugo.io">hugo</a>, | ||
23 | <a href="https://github.com/icyphox/vite">vite</a>), I decided to roll | ||
24 | my own. If you are more of the ‘show me the code’ kinda guy, | ||
25 | <a href="https://github.com/nerdypepper/site">here</a> you go.</p> | ||
26 | |||
27 | <p><strong>Text formatting</strong>: I chose to write in markdown, and convert | ||
28 | to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> | ||
29 | |||
30 | <p><strong>Directory structure</strong>: I host my site on GitHub pages, so | ||
31 | <code>docs/</code> has to be the entry point. Markdown formatted posts | ||
32 | go into <code>posts/</code>, get converted into html, and end up in | ||
33 | <code>docs/index.html</code>, something like this:</p> | ||
34 | |||
35 | <pre><code>posts=$(ls -t ./posts) # chronological order! | ||
36 | for f in $posts; do | ||
37 | file="./posts/"$f # `ls` mangled our file paths | ||
38 | echo "generating post $file" | ||
39 | |||
40 | html=$(lowdown "$file") | ||
41 | echo -e "html" >> docs/index.html | ||
42 | done | ||
43 | </code></pre> | ||
44 | |||
45 | <p><strong>Assets</strong>: Most static site generators recommend dropping image | ||
46 | assets into the site source itself. That does have it’s | ||
47 | merits, but I prefer hosting images separately:</p> | ||
48 | |||
49 | <pre><code># strip file extension | ||
50 | ext="${1##*.}" | ||
51 | |||
52 | # generate a random file name | ||
53 | id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 ) | ||
54 | id="$id.$ext" | ||
55 | |||
56 | # copy to my file host | ||
57 | scp -P 443 "$1" emerald:files/"$id" | ||
58 | echo "https://files.nerdypepper.tech/$id" | ||
59 | </code></pre> | ||
60 | |||
61 | <p><strong>Templating</strong>: | ||
62 | <a href="https://github.com/NerdyPepper/site/blob/master/generate.sh"><code>generate.sh</code></a> | ||
63 | brings the above bits and pieces together (with some extra | ||
64 | cruft to avoid javascript). It uses <code>sed</code> to produce nice | ||
65 | titles from the file names (removes underscores, | ||
66 | title-case), and <code>date(1)</code> to add the date to each post | ||
67 | listing!</p> | ||
68 | |||
69 | </div> | ||
70 | <a href="/index.html" class="post-end-link">‹ Back</a> | ||
71 | <div class="separator"></div> | ||
72 | </div> | ||
73 | </body> | ||
74 | </html> | ||
diff --git a/generate.sh b/generate.sh index af70b33..5399b3a 100755 --- a/generate.sh +++ b/generate.sh | |||
@@ -1,28 +1,23 @@ | |||
1 | #! /usr/bin/env bash | 1 | #! /usr/bin/env bash |
2 | 2 | ||
3 | 3 | ||
4 | post_title() { | 4 | title_wrapper() { |
5 | # remove extension | 5 | # remove extension |
6 | # snake to title case | 6 | # snake to title case |
7 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" | 7 | echo "$1" | sed -E -e "s/\..+$//g" -e "s/_(.)/ \u\1/g" -e "s/^(.)/\u\1/g" |
8 | } | 8 | } |
9 | 9 | ||
10 | post_wrapper() { | 10 | link_wrapper() { |
11 | # 1 - post id | 11 | # 1 - id |
12 | # 2 - post content | 12 | # 2 - title |
13 | # 3 - date | 13 | # 2 - date |
14 | title="$( post_title $1 )" | ||
15 | echo -ne " | 14 | echo -ne " |
16 | <details class=\"post\"> | 15 | <div class=\"post\"> |
17 | <summary> | 16 | <div class=\"date\">$3</div> |
18 | <div class=\"date\">$3</div> | 17 | <a href=\"/posts/$1.html\" class=\"post-link\"> |
19 | <span class=\"post-link\">$title</span> | 18 | <span class=\"post-link\">$2</span> |
20 | </summary> | 19 | </a> |
21 | <div class=\"post-text\"> | 20 | </div> |
22 | $2 | ||
23 | <div class="separator"></div> | ||
24 | </div> | ||
25 | </details> | ||
26 | " | 21 | " |
27 | } | 22 | } |
28 | 23 | ||
@@ -57,17 +52,22 @@ echo " | |||
57 | 52 | ||
58 | # posts | 53 | # posts |
59 | posts=$(ls -t ./posts); | 54 | posts=$(ls -t ./posts); |
55 | mkdir -p docs/posts | ||
56 | |||
60 | for f in $posts; do | 57 | for f in $posts; do |
61 | file="./posts/"$f | 58 | file="./posts/"$f |
62 | echo "generating post $file" | 59 | echo "generating post $file" |
63 | id="${file##*/}" # ill name my posts just fine | 60 | id="${file##*/}" # ill name my posts just fine |
64 | 61 | ||
65 | html=$(lowdown "$file") | ||
66 | 62 | ||
67 | # generate posts | 63 | # generate posts |
64 | html=$(lowdown "$file") | ||
65 | post_title=$(title_wrapper "$id") | ||
68 | post_date=$(date -r "$file" "+%d/%m %Y") | 66 | post_date=$(date -r "$file" "+%d/%m %Y") |
69 | post_div=$(post_wrapper "$id" "$html" "$post_date") | 67 | post_link=$(link_wrapper "${id%.*}" "$post_title" "$post_date") |
70 | echo -ne "$post_div" >> docs/index.html | 68 | |
69 | echo -ne "$post_link" >> docs/index.html | ||
70 | esh -s /bin/bash -o "docs/posts/${id%.*}.html" "./post.esh" file="$file" date="$post_date" title="$post_title" | ||
71 | first_visible="0" | 71 | first_visible="0" |
72 | done | 72 | done |
73 | 73 | ||