From 3624bc6c786a438c429615589225da9e121e42c9 Mon Sep 17 00:00:00 2001 From: b4rkod Date: Mon, 6 May 2024 10:16:53 +0300 Subject: i don't use my custom markup anymore, Added a blogposts and index compiler --- basics.sh | 81 +++++++++++++++++++++++++++++------------------------- pages/avatar.sh | 14 ++++++++++ pages/blogposts.sh | 22 +++++++++++++++ pages/index.sh | 46 +++++++++++++++++++++++++++++++ 4 files changed, 125 insertions(+), 38 deletions(-) mode change 100644 => 100755 basics.sh create mode 100755 pages/avatar.sh create mode 100755 pages/blogposts.sh create mode 100755 pages/index.sh diff --git a/basics.sh b/basics.sh old mode 100644 new mode 100755 index 54a7f0f..21e255e --- a/basics.sh +++ b/basics.sh @@ -1,45 +1,50 @@ #!/bin/sh +TABNAME="Barkod\'s Basement" +ROOT="$HOME/www" +SOURCE="$ROOT/source" +PATH="$PATH:$ROOT/sh" +SERVER="root@23.94.92.217" +SERVERFILE="$SERVER:/var/www/b4rkod/" header() { -printf \ " - - - - - - - - - - - Barkod's Basement | $1 - - - -

$1

-
- - -
-
-" + printf \ " + + + + + + + + + + $TABNAME $([ $1 ] && printf "| $1") + + + + + +

$( [ $1 ] && printf "$1" || printf " $TABNAME")

+
+ + +
+
+ " } footer() { - printf \ ' -
-
- - - ' + printf \ ' +
+
+ + + ' } diff --git a/pages/avatar.sh b/pages/avatar.sh new file mode 100755 index 0000000..185371e --- /dev/null +++ b/pages/avatar.sh @@ -0,0 +1,14 @@ +#!/bin/sh +#compile the index.html + +. ~/.config/b4rcms/basics.sh + +echo "$( + header + echo \ " + + + + " + footer +)" >| $SOURCE/avatar.html diff --git a/pages/blogposts.sh b/pages/blogposts.sh new file mode 100755 index 0000000..81242f0 --- /dev/null +++ b/pages/blogposts.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +. ~/.config/b4rcms/basics.sh + +#compile the blogposts +for FILE in $(ls --time=creation -t $ROOT/blogposts) ; do + mkdir -p $SOURCE/blogposts + echo "$(header $FILE; cat $ROOT/blogposts/$FILE; footer)" >| $SOURCE/blogposts/$FILE +done +#compile the blogpost.html + +printf "$( + header blogposts.html; + printf \ " +

Here is all the blogposts i have posted about

+