From 359a92f770e621828e628f319290bb5736b1f67b Mon Sep 17 00:00:00 2001 From: Akshay <nerdypepper@tuta.io> 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 @@ <meta property="og:type" content="website"> <meta property="og:description" content="a static site {for, by, about} me "> <meta property="og:url" content="https://peppe.rs"> + <link rel="icon" type="image/x-icon" href="/favicon.png"> <title>Static Sites With Bash - peppe.rs</title> <body> <div class="posts"> @@ -51,17 +52,17 @@ to html with <a href="https://kristaps.bsd.lv/lowdown/">lowdown</a>.</p> <h3 id="Directory%20structure">Directory structure</h3> <p>I host my site on GitHub pages, so -<code>docs/</code> has to be the entry point. Markdown formatted posts -go into <code>posts/</code>, get converted into html, and end up in -<code>docs/index.html</code>, something like this:</p> +<code>docs/</code> has to be the entry point. Markdown formatted posts +go into <code>posts/</code>, get converted into html, and end up in +<code>docs/index.html</code>, something like this:</p> -<pre><code>posts=$(ls -t ./posts) # chronological order! +<pre><code>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 </code></pre> @@ -72,15 +73,15 @@ assets into the site source itself. That does have it’s merits, but I prefer hosting images separately:</p> <pre><code># 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" </code></pre> <h3 id="Templating">Templating</h3> -- cgit v1.2.3