Added again
This commit is contained in:
parent
6f62715ca1
commit
8139180727
0
blog/2023-08-31.wiki
Normal file
0
blog/2023-08-31.wiki
Normal file
0
blog/2023-08-32.wiki
Normal file
0
blog/2023-08-32.wiki
Normal file
1
utils/generate-new-blog-page.sh
Normal file
1
utils/generate-new-blog-page.sh
Normal file
@ -0,0 +1 @@
|
||||
#!/usr/bin/bash
|
3
utils/generate-new.sh
Normal file
3
utils/generate-new.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
|
BIN
utils/libs/.blog-page.sh.swp
Normal file
BIN
utils/libs/.blog-page.sh.swp
Normal file
Binary file not shown.
30
utils/libs/blog-page.sh
Executable file
30
utils/libs/blog-page.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user