Added again

This commit is contained in:
Tristan Ancelet 2023-08-31 22:54:17 -05:00
parent 6f62715ca1
commit 8139180727
6 changed files with 34 additions and 0 deletions

0
blog/2023-08-31.wiki Normal file
View File

0
blog/2023-08-32.wiki Normal file
View File

View File

@ -0,0 +1 @@
#!/usr/bin/bash

3
utils/generate-new.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash

Binary file not shown.

30
utils/libs/blog-page.sh Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/bash
function get_blog_pages () {
local BLOG_DIR=~/Blog
local VAR_NAME="${1:?"No variable was provided to lod the pages into"}"
local -n VAR="$VAR_NAME"
VAR=( $(ls $BLOG_DIR/blog/????-??-??.wiki) )
}
function get_last_5_pages (){
local -a pages
local PAGES
get_blog_pages pages
PAGES=${#pages[@]};
if [[ $PAGES -lt 5 ]]; then
for (( i=$((PAGES-1)); i==0; i--)); do
echo ${i}
done
else
echo "Hi"
fi
}
if [[ "$0" == *"blog-page.sh" ]]; then
get_last_5_pages
fi