beardyjay.co.uk

My main website source code, uses Hugo.
Log | Files | Refs

commit d8791c3a3a016f7343636a34f9185099653f47df
parent 744489095c8db4b031d6731ead089fa6e6d77d0c
Author: Jay Scott <jay@beardyjay.co.uk>
Date:   Fri,  8 Feb 2019 11:12:50 +0000

changing to be postfix compliant

Diffstat:
MREADME.md | 14++++++++++++++
Mssgsuckless | 26++++++++++++--------------
2 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/README.md b/README.md @@ -3,3 +3,17 @@ About ===== This is the source code to my website which uses my own bash static site generator. + +data.txt must be in the following format: + + name: + desc: + link: + +build + + make build + +deploy to S3 + + make deploy diff --git a/ssgsuckless b/ssgsuckless @@ -1,24 +1,22 @@ #!/bin/sh IFS= -source ./ssgsuckless.conf + +. ./ssgsuckless.conf build_frontpage() { - echo " <ul>" >&3 - while IFS='' read -r line || [[ -n "$line" ]]; do - if [[ $line == "name:"* ]]; then - name=${line#"name: "} - read line - desc=${line#"desc: "} - read line - link=${line#"link: "} - - echo " <li><a href=\"$link\" target=\"_blank\">$name</a> : $desc</li>" >&3 - fi + printf "<ul>\n" >&3 + while IFS='' read -r line || [ -n "$line" ]; do + name=${line#"name: "} + read line + desc=${line#"desc: "} + read line + link=${line#"link: "} + printf "<li><a href=\"%s\" target=\"_blank\">%s</a> : $desc</li>\n" $link $name >&3 read line done < $DATA_FILE - echo " </ul>" >&3 + printf " </ul>" >&3 return } @@ -27,7 +25,7 @@ test -d $OUTPUT_FOLDER || mkdir "$OUTPUT_FOLDER" exec 3> $OUTPUT_FOLDER/$INDEX_FILE test -d $LAYOUT_FOLDER || { - echo "cant find layout folder" >&2 + printf "cant find layout folder\n" >&2 exit 1 }