From bfad52fec2a77888fc149a0ed4249af3509aef4a Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 25 Jan 2020 23:14:57 +0530 Subject: include commit hashes --- generate.sh | 16 +++++++++++----- post.esh | 13 ++++++++++--- posts/bash_harder_with_vim.md | 9 +++++---- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/generate.sh b/generate.sh index ee08a4b..a95fb06 100755 --- a/generate.sh +++ b/generate.sh @@ -10,11 +10,15 @@ title_wrapper() { link_wrapper() { # 1 - id # 2 - title - # 2 - date + # 3 - date + # 4 - commit hash echo -ne "
-
$3
- +
+ $3 + $4 +
+
$2
@@ -65,12 +69,14 @@ for f in $posts; do commit="$(git log -n1 --oneline "$file" | sed -e 's/\s.*$//g')" post_title=$(title_wrapper "$id") post_date=$(date -r "$file" "+%d/%m %Y") - post_link=$(link_wrapper "${id%.*}" "$post_title" "$post_date") + post_link=$(link_wrapper "${id%.*}" "$post_title" "$post_date" "$commit") echo -ne "$post_link" >> docs/index.html + id="${id%.*}" + mkdir -p "docs/posts/$id" esh -s /bin/bash \ - -o "docs/posts/${id%.*}.html" \ + -o "docs/posts/$id/index.html" \ "./post.esh" \ file="$file" \ date="$post_date" \ diff --git a/post.esh b/post.esh index 61516c0..7660113 100644 --- a/post.esh +++ b/post.esh @@ -13,14 +13,21 @@
-
<%= $date%>
- + + <%= $title%>
<% lowdown "$file"%>
- ← Back + ⟵ Back
diff --git a/posts/bash_harder_with_vim.md b/posts/bash_harder_with_vim.md index 4d60831..c7c292a 100644 --- a/posts/bash_harder_with_vim.md +++ b/posts/bash_harder_with_vim.md @@ -1,8 +1,9 @@ Bash is tricky, don't let your editor get in your way. Here's a couple of neat additions you could make to your `vimrc` for a better shell programming experience. -* * * -#### Man pages inside vim + + +### Man pages inside vim Source this script to get started: ``` @@ -16,9 +17,9 @@ By default, the manpage is opened in a horizontal split, I prefer using a new ta ``` let g:ft_man_open_mode = 'tab' ``` -* * * -#### Scratchpad to test your commands + +### Scratchpad to test your commands I often test my `sed` substitutions, here is a sample from the script used to generate this site: -- cgit v1.2.3