eonn-site

scripts and documents that generate eonn.xyz
git clone git://git.eonn.xyz/eonn-site.git
Log | Files | Refs

commit 203bd2075ad8660ba5ca3d7aab08994010f7d548
parent 934ad70425081f1e0775cfe1ec7da544dab9d501
Author: Ian Ressa <ian@eonn.xyz>
Date:   Tue,  6 Sep 2022 22:13:42 -0400

Fixing multiline code problems by just using the <pre> tag

Diffstat:
Msrc/post/2020/08/07-website-generation-with-unix-coreutils.md | 14+++++++++-----
Msrc/styles.css | 6++++++
2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/post/2020/08/07-website-generation-with-unix-coreutils.md b/src/post/2020/08/07-website-generation-with-unix-coreutils.md @@ -27,19 +27,23 @@ Anjan's post mentions having to change the date_rfc_822() function in rssg to fi Since I wanted a different header based on whether the user was looking at a blogpost or the index, I made some small changes to ssg5. I separated the header definition into a "default header" and an "index header" in main(): -``h_file="$src/_header.html" +<pre> +h_file="$src/_header.html" h_index_file="$src/_header-index.html" f_file="$src/_footer.html" test -f "$f_file" && FOOTER=$(cat "$f_file") && export FOOTER test -f "$h_file" && DEFHEADER=$(cat "$h_file") && export DEFHEADER -test -f "$h_index_file" && INDEXHEADER=$(cat "$h_index_file") && export INDEXHEADER`` +test -f "$h_index_file" && INDEXHEADER=$(cat "$h_index_file") && export INDEXHEADER +</pre> -Then in render_md_files_markdown_pl(), I added a check to match the filename with index.md. This change is also pretty similar to the one in Momi's post. +Then in render\_md\_files\_markdown\_pl(), I added a check to match the filename with index.md. This change is also pretty similar to the one in Momi's post. -``if $(echo "$1/$f" | grep "index.md" > /dev/null); then +<pre> +if $(echo "$1/$f" | grep "index.md" > /dev/null); then HEADER="$INDEXHEADER" && export HEADER else HEADER="$DEFHEADER" && export HEADER -fi`` +fi +</pre> To push my website, I wrote a script that just runs the programs in order and then rsyncs it to my server. It makes and deploys super quick, and has really gotten me back in the groove of writing again. Thanks again to [Anjandev Momi](https://momi.ca/index.html) for writing a great introduction to something I probably would never have heard of otherwise. diff --git a/src/styles.css b/src/styles.css @@ -94,6 +94,12 @@ a:hover{ background:#5961b5; } +pre{ + color:white; + background-color:#333333; + padding:1px; +} + code{ color:white; background-color:#333333;