From 359a92f770e621828e628f319290bb5736b1f67b Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 9 Feb 2020 10:24:03 +0530 Subject: new styles, new post! --- docs/posts/static_sites_with_bash/index.html | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'docs/posts/static_sites_with_bash/index.html') diff --git a/docs/posts/static_sites_with_bash/index.html b/docs/posts/static_sites_with_bash/index.html index 7c1adda..9eb4846 100644 --- a/docs/posts/static_sites_with_bash/index.html +++ b/docs/posts/static_sites_with_bash/index.html @@ -10,6 +10,7 @@ + Static Sites With Bash - peppe.rs
@@ -51,17 +52,17 @@ to html with lowdown.

Directory structure

I host my site on GitHub pages, so -docs/ has to be the entry point. Markdown formatted posts -go into posts/, get converted into html, and end up in -docs/index.html, something like this:

+docs/ has to be the entry point. Markdown formatted posts +go into posts/, get converted into html, and end up in +docs/index.html, something like this:

-
posts=$(ls -t ./posts)     # chronological order!
+
posts=$(ls -t ./posts)     # chronological order!
 for f in $posts; do
-    file="./posts/"$f      # `ls` mangled our file paths
-    echo "generating post $file"
+    file="./posts/"$f      # `ls` mangled our file paths
+    echo "generating post $file"
 
-    html=$(lowdown "$file")
-    echo -e "html" >> docs/index.html
+    html=$(lowdown "$file")
+    echo -e "html" >> docs/index.html
 done
 
@@ -72,15 +73,15 @@ assets into the site source itself. That does have it’s merits, but I prefer hosting images separately:

# strip file extension
-ext="${1##*.}"
+ext="${1##*.}"
 
 # generate a random file name
-id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 )
-id="$id.$ext"
+id=$( cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 2 | head -n 1 )
+id="$id.$ext"
 
 # copy to my file host
-scp -P 443 "$1" emerald:files/"$id" 
-echo "https://u.peppe.rs/$id"
+scp -P 443 "$1" emerald:files/"$id" 
+echo "https://u.peppe.rs/$id"
 

Templating

-- cgit v1.2.3